From 0994d91c92d5d5a9ed1f5e080a336a90925d8630 Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Mon, 22 May 2023 15:24:01 -0400 Subject: [PATCH] re-generate services (#1285) Ref: https://github.com/Azure/azure-rest-api-specs/commit/529205bb71049de32c1126c69b6016904261da32 --- .github/workflows/check-all-services.yml | 64 + services/Cargo.toml | 4 + services/mgmt/apimanagement/Cargo.toml | 6 +- services/mgmt/apimanagement/README.md | 6 +- services/mgmt/apimanagement/src/lib.rs | 8 +- .../mod.rs | 51137 +++++++++++---- .../models.rs | 4052 +- .../src/package_2023_03_01/mod.rs | 6 +- services/mgmt/arcdata/Cargo.toml | 6 +- services/mgmt/arcdata/README.md | 6 +- services/mgmt/arcdata/src/lib.rs | 8 +- .../src/package_preview_2021_06_01/mod.rs | 2921 + .../src/package_preview_2021_06_01/models.rs | 997 + .../src/package_preview_2023_03/models.rs | 2658 - .../mgmt/baremetalinfrastructure/Cargo.toml | 3 +- .../mgmt/baremetalinfrastructure/README.md | 3 +- .../mgmt/baremetalinfrastructure/src/lib.rs | 4 + .../src/package_2023_04_06}/mod.rs | 1172 +- .../src/package_2023_04_06/models.rs | 921 + services/mgmt/chaos/Cargo.toml | 7 +- services/mgmt/chaos/README.md | 7 +- services/mgmt/chaos/src/lib.rs | 20 +- .../mod.rs | 0 .../models.rs | 0 .../mod.rs | 0 .../models.rs | 76 +- .../src/package_2023_04_15_preview/mod.rs | 3209 + .../src/package_2023_04_15_preview/models.rs | 1280 + .../compute/src/package_2022_09_04/models.rs | 24 +- .../compute/src/package_2022_11_01/models.rs | 24 +- .../compute/src/package_2023_03_01/models.rs | 24 +- .../src/package_preview_2022_10/models.rs | 57 + .../src/package_preview_2023_02/models.rs | 54 + services/mgmt/cosmosdb/Cargo.toml | 6 +- services/mgmt/cosmosdb/README.md | 6 +- services/mgmt/cosmosdb/src/lib.rs | 8 +- .../src/package_preview_2022_08/models.rs | 5 +- .../src/package_preview_2022_11/models.rs | 5 +- .../src/package_preview_2023_03/models.rs | 5 +- .../mod.rs | 2330 +- .../models.rs | 1186 +- services/mgmt/costmanagement/Cargo.toml | 6 +- services/mgmt/costmanagement/README.md | 6 +- services/mgmt/costmanagement/src/lib.rs | 8 +- .../src/package_preview_2020_12/mod.rs | 3131 - .../src/package_preview_2020_12/models.rs | 2939 - .../src/package_preview_2022_04/mod.rs | 4 +- .../src/package_preview_2022_06/mod.rs | 4 +- .../src/package_preview_2022_08/mod.rs | 4 +- .../src/package_preview_2023_04/mod.rs | 6090 ++ .../src/package_preview_2023_04/models.rs | 5579 ++ services/mgmt/databricks/Cargo.toml | 3 +- services/mgmt/databricks/README.md | 3 +- services/mgmt/databricks/src/lib.rs | 4 + .../src/package_2023_05_01}/mod.rs | 2320 +- .../src/package_2023_05_01/models.rs | 1817 + .../datafactory/src/package_2018_06/models.rs | 804 +- services/mgmt/dataprotection/Cargo.toml | 6 +- services/mgmt/dataprotection/README.md | 6 +- services/mgmt/dataprotection/src/lib.rs | 8 +- .../mod.rs | 2940 +- .../models.rs | 907 +- services/mgmt/devcenter/Cargo.toml | 6 +- services/mgmt/devcenter/README.md | 6 +- services/mgmt/devcenter/src/lib.rs | 8 +- .../mod.rs | 1120 +- .../models.rs | 765 +- services/mgmt/dns/Cargo.toml | 6 +- services/mgmt/dns/README.md | 6 +- services/mgmt/dns/src/lib.rs | 8 +- .../mgmt/dns/src/package_2017_09/models.rs | 496 - .../src/package_2023_07_preview}/mod.rs | 2042 +- .../dns/src/package_2023_07_preview/models.rs | 952 + services/mgmt/elastic/Cargo.toml | 6 +- services/mgmt/elastic/README.md | 6 +- services/mgmt/elastic/src/lib.rs | 8 +- .../src/package_2023_02_01_preview/mod.rs | 88 +- .../src/package_2023_02_01_preview/models.rs | 46 +- .../src/package_2023_05_01_preview}/mod.rs | 2595 +- .../models.rs | 244 + services/mgmt/eventgrid/Cargo.toml | 1 + services/mgmt/eventgrid/README.md | 1 + services/mgmt/eventgrid/src/lib.rs | 4 + .../src/package_2023_06_preview/mod.rs | 20867 ++++++ .../src/package_2023_06_preview/models.rs | 8333 +++ .../src/package_2022_10_preview/mod.rs | 3 + services/mgmt/fist/Cargo.toml | 39 + services/mgmt/fist/README.md | 13 + services/mgmt/fist/src/lib.rs | 9 + .../src/package_2023_02_08_preview/mod.rs | 3370 + .../src/package_2023_02_08_preview/models.rs | 1783 + .../src/package_2021_11/models.rs | 3 + services/mgmt/hdinsight/Cargo.toml | 1 + services/mgmt/hdinsight/README.md | 1 + services/mgmt/hdinsight/src/lib.rs | 4 + .../src/package_preview_2023_04/mod.rs | 5828 ++ .../src/package_preview_2023_04/models.rs | 3474 + services/mgmt/help/Cargo.toml | 3 +- services/mgmt/help/README.md | 3 +- services/mgmt/help/src/lib.rs | 4 + .../src/package_2023_01_01_preview/mod.rs | 2 +- .../src/package_2023_01_01_preview/models.rs | 20 +- .../src/package_2023_06_01}/mod.rs | 593 +- .../help/src/package_2023_06_01/models.rs | 724 + services/mgmt/hybridcloud/Cargo.toml | 39 + services/mgmt/hybridcloud/README.md | 13 + services/mgmt/hybridcloud/src/lib.rs | 9 + .../src/package_2023_01_01_preview}/mod.rs | 815 +- .../src/package_2023_01_01_preview/models.rs | 713 + services/mgmt/hybridcompute/Cargo.toml | 6 +- services/mgmt/hybridcompute/README.md | 6 +- services/mgmt/hybridcompute/src/lib.rs | 8 +- .../mod.rs | 910 +- .../models.rs | 684 +- .../src/package_2023_03/mod.rs | 19 +- .../src/package_2023_03/models.rs | 54 + .../mgmt/kubernetesconfiguration/Cargo.toml | 6 +- .../mgmt/kubernetesconfiguration/README.md | 6 +- .../mgmt/kubernetesconfiguration/src/lib.rs | 8 +- .../src/package_2022_11/models.rs | 1872 - .../src/package_preview_2023_05/mod.rs | 1522 + .../src/package_preview_2023_05/models.rs | 496 + services/mgmt/liftrqumulo/Cargo.toml | 3 +- services/mgmt/liftrqumulo/README.md | 3 +- services/mgmt/liftrqumulo/src/lib.rs | 4 + .../src/package_2022_10}/mod.rs | 287 +- .../liftrqumulo/src/package_2022_10/models.rs | 688 + .../models.rs | 3 + .../mod.rs | 16 +- .../src/package_2023_01_01_preview/models.rs | 16 +- services/mgmt/postgresql/Cargo.toml | 4 +- services/mgmt/postgresql/README.md | 4 +- services/mgmt/postgresql/src/lib.rs | 8 +- .../models.rs | 2124 - .../models.rs | 11 +- .../mod.rs | 5501 ++ .../models.rs | 4039 ++ .../src/package_2023_01/models.rs | 18 +- .../src/package_2023_02/models.rs | 18 +- services/mgmt/redis/Cargo.toml | 8 +- services/mgmt/redis/README.md | 8 +- services/mgmt/redis/src/lib.rs | 16 +- .../mod.rs | 199 +- .../models.rs | 214 +- .../src/package_preview_2023_05}/mod.rs | 3455 +- .../models.rs | 529 +- .../src/package_preview_2022_04_01/models.rs | 18 +- .../src/package_preview_2023_04/models.rs | 18 +- services/mgmt/scvmm/Cargo.toml | 3 +- services/mgmt/scvmm/README.md | 3 +- services/mgmt/scvmm/src/lib.rs | 4 + .../src/package_2022_05_21_preview}/mod.rs | 5186 +- .../src/package_2022_05_21_preview/models.rs | 2659 + .../mgmt/search/src/package_2022_09/models.rs | 2 - services/mgmt/security/Cargo.toml | 12 +- services/mgmt/security/README.md | 12 +- services/mgmt/security/autorust.toml | 1 + services/mgmt/security/src/lib.rs | 40 +- .../mod.rs | 243 +- .../models.rs | 289 +- .../mgmt/security/src/package_2023_01/mod.rs | 429 + .../security/src/package_2023_01/models.rs | 315 + .../security/src/package_composite_v1/mod.rs | 16524 +++++ .../src/package_composite_v1/models.rs | 8278 +++ .../security/src/package_composite_v2/mod.rs | 17733 +++++ .../src/package_composite_v2/models.rs | 9132 +++ .../security/src/package_dotnet_sdk/mod.rs | 22016 +++++++ .../security/src/package_dotnet_sdk/models.rs | 11365 ++++ .../src/package_preview_2022_08/models.rs | 1838 - .../src/package_preview_2022_11/models.rs | 143 - .../src/package_preview_2023_02/mod.rs | 1355 - .../src/package_preview_2023_02/models.rs | 1048 - .../src/package_preview_2023_03/models.rs | 2165 - services/mgmt/securityinsights/Cargo.toml | 6 +- services/mgmt/securityinsights/README.md | 6 +- services/mgmt/securityinsights/src/lib.rs | 8 +- .../mod.rs | 13475 +++- .../models.rs | 8239 ++- .../servicefabricmanagedclusters/Cargo.toml | 6 +- .../servicefabricmanagedclusters/README.md | 6 +- .../servicefabricmanagedclusters/src/lib.rs | 8 +- .../mod.rs | 110 +- .../models.rs | 322 +- services/mgmt/servicenetworking/Cargo.toml | 3 +- services/mgmt/servicenetworking/README.md | 3 +- services/mgmt/servicenetworking/src/lib.rs | 4 + .../src/package_2023_05_01_preview}/mod.rs | 1988 +- .../src/package_2023_05_01_preview/models.rs | 720 + services/mgmt/sphere/Cargo.toml | 39 + services/mgmt/sphere/README.md | 13 + services/mgmt/sphere/src/lib.rs | 9 + .../src/package_2022_09_01_preview/mod.rs | 5743 ++ .../src/package_2022_09_01_preview/models.rs | 1495 + services/mgmt/sql/Cargo.toml | 4 +- services/mgmt/sql/README.md | 4 +- services/mgmt/sql/src/lib.rs | 8 +- .../mgmt/sql/src/package_composite_v5/mod.rs | 3877 +- .../mod.rs | 53635 +++++++++++----- .../models.rs | 10161 ++- services/mgmt/sqlvirtualmachine/Cargo.toml | 6 +- services/mgmt/sqlvirtualmachine/README.md | 6 +- services/mgmt/sqlvirtualmachine/src/lib.rs | 8 +- .../mod.rs | 380 +- .../models.rs | 321 +- services/mgmt/storagecache/Cargo.toml | 6 +- services/mgmt/storagecache/README.md | 6 +- services/mgmt/storagecache/src/lib.rs | 8 +- .../storagecache/src/package_2023_05/mod.rs | 4310 ++ .../models.rs | 1064 +- services/mgmt/web/src/package_2022_03/mod.rs | 2 +- .../src/package_2022_11_01_preview/models.rs | 16 +- services/svc/digitaltwins/Cargo.toml | 6 +- services/svc/digitaltwins/README.md | 6 +- services/svc/digitaltwins/autorust.toml | 10 + services/svc/digitaltwins/src/lib.rs | 8 +- .../mod.rs | 1370 +- .../models.rs | 263 +- .../eventgrid/src/package_2018_01/models.rs | 109 +- services/svc/filestorage/Cargo.toml | 6 +- services/svc/filestorage/README.md | 6 +- services/svc/filestorage/src/lib.rs | 8 +- .../mod.rs | 1297 +- .../models.rs | 50 +- services/svc/monitor/Cargo.toml | 3 +- services/svc/monitor/README.md | 3 +- services/svc/monitor/src/lib.rs | 4 + .../src/package_preview_2023_03/mod.rs | 8 +- .../src/package_preview_2023_05/mod.rs | 302 + .../src/package_preview_2023_05/models.rs | 227 + .../operationalinsights/src/v20221027/mod.rs | 20 +- .../src/v20221027/models.rs | 14 +- services/svc/securityinsights/Cargo.toml | 39 + services/svc/securityinsights/README.md | 13 + services/svc/securityinsights/src/lib.rs | 9 + .../src/package_2022_12/mod.rs | 219 + .../src/package_2022_12/models.rs | 92 + 236 files changed, 312831 insertions(+), 74874 deletions(-) rename services/mgmt/apimanagement/src/{package_preview_2020_06 => package_preview_2022_09}/mod.rs (57%) rename services/mgmt/apimanagement/src/{package_preview_2020_06 => package_preview_2022_09}/models.rs (71%) create mode 100644 services/mgmt/arcdata/src/package_preview_2021_06_01/mod.rs create mode 100644 services/mgmt/arcdata/src/package_preview_2021_06_01/models.rs delete mode 100644 services/mgmt/arcdata/src/package_preview_2023_03/models.rs rename services/mgmt/{dns/src/package_2017_09 => baremetalinfrastructure/src/package_2023_04_06}/mod.rs (73%) create mode 100644 services/mgmt/baremetalinfrastructure/src/package_2023_04_06/models.rs rename services/mgmt/chaos/src/{package_preview_2022_10 => package_2022_10_01_preview}/mod.rs (100%) rename services/mgmt/chaos/src/{package_preview_2022_10 => package_2022_10_01_preview}/models.rs (100%) rename services/mgmt/chaos/src/{package_preview_2023_04 => package_2023_04_01_preview}/mod.rs (100%) rename services/mgmt/chaos/src/{package_preview_2023_04 => package_2023_04_01_preview}/models.rs (96%) create mode 100644 services/mgmt/chaos/src/package_2023_04_15_preview/mod.rs create mode 100644 services/mgmt/chaos/src/package_2023_04_15_preview/models.rs rename services/mgmt/cosmosdb/src/{package_preview_2022_02 => package_preview_2023_03_15}/mod.rs (91%) rename services/mgmt/cosmosdb/src/{package_preview_2022_02 => package_preview_2023_03_15}/models.rs (87%) delete mode 100644 services/mgmt/costmanagement/src/package_preview_2020_12/mod.rs delete mode 100644 services/mgmt/costmanagement/src/package_preview_2020_12/models.rs create mode 100644 services/mgmt/costmanagement/src/package_preview_2023_04/mod.rs create mode 100644 services/mgmt/costmanagement/src/package_preview_2023_04/models.rs rename services/mgmt/{storagecache/src/package_2021_09 => databricks/src/package_2023_05_01}/mod.rs (70%) create mode 100644 services/mgmt/databricks/src/package_2023_05_01/models.rs rename services/mgmt/dataprotection/src/{package_2023_05 => package_2022_03}/mod.rs (85%) rename services/mgmt/dataprotection/src/{package_2023_05 => package_2022_03}/models.rs (79%) rename services/mgmt/devcenter/src/{package_2022_08_01_preview => package_2023_04}/mod.rs (90%) rename services/mgmt/devcenter/src/{package_2022_08_01_preview => package_2023_04}/models.rs (77%) delete mode 100644 services/mgmt/dns/src/package_2017_09/models.rs rename services/mgmt/{elastic/src/package_2021_10_01_preview => dns/src/package_2023_07_preview}/mod.rs (76%) create mode 100644 services/mgmt/dns/src/package_2023_07_preview/models.rs rename services/mgmt/{redis/src/package_2020_06 => elastic/src/package_2023_05_01_preview}/mod.rs (74%) rename services/mgmt/elastic/src/{package_2021_10_01_preview => package_2023_05_01_preview}/models.rs (81%) create mode 100644 services/mgmt/eventgrid/src/package_2023_06_preview/mod.rs create mode 100644 services/mgmt/eventgrid/src/package_2023_06_preview/models.rs create mode 100644 services/mgmt/fist/Cargo.toml create mode 100644 services/mgmt/fist/README.md create mode 100644 services/mgmt/fist/src/lib.rs create mode 100644 services/mgmt/fist/src/package_2023_02_08_preview/mod.rs create mode 100644 services/mgmt/fist/src/package_2023_02_08_preview/models.rs create mode 100644 services/mgmt/hdinsight/src/package_preview_2023_04/mod.rs create mode 100644 services/mgmt/hdinsight/src/package_preview_2023_04/models.rs rename services/mgmt/{security/src/package_preview_2022_07 => help/src/package_2023_06_01}/mod.rs (55%) create mode 100644 services/mgmt/help/src/package_2023_06_01/models.rs create mode 100644 services/mgmt/hybridcloud/Cargo.toml create mode 100644 services/mgmt/hybridcloud/README.md create mode 100644 services/mgmt/hybridcloud/src/lib.rs rename services/mgmt/{security/src/package_preview_2023_03 => hybridcloud/src/package_2023_01_01_preview}/mod.rs (59%) create mode 100644 services/mgmt/hybridcloud/src/package_2023_01_01_preview/models.rs rename services/mgmt/hybridcompute/src/{package_preview_2021_06 => package_preview_2023_03}/mod.rs (78%) rename services/mgmt/hybridcompute/src/{package_preview_2021_06 => package_preview_2023_03}/models.rs (66%) delete mode 100644 services/mgmt/kubernetesconfiguration/src/package_2022_11/models.rs create mode 100644 services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/mod.rs create mode 100644 services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/models.rs rename services/mgmt/{security/src/package_preview_2022_08 => liftrqumulo/src/package_2022_10}/mod.rs (76%) create mode 100644 services/mgmt/liftrqumulo/src/package_2022_10/models.rs delete mode 100644 services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/models.rs create mode 100644 services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/mod.rs create mode 100644 services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/models.rs rename services/mgmt/redis/src/{package_2020_12 => package_2023_04}/mod.rs (96%) rename services/mgmt/redis/src/{package_2020_12 => package_2023_04}/models.rs (84%) rename services/mgmt/{postgresql/src/package_flexibleserver_2021_06_preview => redis/src/package_preview_2023_05}/mod.rs (72%) rename services/mgmt/redis/src/{package_2020_06 => package_preview_2023_05}/models.rs (69%) rename services/mgmt/{arcdata/src/package_preview_2023_03 => scvmm/src/package_2022_05_21_preview}/mod.rs (78%) create mode 100644 services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs rename services/mgmt/security/src/{package_preview_2022_11 => package_2022_05}/mod.rs (61%) rename services/mgmt/security/src/{package_preview_2022_07 => package_2022_05}/models.rs (50%) create mode 100644 services/mgmt/security/src/package_2023_01/mod.rs create mode 100644 services/mgmt/security/src/package_2023_01/models.rs create mode 100644 services/mgmt/security/src/package_composite_v1/mod.rs create mode 100644 services/mgmt/security/src/package_composite_v1/models.rs create mode 100644 services/mgmt/security/src/package_composite_v2/mod.rs create mode 100644 services/mgmt/security/src/package_composite_v2/models.rs create mode 100644 services/mgmt/security/src/package_dotnet_sdk/mod.rs create mode 100644 services/mgmt/security/src/package_dotnet_sdk/models.rs delete mode 100644 services/mgmt/security/src/package_preview_2022_08/models.rs delete mode 100644 services/mgmt/security/src/package_preview_2022_11/models.rs delete mode 100644 services/mgmt/security/src/package_preview_2023_02/mod.rs delete mode 100644 services/mgmt/security/src/package_preview_2023_02/models.rs delete mode 100644 services/mgmt/security/src/package_preview_2023_03/models.rs rename services/mgmt/securityinsights/src/{package_preview_2022_11 => package_preview_2023_05}/mod.rs (66%) rename services/mgmt/securityinsights/src/{package_preview_2022_11 => package_preview_2023_05}/models.rs (86%) rename services/mgmt/servicefabricmanagedclusters/src/{package_2022_02_preview => package_2023_03_preview}/mod.rs (99%) rename services/mgmt/servicefabricmanagedclusters/src/{package_2022_02_preview => package_2023_03_preview}/models.rs (91%) rename services/mgmt/{kubernetesconfiguration/src/package_2022_11 => servicenetworking/src/package_2023_05_01_preview}/mod.rs (69%) create mode 100644 services/mgmt/servicenetworking/src/package_2023_05_01_preview/models.rs create mode 100644 services/mgmt/sphere/Cargo.toml create mode 100644 services/mgmt/sphere/README.md create mode 100644 services/mgmt/sphere/src/lib.rs create mode 100644 services/mgmt/sphere/src/package_2022_09_01_preview/mod.rs create mode 100644 services/mgmt/sphere/src/package_2022_09_01_preview/models.rs rename services/mgmt/sql/src/{package_composite_v4 => package_preview_2022_11}/mod.rs (69%) rename services/mgmt/sql/src/{package_composite_v4 => package_preview_2022_11}/models.rs (61%) rename services/mgmt/sqlvirtualmachine/src/{package_2022_02 => package_preview_2023_01}/mod.rs (93%) rename services/mgmt/sqlvirtualmachine/src/{package_2022_02 => package_preview_2023_01}/models.rs (85%) create mode 100644 services/mgmt/storagecache/src/package_2023_05/mod.rs rename services/mgmt/storagecache/src/{package_2021_09 => package_2023_05}/models.rs (61%) rename services/svc/digitaltwins/src/{package_2020_05_31_preview => package_2023_06_30}/mod.rs (63%) rename services/svc/digitaltwins/src/{package_2020_05_31_preview => package_2023_06_30}/models.rs (63%) rename services/svc/filestorage/src/{package_2021_02 => package_2023_01}/mod.rs (81%) rename services/svc/filestorage/src/{package_2021_02 => package_2023_01}/models.rs (96%) create mode 100644 services/svc/monitor/src/package_preview_2023_05/mod.rs create mode 100644 services/svc/monitor/src/package_preview_2023_05/models.rs create mode 100644 services/svc/securityinsights/Cargo.toml create mode 100644 services/svc/securityinsights/README.md create mode 100644 services/svc/securityinsights/src/lib.rs create mode 100644 services/svc/securityinsights/src/package_2022_12/mod.rs create mode 100644 services/svc/securityinsights/src/package_2022_12/models.rs diff --git a/.github/workflows/check-all-services.yml b/.github/workflows/check-all-services.yml index 03642e3fba..07c109f8a8 100644 --- a/.github/workflows/check-all-services.yml +++ b/.github/workflows/check-all-services.yml @@ -1371,6 +1371,22 @@ jobs: cd services cargo check --all-features -p azure_mgmt_extendedlocation + azure_mgmt_fist: + if: always() + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: check all features + run: | + cd services + cargo check --all-features -p azure_mgmt_fist + azure_mgmt_fluidrelay: if: always() runs-on: ubuntu-latest @@ -1547,6 +1563,22 @@ jobs: cd services cargo check --all-features -p azure_mgmt_hybridaks + azure_mgmt_hybridcloud: + if: always() + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: check all features + run: | + cd services + cargo check --all-features -p azure_mgmt_hybridcloud + azure_mgmt_hybridcompute: if: always() runs-on: ubuntu-latest @@ -3195,6 +3227,22 @@ jobs: cd services cargo check --all-features -p azure_mgmt_solutions + azure_mgmt_sphere: + if: always() + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: check all features + run: | + cd services + cargo check --all-features -p azure_mgmt_sphere + azure_mgmt_sql: if: always() runs-on: ubuntu-latest @@ -4107,6 +4155,22 @@ jobs: cd services cargo check --all-features -p azure_svc_schemaregistry + azure_svc_securityinsights: + if: always() + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: check all features + run: | + cd services + cargo check --all-features -p azure_svc_securityinsights + azure_svc_servicefabric: if: always() runs-on: ubuntu-latest diff --git a/services/Cargo.toml b/services/Cargo.toml index 07673b6564..3cf97b6a8c 100644 --- a/services/Cargo.toml +++ b/services/Cargo.toml @@ -85,6 +85,7 @@ members = [ "mgmt/eventgrid", "mgmt/eventhub", "mgmt/extendedlocation", + "mgmt/fist", "mgmt/fluidrelay", "mgmt/frontdoor", "mgmt/graphservicesprod", @@ -96,6 +97,7 @@ members = [ "mgmt/healthcareapis", "mgmt/help", "mgmt/hybridaks", + "mgmt/hybridcloud", "mgmt/hybridcompute", "mgmt/hybridconnectivity", "mgmt/hybriddatamanager", @@ -199,6 +201,7 @@ members = [ "mgmt/signalr", "mgmt/softwareplan", "mgmt/solutions", + "mgmt/sphere", "mgmt/sql", "mgmt/sqlvirtualmachine", "mgmt/stack", @@ -256,6 +259,7 @@ members = [ "svc/quantum", "svc/queuestorage", "svc/schemaregistry", + "svc/securityinsights", "svc/servicefabric", "svc/storagedatalake", "svc/synapse", diff --git a/services/mgmt/apimanagement/Cargo.toml b/services/mgmt/apimanagement/Cargo.toml index 2068f7e031..b91f2ffda1 100644 --- a/services/mgmt/apimanagement/Cargo.toml +++ b/services/mgmt/apimanagement/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2022-04", "enable_reqwest"] +default = ["package-preview-2022-09", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2022-09" = [] "package-preview-2022-04" = [] "package-preview-2021-12" = [] "package-preview-2021-04" = [] -"package-preview-2021-01" = [] -"package-preview-2020-06" = [] \ No newline at end of file +"package-preview-2021-01" = [] \ No newline at end of file diff --git a/services/mgmt/apimanagement/README.md b/services/mgmt/apimanagement/README.md index d229c9e6d0..feb39d2d8b 100644 --- a/services/mgmt/apimanagement/README.md +++ b/services/mgmt/apimanagement/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/apimanagem To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2022-04`. +The default tag is `package-preview-2022-09`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2022-09` has 557 operations from 1 API versions: `2022-09-01-preview`. Use crate feature `package-preview-2022-09` to enable. The operations will be in the `package_preview_2022_09` module. - `package-preview-2022-04` has 369 operations from 1 API versions: `2022-04-01-preview`. Use crate feature `package-preview-2022-04` to enable. The operations will be in the `package_preview_2022_04` module. - `package-preview-2021-12` has 355 operations from 1 API versions: `2021-12-01-preview`. Use crate feature `package-preview-2021-12` to enable. The operations will be in the `package_preview_2021_12` module. - `package-preview-2021-04` has 344 operations from 1 API versions: `2021-04-01-preview`. Use crate feature `package-preview-2021-04` to enable. The operations will be in the `package_preview_2021_04` module. -- `package-preview-2021-01` has 331 operations from 1 API versions: `2021-01-01-preview`. Use crate feature `package-preview-2021-01` to enable. The operations will be in the `package_preview_2021_01` module. -- `package-preview-2020-06` has 331 operations from 1 API versions: `2020-06-01-preview`. Use crate feature `package-preview-2020-06` to enable. The operations will be in the `package_preview_2020_06` module. \ No newline at end of file +- `package-preview-2021-01` has 331 operations from 1 API versions: `2021-01-01-preview`. Use crate feature `package-preview-2021-01` to enable. The operations will be in the `package_preview_2021_01` module. \ No newline at end of file diff --git a/services/mgmt/apimanagement/src/lib.rs b/services/mgmt/apimanagement/src/lib.rs index 258654a50a..e37c4b787d 100644 --- a/services/mgmt/apimanagement/src/lib.rs +++ b/services/mgmt/apimanagement/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2022-09")] +pub mod package_preview_2022_09; +#[cfg(all(feature = "package-preview-2022-09", not(feature = "no-default-tag")))] +pub use package_preview_2022_09::*; #[cfg(feature = "package-preview-2022-04")] pub mod package_preview_2022_04; #[cfg(all(feature = "package-preview-2022-04", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_preview_2021_04::*; pub mod package_preview_2021_01; #[cfg(all(feature = "package-preview-2021-01", not(feature = "no-default-tag")))] pub use package_preview_2021_01::*; -#[cfg(feature = "package-preview-2020-06")] -pub mod package_preview_2020_06; -#[cfg(all(feature = "package-preview-2020-06", not(feature = "no-default-tag")))] -pub use package_preview_2020_06::*; diff --git a/services/mgmt/apimanagement/src/package_preview_2020_06/mod.rs b/services/mgmt/apimanagement/src/package_preview_2022_09/mod.rs similarity index 57% rename from services/mgmt/apimanagement/src/package_preview_2020_06/mod.rs rename to services/mgmt/apimanagement/src/package_preview_2022_09/mod.rs index 308b1771cb..e67383e134 100644 --- a/services/mgmt/apimanagement/src/package_preview_2020_06/mod.rs +++ b/services/mgmt/apimanagement/src/package_preview_2022_09/mod.rs @@ -160,6 +160,24 @@ impl Client { pub fn api_version_set_client(&self) -> api_version_set::Client { api_version_set::Client(self.clone()) } + pub fn api_wiki_client(&self) -> api_wiki::Client { + api_wiki::Client(self.clone()) + } + pub fn api_wikis_client(&self) -> api_wikis::Client { + api_wikis::Client(self.clone()) + } + pub fn authorization_client(&self) -> authorization::Client { + authorization::Client(self.clone()) + } + pub fn authorization_access_policy_client(&self) -> authorization_access_policy::Client { + authorization_access_policy::Client(self.clone()) + } + pub fn authorization_login_links_client(&self) -> authorization_login_links::Client { + authorization_login_links::Client(self.clone()) + } + pub fn authorization_provider_client(&self) -> authorization_provider::Client { + authorization_provider::Client(self.clone()) + } pub fn authorization_server_client(&self) -> authorization_server::Client { authorization_server::Client(self.clone()) } @@ -187,6 +205,9 @@ impl Client { pub fn diagnostic_client(&self) -> diagnostic::Client { diagnostic::Client(self.clone()) } + pub fn documentation_client(&self) -> documentation::Client { + documentation::Client(self.clone()) + } pub fn email_template_client(&self) -> email_template::Client { email_template::Client(self.clone()) } @@ -202,6 +223,15 @@ impl Client { pub fn gateway_hostname_configuration_client(&self) -> gateway_hostname_configuration::Client { gateway_hostname_configuration::Client(self.clone()) } + pub fn global_schema_client(&self) -> global_schema::Client { + global_schema::Client(self.clone()) + } + pub fn graph_ql_api_resolver_client(&self) -> graph_ql_api_resolver::Client { + graph_ql_api_resolver::Client(self.clone()) + } + pub fn graph_ql_api_resolver_policy_client(&self) -> graph_ql_api_resolver_policy::Client { + graph_ql_api_resolver_policy::Client(self.clone()) + } pub fn group_client(&self) -> group::Client { group::Client(self.clone()) } @@ -238,33 +268,57 @@ impl Client { pub fn operation_client(&self) -> operation::Client { operation::Client(self.clone()) } + pub fn outbound_network_dependencies_endpoints_client(&self) -> outbound_network_dependencies_endpoints::Client { + outbound_network_dependencies_endpoints::Client(self.clone()) + } pub fn policy_client(&self) -> policy::Client { policy::Client(self.clone()) } pub fn policy_description_client(&self) -> policy_description::Client { policy_description::Client(self.clone()) } + pub fn policy_fragment_client(&self) -> policy_fragment::Client { + policy_fragment::Client(self.clone()) + } + pub fn portal_config_client(&self) -> portal_config::Client { + portal_config::Client(self.clone()) + } pub fn portal_revision_client(&self) -> portal_revision::Client { portal_revision::Client(self.clone()) } pub fn portal_settings_client(&self) -> portal_settings::Client { portal_settings::Client(self.clone()) } + pub fn private_endpoint_connection_client(&self) -> private_endpoint_connection::Client { + private_endpoint_connection::Client(self.clone()) + } pub fn product_client(&self) -> product::Client { product::Client(self.clone()) } pub fn product_api_client(&self) -> product_api::Client { product_api::Client(self.clone()) } + pub fn product_api_link_client(&self) -> product_api_link::Client { + product_api_link::Client(self.clone()) + } pub fn product_group_client(&self) -> product_group::Client { product_group::Client(self.clone()) } + pub fn product_group_link_client(&self) -> product_group_link::Client { + product_group_link::Client(self.clone()) + } pub fn product_policy_client(&self) -> product_policy::Client { product_policy::Client(self.clone()) } pub fn product_subscriptions_client(&self) -> product_subscriptions::Client { product_subscriptions::Client(self.clone()) } + pub fn product_wiki_client(&self) -> product_wiki::Client { + product_wiki::Client(self.clone()) + } + pub fn product_wikis_client(&self) -> product_wikis::Client { + product_wikis::Client(self.clone()) + } pub fn quota_by_counter_keys_client(&self) -> quota_by_counter_keys::Client { quota_by_counter_keys::Client(self.clone()) } @@ -289,6 +343,15 @@ impl Client { pub fn tag_client(&self) -> tag::Client { tag::Client(self.clone()) } + pub fn tag_api_link_client(&self) -> tag_api_link::Client { + tag_api_link::Client(self.clone()) + } + pub fn tag_operation_link_client(&self) -> tag_operation_link::Client { + tag_operation_link::Client(self.clone()) + } + pub fn tag_product_link_client(&self) -> tag_product_link::Client { + tag_product_link::Client(self.clone()) + } pub fn tag_resource_client(&self) -> tag_resource::Client { tag_resource::Client(self.clone()) } @@ -319,6 +382,90 @@ impl Client { pub fn user_subscription_client(&self) -> user_subscription::Client { user_subscription::Client(self.clone()) } + pub fn workspace_client(&self) -> workspace::Client { + workspace::Client(self.clone()) + } + pub fn workspace_api_client(&self) -> workspace_api::Client { + workspace_api::Client(self.clone()) + } + pub fn workspace_api_export_client(&self) -> workspace_api_export::Client { + workspace_api_export::Client(self.clone()) + } + pub fn workspace_api_operation_client(&self) -> workspace_api_operation::Client { + workspace_api_operation::Client(self.clone()) + } + pub fn workspace_api_operation_policy_client(&self) -> workspace_api_operation_policy::Client { + workspace_api_operation_policy::Client(self.clone()) + } + pub fn workspace_api_policy_client(&self) -> workspace_api_policy::Client { + workspace_api_policy::Client(self.clone()) + } + pub fn workspace_api_release_client(&self) -> workspace_api_release::Client { + workspace_api_release::Client(self.clone()) + } + pub fn workspace_api_revision_client(&self) -> workspace_api_revision::Client { + workspace_api_revision::Client(self.clone()) + } + pub fn workspace_api_schema_client(&self) -> workspace_api_schema::Client { + workspace_api_schema::Client(self.clone()) + } + pub fn workspace_api_version_set_client(&self) -> workspace_api_version_set::Client { + workspace_api_version_set::Client(self.clone()) + } + pub fn workspace_global_schema_client(&self) -> workspace_global_schema::Client { + workspace_global_schema::Client(self.clone()) + } + pub fn workspace_group_client(&self) -> workspace_group::Client { + workspace_group::Client(self.clone()) + } + pub fn workspace_group_user_client(&self) -> workspace_group_user::Client { + workspace_group_user::Client(self.clone()) + } + pub fn workspace_named_value_client(&self) -> workspace_named_value::Client { + workspace_named_value::Client(self.clone()) + } + pub fn workspace_notification_client(&self) -> workspace_notification::Client { + workspace_notification::Client(self.clone()) + } + pub fn workspace_notification_recipient_email_client(&self) -> workspace_notification_recipient_email::Client { + workspace_notification_recipient_email::Client(self.clone()) + } + pub fn workspace_notification_recipient_user_client(&self) -> workspace_notification_recipient_user::Client { + workspace_notification_recipient_user::Client(self.clone()) + } + pub fn workspace_policy_client(&self) -> workspace_policy::Client { + workspace_policy::Client(self.clone()) + } + pub fn workspace_policy_fragment_client(&self) -> workspace_policy_fragment::Client { + workspace_policy_fragment::Client(self.clone()) + } + pub fn workspace_product_client(&self) -> workspace_product::Client { + workspace_product::Client(self.clone()) + } + pub fn workspace_product_api_link_client(&self) -> workspace_product_api_link::Client { + workspace_product_api_link::Client(self.clone()) + } + pub fn workspace_product_group_link_client(&self) -> workspace_product_group_link::Client { + workspace_product_group_link::Client(self.clone()) + } + pub fn workspace_product_policy_client(&self) -> workspace_product_policy::Client { + workspace_product_policy::Client(self.clone()) + } + pub fn workspace_subscription_client(&self) -> workspace_subscription::Client { + workspace_subscription::Client(self.clone()) + } + pub fn workspace_tag_client(&self) -> workspace_tag::Client { + workspace_tag::Client(self.clone()) + } + pub fn workspace_tag_api_link_client(&self) -> workspace_tag_api_link::Client { + workspace_tag_api_link::Client(self.clone()) + } + pub fn workspace_tag_operation_link_client(&self) -> workspace_tag_operation_link::Client { + workspace_tag_operation_link::Client(self.clone()) + } + pub fn workspace_tag_product_link_client(&self) -> workspace_tag_product_link::Client { + workspace_tag_product_link::Client(self.clone()) + } } pub mod api_export { use super::models; @@ -327,11 +474,11 @@ pub mod api_export { #[doc = "Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `format`: Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, @@ -425,7 +572,7 @@ pub mod api_export { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let format = &this.format; req.url_mut().query_pairs_mut().append_pair("format", format); let req_body = azure_core::EMPTY_BODY; @@ -456,9 +603,9 @@ pub mod api { #[doc = "Lists all APIs of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -480,10 +627,10 @@ pub mod api { #[doc = "Gets the details of the API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, @@ -502,11 +649,11 @@ pub mod api { #[doc = "Creates new or updates existing specified API of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, @@ -528,12 +675,12 @@ pub mod api { #[doc = "Updates the specified API of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `parameters`: API Update Contract parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, @@ -556,11 +703,11 @@ pub mod api { #[doc = "Deletes the specified API of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, @@ -582,10 +729,10 @@ pub mod api { #[doc = "Gets the entity state (Etag) version of the API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, @@ -604,9 +751,9 @@ pub mod api { #[doc = "Lists a collection of apis associated with tags."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_tags( &self, resource_group_name: impl Into, @@ -730,7 +877,7 @@ pub mod api { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -746,7 +893,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -867,7 +1014,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -923,6 +1070,10 @@ pub mod api { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) } + #[doc = "Location header"] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] @@ -980,7 +1131,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -1091,7 +1242,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -1172,7 +1323,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(delete_revisions) = &this.delete_revisions { req.url_mut() .query_pairs_mut() @@ -1238,7 +1389,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1346,7 +1497,7 @@ pub mod api { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1362,7 +1513,7 @@ pub mod api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -1404,10 +1555,10 @@ pub mod api_revision { #[doc = "Lists all revisions of an API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -1522,7 +1673,7 @@ pub mod api_revision { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1538,7 +1689,7 @@ pub mod api_revision { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -1575,10 +1726,10 @@ pub mod api_release { #[doc = "Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -1600,11 +1751,11 @@ pub mod api_release { #[doc = "Returns the details of an API release."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, @@ -1625,12 +1776,12 @@ pub mod api_release { #[doc = "Creates a new Release for the API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, @@ -1654,13 +1805,13 @@ pub mod api_release { #[doc = "Updates the details of the release of the API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: API Release Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, @@ -1685,12 +1836,12 @@ pub mod api_release { #[doc = "Deletes the specified release in the API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, @@ -1713,11 +1864,11 @@ pub mod api_release { #[doc = "Returns the etag of an API release."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, @@ -1831,7 +1982,7 @@ pub mod api_release { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1847,7 +1998,7 @@ pub mod api_release { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -1962,7 +2113,7 @@ pub mod api_release { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2076,7 +2227,7 @@ pub mod api_release { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -2189,7 +2340,7 @@ pub mod api_release { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -2266,7 +2417,7 @@ pub mod api_release { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2329,7 +2480,7 @@ pub mod api_release { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2346,10 +2497,10 @@ pub mod api_operation { #[doc = "Lists a collection of the operations for the specified API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_api( &self, resource_group_name: impl Into, @@ -2372,11 +2523,11 @@ pub mod api_operation { #[doc = "Gets the details of the API Operation specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, @@ -2397,12 +2548,12 @@ pub mod api_operation { #[doc = "Creates a new operation in the API or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, @@ -2426,13 +2577,13 @@ pub mod api_operation { #[doc = "Updates the details of the operation in the API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: API Operation Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, @@ -2457,12 +2608,12 @@ pub mod api_operation { #[doc = "Deletes the specified operation in the API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, @@ -2485,11 +2636,11 @@ pub mod api_operation { #[doc = "Gets the entity state (Etag) version of the API operation specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, @@ -2609,7 +2760,7 @@ pub mod api_operation { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2625,7 +2776,7 @@ pub mod api_operation { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -2743,7 +2894,7 @@ pub mod api_operation { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2857,7 +3008,7 @@ pub mod api_operation { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -2970,7 +3121,7 @@ pub mod api_operation { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -3047,7 +3198,7 @@ pub mod api_operation { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3110,7 +3261,7 @@ pub mod api_operation { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3127,11 +3278,11 @@ pub mod api_operation_policy { #[doc = "Get the list of policy configuration at the API Operation level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_operation( &self, resource_group_name: impl Into, @@ -3152,12 +3303,12 @@ pub mod api_operation_policy { #[doc = "Get the policy configuration at the API Operation level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, @@ -3181,13 +3332,13 @@ pub mod api_operation_policy { #[doc = "Creates or updates policy configuration for the API Operation level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `policy_id`: The identifier of the Policy."] #[doc = "* `parameters`: The policy contents to apply."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, @@ -3213,13 +3364,13 @@ pub mod api_operation_policy { #[doc = "Deletes the policy configuration at the Api Operation."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `policy_id`: The identifier of the Policy."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, @@ -3244,12 +3395,12 @@ pub mod api_operation_policy { #[doc = "Gets the entity state (Etag) version of the API operation policy specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, @@ -3338,7 +3489,7 @@ pub mod api_operation_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3444,7 +3595,7 @@ pub mod api_operation_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(format) = &this.format { req.url_mut().query_pairs_mut().append_pair("format", format); } @@ -3554,7 +3705,7 @@ pub mod api_operation_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -3626,7 +3777,7 @@ pub mod api_operation_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3682,7 +3833,7 @@ pub mod api_operation_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3699,11 +3850,11 @@ pub mod tag { #[doc = "Lists all Tags associated with the Operation."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_operation( &self, resource_group_name: impl Into, @@ -3727,12 +3878,12 @@ pub mod tag { #[doc = "Get tag associated with the Operation."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_by_operation( &self, resource_group_name: impl Into, @@ -3755,12 +3906,12 @@ pub mod tag { #[doc = "Assign tag to the Operation."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn assign_to_operation( &self, resource_group_name: impl Into, @@ -3783,12 +3934,12 @@ pub mod tag { #[doc = "Detach the tag from the Operation."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn detach_from_operation( &self, resource_group_name: impl Into, @@ -3811,12 +3962,12 @@ pub mod tag { #[doc = "Gets the entity state version of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_state_by_operation( &self, resource_group_name: impl Into, @@ -3839,10 +3990,10 @@ pub mod tag { #[doc = "Lists all Tags associated with the API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_api( &self, resource_group_name: impl Into, @@ -3864,11 +4015,11 @@ pub mod tag { #[doc = "Get tag associated with the API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_by_api( &self, resource_group_name: impl Into, @@ -3889,11 +4040,11 @@ pub mod tag { #[doc = "Assign tag to the Api."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn assign_to_api( &self, resource_group_name: impl Into, @@ -3914,11 +4065,11 @@ pub mod tag { #[doc = "Detach the tag from the Api."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn detach_from_api( &self, resource_group_name: impl Into, @@ -3939,11 +4090,11 @@ pub mod tag { #[doc = "Gets the entity state version of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_state_by_api( &self, resource_group_name: impl Into, @@ -3964,10 +4115,10 @@ pub mod tag { #[doc = "Lists all Tags associated with the Product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_product( &self, resource_group_name: impl Into, @@ -3989,11 +4140,11 @@ pub mod tag { #[doc = "Get tag associated with the Product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_by_product( &self, resource_group_name: impl Into, @@ -4014,11 +4165,11 @@ pub mod tag { #[doc = "Assign tag to the Product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn assign_to_product( &self, resource_group_name: impl Into, @@ -4039,11 +4190,11 @@ pub mod tag { #[doc = "Detach the tag from the Product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn detach_from_product( &self, resource_group_name: impl Into, @@ -4064,11 +4215,11 @@ pub mod tag { #[doc = "Gets the entity state version of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_state_by_product( &self, resource_group_name: impl Into, @@ -4089,9 +4240,9 @@ pub mod tag { #[doc = "Lists a collection of tags defined within a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -4112,10 +4263,10 @@ pub mod tag { #[doc = "Gets the details of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, @@ -4134,11 +4285,11 @@ pub mod tag { #[doc = "Creates a tag."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, @@ -4160,12 +4311,12 @@ pub mod tag { #[doc = "Updates the details of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, @@ -4188,11 +4339,11 @@ pub mod tag { #[doc = "Deletes specific tag of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, @@ -4213,10 +4364,10 @@ pub mod tag { #[doc = "Gets the entity state version of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_state( &self, resource_group_name: impl Into, @@ -4330,7 +4481,7 @@ pub mod tag { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4346,7 +4497,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -4454,7 +4605,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4544,7 +4695,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4611,7 +4762,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4666,7 +4817,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4770,7 +4921,7 @@ pub mod tag { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4786,7 +4937,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -4901,7 +5052,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5008,7 +5159,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5082,7 +5233,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5144,7 +5295,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5248,7 +5399,7 @@ pub mod tag { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5264,7 +5415,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -5379,7 +5530,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5476,7 +5627,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5550,7 +5701,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5612,7 +5763,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5720,7 +5871,7 @@ pub mod tag { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5736,7 +5887,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -5852,7 +6003,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5964,7 +6115,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -6075,7 +6226,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -6150,7 +6301,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6211,7 +6362,7 @@ pub mod tag { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6221,25 +6372,25 @@ pub mod tag { } } } -pub mod api_product { +pub mod graph_ql_api_resolver { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all Products, which the API is part of."] + #[doc = "Lists a collection of the resolvers for the specified GraphQL API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_apis( + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, subscription_id: impl Into, - ) -> list_by_apis::RequestBuilder { - list_by_apis::RequestBuilder { + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), @@ -6250,14 +6401,152 @@ pub mod api_product { skip: None, } } + #[doc = "Gets the details of the GraphQL API Resolver specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + resolver_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + resolver_id: resolver_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new resolver in the GraphQL API or updates an existing one."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + resolver_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + resolver_id: resolver_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the resolver in the GraphQL API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: GraphQL API Resolver Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + resolver_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + resolver_id: resolver_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified resolver in the GraphQL API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + resolver_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + resolver_id: resolver_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the GraphQL API resolver specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + resolver_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + resolver_id: resolver_id.into(), + subscription_id: subscription_id.into(), + } + } } - pub mod list_by_apis { + pub mod list_by_api { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ProductCollection = serde_json::from_slice(&bytes)?; + let body: models::ResolverCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6303,7 +6592,7 @@ pub mod api_product { pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -6318,12 +6607,12 @@ pub mod api_product { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/products", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -6346,7 +6635,7 @@ pub mod api_product { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6362,7 +6651,7 @@ pub mod api_product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -6391,149 +6680,13 @@ pub mod api_product { } } } -} -pub mod api_policy { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the policy configuration at the API level."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_api( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> list_by_api::RequestBuilder { - list_by_api::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Get the policy configuration at the API level."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - policy_id: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - policy_id: policy_id.into(), - subscription_id: subscription_id.into(), - format: None, - } - } - #[doc = "Creates or updates policy configuration for the API."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `parameters`: The policy contents to apply."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - policy_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - policy_id: policy_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Deletes the policy configuration at the Api."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - policy_id: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - policy_id: policy_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the entity state (Etag) version of the API policy specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - policy_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - policy_id: policy_id.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list_by_api { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + let body: models::ResolverContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6542,6 +6695,9 @@ pub mod api_policy { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -6553,6 +6709,13 @@ pub mod api_policy { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -6573,6 +6736,7 @@ pub mod api_policy { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, + pub(crate) resolver_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -6585,12 +6749,13 @@ pub mod api_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.api_id + &this.api_id, + &this.resolver_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -6601,7 +6766,7 @@ pub mod api_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6610,8 +6775,8 @@ pub mod api_policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6622,13 +6787,13 @@ pub mod api_policy { } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + let body: models::ResolverContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6678,14 +6843,15 @@ pub mod api_policy { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) policy_id: String, + pub(crate) resolver_id: String, + pub(crate) parameters: models::ResolverContract, pub(crate) subscription_id: String, - pub(crate) format: Option, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "Policy Export Format."] - pub fn format(mut self, format: impl Into) -> Self { - self.format = Some(format.into()); + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); self } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6697,15 +6863,15 @@ pub mod api_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.policy_id + &this.resolver_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -6714,11 +6880,12 @@ pub mod api_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(format) = &this.format { - req.url_mut().query_pairs_mut().append_pair("format", format); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); } - let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -6726,8 +6893,8 @@ pub mod api_policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6738,13 +6905,13 @@ pub mod api_policy { } } } - pub mod create_or_update { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + let body: models::ResolverContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6794,17 +6961,12 @@ pub mod api_policy { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) policy_id: String, - pub(crate) parameters: models::PolicyContract, + pub(crate) resolver_id: String, + pub(crate) parameters: models::ResolverUpdateContract, + pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6814,15 +6976,15 @@ pub mod api_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.policy_id + &this.resolver_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -6831,12 +6993,10 @@ pub mod api_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -6844,8 +7004,8 @@ pub mod api_policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6879,7 +7039,7 @@ pub mod api_policy { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) policy_id: String, + pub(crate) resolver_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -6893,13 +7053,13 @@ pub mod api_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.policy_id + &this.resolver_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -6910,7 +7070,7 @@ pub mod api_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6943,7 +7103,7 @@ pub mod api_policy { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) policy_id: String, + pub(crate) resolver_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -6956,13 +7116,13 @@ pub mod api_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.policy_id + &this.resolver_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -6973,7 +7133,7 @@ pub mod api_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6983,49 +7143,51 @@ pub mod api_policy { } } } -pub mod api_schema { +pub mod graph_ql_api_resolver_policy { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the schema configuration at the API level."] + #[doc = "Get the list of policy configuration at the GraphQL API Resolver level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_api( + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_resolver( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, + resolver_id: impl Into, subscription_id: impl Into, - ) -> list_by_api::RequestBuilder { - list_by_api::RequestBuilder { + ) -> list_by_resolver::RequestBuilder { + list_by_resolver::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), + resolver_id: resolver_id.into(), subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, } } - #[doc = "Get the schema configuration at the API level."] + #[doc = "Get the policy configuration at the GraphQL API Resolver level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `schema_id`: Schema identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - schema_id: impl Into, + resolver_id: impl Into, + policy_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -7033,26 +7195,30 @@ pub mod api_schema { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - schema_id: schema_id.into(), + resolver_id: resolver_id.into(), + policy_id: policy_id.into(), subscription_id: subscription_id.into(), + format: None, } } - #[doc = "Creates or updates schema configuration for the API."] + #[doc = "Creates or updates policy configuration for the GraphQL API Resolver level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `schema_id`: Schema identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: The schema contents to apply."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - schema_id: impl Into, - parameters: impl Into, + resolver_id: impl Into, + policy_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -7060,27 +7226,30 @@ pub mod api_schema { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - schema_id: schema_id.into(), + resolver_id: resolver_id.into(), + policy_id: policy_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Deletes the schema configuration at the Api."] + #[doc = "Deletes the policy configuration at the GraphQL Api Resolver."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `schema_id`: Schema identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - schema_id: impl Into, + resolver_id: impl Into, + policy_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -7089,26 +7258,28 @@ pub mod api_schema { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - schema_id: schema_id.into(), + resolver_id: resolver_id.into(), + policy_id: policy_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), - force: None, } } - #[doc = "Gets the entity state (Etag) version of the schema specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the GraphQL API resolver policy specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `schema_id`: Schema identifier within an API. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resolver_id`: Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - schema_id: impl Into, + resolver_id: impl Into, + policy_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { @@ -7116,18 +7287,19 @@ pub mod api_schema { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - schema_id: schema_id.into(), + resolver_id: resolver_id.into(), + policy_id: policy_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list_by_api { + pub mod list_by_resolver { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SchemaCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7167,39 +7339,15 @@ pub mod api_schema { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, + pub(crate) resolver_id: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}/policies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . resolver_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -7216,7 +7364,7 @@ pub mod api_schema { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7232,16 +7380,7 @@ pub mod api_schema { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -7265,9 +7404,9 @@ pub mod api_schema { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SchemaContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7317,10 +7456,17 @@ pub mod api_schema { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) schema_id: String, + pub(crate) resolver_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, + pub(crate) format: Option, } impl RequestBuilder { + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7329,15 +7475,7 @@ pub mod api_schema { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.schema_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . resolver_id , & this . policy_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7347,7 +7485,10 @@ pub mod api_schema { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7356,8 +7497,8 @@ pub mod api_schema { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7371,6 +7512,39 @@ pub mod api_schema { pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -7391,8 +7565,9 @@ pub mod api_schema { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) schema_id: String, - pub(crate) parameters: models::SchemaContract, + pub(crate) resolver_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -7402,7 +7577,6 @@ pub mod api_schema { self.if_match = Some(if_match.into()); self } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7411,15 +7585,7 @@ pub mod api_schema { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.schema_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . resolver_id , & this . policy_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7429,7 +7595,7 @@ pub mod api_schema { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -7441,81 +7607,20 @@ pub mod api_schema { }) } } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) api_id: String, - pub(crate) schema_id: String, - pub(crate) if_match: String, - pub(crate) subscription_id: String, - pub(crate) force: Option, - } - impl RequestBuilder { - #[doc = "If true removes all references to the schema before deleting it."] - pub fn force(mut self, force: bool) -> Self { - self.force = Some(force); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.schema_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(force) = &this.force { - req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); - } - req.insert_header("if-match", &this.if_match); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get_entity_tag { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -7538,7 +7643,9 @@ pub mod api_schema { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) schema_id: String, + pub(crate) resolver_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -7550,15 +7657,63 @@ pub mod api_schema { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.schema_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . resolver_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) api_id: String, + pub(crate) resolver_id: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/resolvers/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . resolver_id , & this . policy_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7568,7 +7723,7 @@ pub mod api_schema { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7578,25 +7733,25 @@ pub mod api_schema { } } } -pub mod api_diagnostic { +pub mod api_product { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all diagnostics of an API."] + #[doc = "Lists all Products, which the API is part of."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_apis( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_apis::RequestBuilder { + list_by_apis::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), @@ -7607,152 +7762,14 @@ pub mod api_diagnostic { skip: None, } } - #[doc = "Gets the details of the Diagnostic for an API specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - diagnostic_id: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - diagnostic_id: diagnostic_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates a new Diagnostic for an API or updates an existing one."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - diagnostic_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - diagnostic_id: diagnostic_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Updates the details of the Diagnostic for an API specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Diagnostic Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - diagnostic_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - diagnostic_id: diagnostic_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes the specified Diagnostic from an API."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - diagnostic_id: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - diagnostic_id: diagnostic_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - diagnostic_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - diagnostic_id: diagnostic_id.into(), - subscription_id: subscription_id.into(), - } - } } - pub mod list_by_service { + pub mod list_by_apis { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticCollection = serde_json::from_slice(&bytes)?; + let body: models::ProductCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7798,7 +7815,7 @@ pub mod api_diagnostic { pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -7813,12 +7830,12 @@ pub mod api_diagnostic { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/products", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -7841,7 +7858,7 @@ pub mod api_diagnostic { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7857,7 +7874,7 @@ pub mod api_diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -7886,13 +7903,149 @@ pub mod api_diagnostic { } } } - pub mod get { +} +pub mod api_policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the policy configuration at the API level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the policy configuration at the API level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + format: None, + } + } + #[doc = "Creates or updates policy configuration for the API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + policy_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes the policy configuration at the Api."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + policy_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the API policy specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_api { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7901,9 +8054,6 @@ pub mod api_diagnostic { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -7915,13 +8065,6 @@ pub mod api_diagnostic { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -7942,7 +8085,6 @@ pub mod api_diagnostic { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) diagnostic_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -7955,13 +8097,12 @@ pub mod api_diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.api_id, - &this.diagnostic_id + &this.api_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -7972,7 +8113,7 @@ pub mod api_diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7981,8 +8122,8 @@ pub mod api_diagnostic { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7993,13 +8134,13 @@ pub mod api_diagnostic { } } } - pub mod create_or_update { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8049,15 +8190,14 @@ pub mod api_diagnostic { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) diagnostic_id: String, - pub(crate) parameters: models::DiagnosticContract, + pub(crate) policy_id: String, pub(crate) subscription_id: String, - pub(crate) if_match: Option, + pub(crate) format: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); self } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8069,15 +8209,15 @@ pub mod api_diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.diagnostic_id + &this.policy_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8086,12 +8226,11 @@ pub mod api_diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -8099,8 +8238,8 @@ pub mod api_diagnostic { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8111,13 +8250,13 @@ pub mod api_diagnostic { } } } - pub mod update { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8167,12 +8306,17 @@ pub mod api_diagnostic { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) diagnostic_id: String, - pub(crate) parameters: models::DiagnosticContract, - pub(crate) if_match: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8182,15 +8326,15 @@ pub mod api_diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.diagnostic_id + &this.policy_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8199,10 +8343,12 @@ pub mod api_diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -8210,8 +8356,8 @@ pub mod api_diagnostic { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8245,7 +8391,7 @@ pub mod api_diagnostic { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) diagnostic_id: String, + pub(crate) policy_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -8259,13 +8405,13 @@ pub mod api_diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.diagnostic_id + &this.policy_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -8276,7 +8422,7 @@ pub mod api_diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8309,7 +8455,7 @@ pub mod api_diagnostic { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) diagnostic_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -8322,13 +8468,13 @@ pub mod api_diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.diagnostic_id + &this.policy_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -8339,7 +8485,7 @@ pub mod api_diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8349,50 +8495,49 @@ pub mod api_diagnostic { } } } -pub mod api_issue { +pub mod api_schema { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all issues associated with the specified API."] + #[doc = "Get the schema configuration at the API level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), subscription_id: subscription_id.into(), filter: None, - expand_comments_attachments: None, top: None, skip: None, } } - #[doc = "Gets the details of the Issue for an API specified by its identifier."] + #[doc = "Get the schema configuration at the API level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, + schema_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -8400,27 +8545,26 @@ pub mod api_issue { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), + schema_id: schema_id.into(), subscription_id: subscription_id.into(), - expand_comments_attachments: None, } } - #[doc = "Creates a new Issue for an API or updates an existing one."] + #[doc = "Creates or updates schema configuration for the API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: The schema contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - parameters: impl Into, + schema_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -8428,85 +8572,55 @@ pub mod api_issue { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), + schema_id: schema_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates an existing issue for an API."] + #[doc = "Deletes the schema configuration at the Api."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Update parameters."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - parameters: impl Into, + schema_id: impl Into, if_match: impl Into, subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), - parameters: parameters.into(), + schema_id: schema_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), + force: None, } } - #[doc = "Deletes the specified Issue from an API."] + #[doc = "Gets the entity state (Etag) version of the schema specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - issue_id: issue_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the entity state (Etag) version of the Issue for an API specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - issue_id: impl Into, + schema_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { @@ -8514,18 +8628,18 @@ pub mod api_issue { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), + schema_id: schema_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list_by_service { + pub mod list_by_api { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueCollection = serde_json::from_slice(&bytes)?; + let body: models::SchemaCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8567,21 +8681,15 @@ pub mod api_issue { pub(crate) api_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, - pub(crate) expand_comments_attachments: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self } - #[doc = "Expand the comment attachments. "] - pub fn expand_comments_attachments(mut self, expand_comments_attachments: bool) -> Self { - self.expand_comments_attachments = Some(expand_comments_attachments); - self - } #[doc = "Number of records to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -8592,12 +8700,12 @@ pub mod api_issue { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -8620,7 +8728,7 @@ pub mod api_issue { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8636,15 +8744,10 @@ pub mod api_issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } - if let Some(expand_comments_attachments) = &this.expand_comments_attachments { - req.url_mut() - .query_pairs_mut() - .append_pair("expandCommentsAttachments", &expand_comments_attachments.to_string()); - } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -8674,9 +8777,9 @@ pub mod api_issue { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueContract = serde_json::from_slice(&bytes)?; + let body: models::SchemaContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8726,16 +8829,10 @@ pub mod api_issue { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, + pub(crate) schema_id: String, pub(crate) subscription_id: String, - pub(crate) expand_comments_attachments: Option, } impl RequestBuilder { - #[doc = "Expand the comment attachments. "] - pub fn expand_comments_attachments(mut self, expand_comments_attachments: bool) -> Self { - self.expand_comments_attachments = Some(expand_comments_attachments); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8745,13 +8842,13 @@ pub mod api_issue { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.issue_id + &this.schema_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -8762,12 +8859,7 @@ pub mod api_issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(expand_comments_attachments) = &this.expand_comments_attachments { - req.url_mut() - .query_pairs_mut() - .append_pair("expandCommentsAttachments", &expand_comments_attachments.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8776,8 +8868,8 @@ pub mod api_issue { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8791,39 +8883,6 @@ pub mod api_issue { pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IssueContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -8844,8 +8903,8 @@ pub mod api_issue { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, - pub(crate) parameters: models::IssueContract, + pub(crate) schema_id: String, + pub(crate) parameters: models::SchemaContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -8855,6 +8914,7 @@ pub mod api_issue { self.if_match = Some(if_match.into()); self } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8864,13 +8924,13 @@ pub mod api_issue { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.issue_id + &this.schema_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -8881,7 +8941,7 @@ pub mod api_issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -8893,129 +8953,6 @@ pub mod api_issue { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IssueContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) api_id: String, - pub(crate) issue_id: String, - pub(crate) parameters: models::IssueUpdateContract, - pub(crate) if_match: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.issue_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } pub mod delete { use super::models; @@ -9040,11 +8977,17 @@ pub mod api_issue { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, + pub(crate) schema_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, + pub(crate) force: Option, } impl RequestBuilder { + #[doc = "If true removes all references to the schema before deleting it."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9054,13 +8997,13 @@ pub mod api_issue { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.issue_id + &this.schema_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -9071,7 +9014,10 @@ pub mod api_issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9104,7 +9050,7 @@ pub mod api_issue { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, + pub(crate) schema_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -9117,13 +9063,13 @@ pub mod api_issue { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/schemas/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, &this.api_id, - &this.issue_id + &this.schema_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -9134,7 +9080,7 @@ pub mod api_issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9144,24 +9090,22 @@ pub mod api_issue { } } } -pub mod api_issue_comment { +pub mod api_diagnostic { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all comments for the Issue associated with the specified API."] + #[doc = "Lists all diagnostics of an API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { @@ -9169,29 +9113,26 @@ pub mod api_issue_comment { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Gets the details of the issue Comment for an API specified by its identifier."] + #[doc = "Gets the details of the Diagnostic for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - comment_id: impl Into, + diagnostic_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -9199,29 +9140,26 @@ pub mod api_issue_comment { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), - comment_id: comment_id.into(), + diagnostic_id: diagnostic_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates a new Comment for the Issue in an API or updates an existing one."] + #[doc = "Creates a new Diagnostic for an API or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - comment_id: impl Into, - parameters: impl Into, + diagnostic_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -9229,30 +9167,58 @@ pub mod api_issue_comment { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), - comment_id: comment_id.into(), + diagnostic_id: diagnostic_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Deletes the specified comment from an Issue."] + #[doc = "Updates the details of the Diagnostic for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Diagnostic Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + diagnostic_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + diagnostic_id: diagnostic_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified Diagnostic from an API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - comment_id: impl Into, + diagnostic_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -9261,28 +9227,25 @@ pub mod api_issue_comment { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), - comment_id: comment_id.into(), + diagnostic_id: diagnostic_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, - comment_id: impl Into, + diagnostic_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { @@ -9290,8 +9253,7 @@ pub mod api_issue_comment { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), - comment_id: comment_id.into(), + diagnostic_id: diagnostic_id.into(), subscription_id: subscription_id.into(), } } @@ -9300,9 +9262,9 @@ pub mod api_issue_comment { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueCommentCollection = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9342,14 +9304,13 @@ pub mod api_issue_comment { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -9364,18 +9325,17 @@ pub mod api_issue_comment { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.api_id, - &this.issue_id + &this.api_id ))?; let rsp = match continuation { Some(value) => { @@ -9393,7 +9353,7 @@ pub mod api_issue_comment { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9409,7 +9369,7 @@ pub mod api_issue_comment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -9442,9 +9402,9 @@ pub mod api_issue_comment { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueCommentContract = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9494,8 +9454,7 @@ pub mod api_issue_comment { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, - pub(crate) comment_id: String, + pub(crate) diagnostic_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -9507,7 +9466,15 @@ pub mod api_issue_comment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.diagnostic_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9517,7 +9484,7 @@ pub mod api_issue_comment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9526,8 +9493,8 @@ pub mod api_issue_comment { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9542,9 +9509,9 @@ pub mod api_issue_comment { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueCommentContract = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9594,9 +9561,8 @@ pub mod api_issue_comment { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, - pub(crate) comment_id: String, - pub(crate) parameters: models::IssueCommentContract, + pub(crate) diagnostic_id: String, + pub(crate) parameters: models::DiagnosticContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -9614,7 +9580,15 @@ pub mod api_issue_comment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.diagnostic_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9624,7 +9598,7 @@ pub mod api_issue_comment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -9637,8 +9611,119 @@ pub mod api_issue_comment { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) api_id: String, + pub(crate) diagnostic_id: String, + pub(crate) parameters: models::DiagnosticContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.diagnostic_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9672,8 +9757,7 @@ pub mod api_issue_comment { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, - pub(crate) comment_id: String, + pub(crate) diagnostic_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -9686,7 +9770,15 @@ pub mod api_issue_comment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.diagnostic_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9696,7 +9788,7 @@ pub mod api_issue_comment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9729,8 +9821,7 @@ pub mod api_issue_comment { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, - pub(crate) comment_id: String, + pub(crate) diagnostic_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -9742,7 +9833,15 @@ pub mod api_issue_comment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/diagnostics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.diagnostic_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9752,7 +9851,7 @@ pub mod api_issue_comment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9762,24 +9861,22 @@ pub mod api_issue_comment { } } } -pub mod api_issue_attachment { +pub mod api_issue { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all attachments for the Issue associated with the specified API."] + #[doc = "Lists all issues associated with the specified API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - issue_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { @@ -9787,29 +9884,27 @@ pub mod api_issue_attachment { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - issue_id: issue_id.into(), subscription_id: subscription_id.into(), filter: None, + expand_comments_attachments: None, top: None, skip: None, } } - #[doc = "Gets the details of the issue Attachment for an API specified by its identifier."] + #[doc = "Gets the details of the Issue for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, issue_id: impl Into, - attachment_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -9818,28 +9913,26 @@ pub mod api_issue_attachment { service_name: service_name.into(), api_id: api_id.into(), issue_id: issue_id.into(), - attachment_id: attachment_id.into(), subscription_id: subscription_id.into(), + expand_comments_attachments: None, } } - #[doc = "Creates a new Attachment for the Issue in an API or updates an existing one."] + #[doc = "Creates a new Issue for an API or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, issue_id: impl Into, - attachment_id: impl Into, - parameters: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -9848,29 +9941,57 @@ pub mod api_issue_attachment { service_name: service_name.into(), api_id: api_id.into(), issue_id: issue_id.into(), - attachment_id: attachment_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Deletes the specified comment from an Issue."] + #[doc = "Updates an existing issue for an API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + issue_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + issue_id: issue_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified Issue from an API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, issue_id: impl Into, - attachment_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -9880,27 +10001,24 @@ pub mod api_issue_attachment { service_name: service_name.into(), api_id: api_id.into(), issue_id: issue_id.into(), - attachment_id: attachment_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the Issue for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, issue_id: impl Into, - attachment_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { @@ -9909,7 +10027,6 @@ pub mod api_issue_attachment { service_name: service_name.into(), api_id: api_id.into(), issue_id: issue_id.into(), - attachment_id: attachment_id.into(), subscription_id: subscription_id.into(), } } @@ -9918,9 +10035,9 @@ pub mod api_issue_attachment { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueAttachmentCollection = serde_json::from_slice(&bytes)?; + let body: models::IssueCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9960,18 +10077,23 @@ pub mod api_issue_attachment { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) issue_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, + pub(crate) expand_comments_attachments: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self } + #[doc = "Expand the comment attachments. "] + pub fn expand_comments_attachments(mut self, expand_comments_attachments: bool) -> Self { + self.expand_comments_attachments = Some(expand_comments_attachments); + self + } #[doc = "Number of records to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -9982,11 +10104,18 @@ pub mod api_issue_attachment { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -10003,7 +10132,7 @@ pub mod api_issue_attachment { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10019,10 +10148,15 @@ pub mod api_issue_attachment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } + if let Some(expand_comments_attachments) = &this.expand_comments_attachments { + req.url_mut() + .query_pairs_mut() + .append_pair("expandCommentsAttachments", &expand_comments_attachments.to_string()); + } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -10052,9 +10186,9 @@ pub mod api_issue_attachment { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueAttachmentContract = serde_json::from_slice(&bytes)?; + let body: models::IssueContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10105,10 +10239,15 @@ pub mod api_issue_attachment { pub(crate) service_name: String, pub(crate) api_id: String, pub(crate) issue_id: String, - pub(crate) attachment_id: String, pub(crate) subscription_id: String, + pub(crate) expand_comments_attachments: Option, } impl RequestBuilder { + #[doc = "Expand the comment attachments. "] + pub fn expand_comments_attachments(mut self, expand_comments_attachments: bool) -> Self { + self.expand_comments_attachments = Some(expand_comments_attachments); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10117,7 +10256,15 @@ pub mod api_issue_attachment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.issue_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10127,7 +10274,12 @@ pub mod api_issue_attachment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(expand_comments_attachments) = &this.expand_comments_attachments { + req.url_mut() + .query_pairs_mut() + .append_pair("expandCommentsAttachments", &expand_comments_attachments.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10136,8 +10288,8 @@ pub mod api_issue_attachment { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10152,9 +10304,9 @@ pub mod api_issue_attachment { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueAttachmentContract = serde_json::from_slice(&bytes)?; + let body: models::IssueContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10205,8 +10357,7 @@ pub mod api_issue_attachment { pub(crate) service_name: String, pub(crate) api_id: String, pub(crate) issue_id: String, - pub(crate) attachment_id: String, - pub(crate) parameters: models::IssueAttachmentContract, + pub(crate) parameters: models::IssueContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -10224,7 +10375,15 @@ pub mod api_issue_attachment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.issue_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10234,7 +10393,7 @@ pub mod api_issue_attachment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -10247,8 +10406,119 @@ pub mod api_issue_attachment { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IssueContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) api_id: String, + pub(crate) issue_id: String, + pub(crate) parameters: models::IssueUpdateContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.issue_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10283,7 +10553,6 @@ pub mod api_issue_attachment { pub(crate) service_name: String, pub(crate) api_id: String, pub(crate) issue_id: String, - pub(crate) attachment_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -10296,7 +10565,15 @@ pub mod api_issue_attachment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.issue_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10306,7 +10583,7 @@ pub mod api_issue_attachment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10340,7 +10617,6 @@ pub mod api_issue_attachment { pub(crate) service_name: String, pub(crate) api_id: String, pub(crate) issue_id: String, - pub(crate) attachment_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -10352,7 +10628,15 @@ pub mod api_issue_attachment { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id, + &this.issue_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10362,7 +10646,7 @@ pub mod api_issue_attachment { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10372,22 +10656,24 @@ pub mod api_issue_attachment { } } } -pub mod api_tag_description { +pub mod api_issue_comment { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level but tag may be assigned to the Operations"] + #[doc = "Lists all comments for the Issue associated with the specified API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, + issue_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { @@ -10395,26 +10681,29 @@ pub mod api_tag_description { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), + issue_id: issue_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Get Tag description in scope of API"] + #[doc = "Gets the details of the issue Comment for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - tag_description_id: impl Into, + issue_id: impl Into, + comment_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { @@ -10422,26 +10711,29 @@ pub mod api_tag_description { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - tag_description_id: tag_description_id.into(), + issue_id: issue_id.into(), + comment_id: comment_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Create/Update tag description in scope of the Api."] + #[doc = "Creates a new Comment for the Issue in an API or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - tag_description_id: impl Into, - parameters: impl Into, + issue_id: impl Into, + comment_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { @@ -10449,27 +10741,30 @@ pub mod api_tag_description { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - tag_description_id: tag_description_id.into(), + issue_id: issue_id.into(), + comment_id: comment_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Delete tag description for the Api."] + #[doc = "Deletes the specified comment from an Issue."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - tag_description_id: impl Into, + issue_id: impl Into, + comment_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -10478,25 +10773,28 @@ pub mod api_tag_description { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - tag_description_id: tag_description_id.into(), + issue_id: issue_id.into(), + comment_id: comment_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state version of the tag specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `comment_id`: Comment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, api_id: impl Into, - tag_description_id: impl Into, + issue_id: impl Into, + comment_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { @@ -10504,7 +10802,8 @@ pub mod api_tag_description { resource_group_name: resource_group_name.into(), service_name: service_name.into(), api_id: api_id.into(), - tag_description_id: tag_description_id.into(), + issue_id: issue_id.into(), + comment_id: comment_id.into(), subscription_id: subscription_id.into(), } } @@ -10513,9 +10812,9 @@ pub mod api_tag_description { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TagDescriptionCollection = serde_json::from_slice(&bytes)?; + let body: models::IssueCommentCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10555,13 +10854,14 @@ pub mod api_tag_description { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, + pub(crate) issue_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -10576,17 +10876,18 @@ pub mod api_tag_description { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.api_id + &this.api_id, + &this.issue_id ))?; let rsp = match continuation { Some(value) => { @@ -10604,7 +10905,7 @@ pub mod api_tag_description { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10620,7 +10921,7 @@ pub mod api_tag_description { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -10653,9 +10954,9 @@ pub mod api_tag_description { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TagDescriptionContract = serde_json::from_slice(&bytes)?; + let body: models::IssueCommentContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10705,7 +11006,8 @@ pub mod api_tag_description { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) tag_description_id: String, + pub(crate) issue_id: String, + pub(crate) comment_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -10717,15 +11019,7 @@ pub mod api_tag_description { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.tag_description_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10735,7 +11029,7 @@ pub mod api_tag_description { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10744,8 +11038,8 @@ pub mod api_tag_description { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10760,9 +11054,9 @@ pub mod api_tag_description { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TagDescriptionContract = serde_json::from_slice(&bytes)?; + let body: models::IssueCommentContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10812,8 +11106,9 @@ pub mod api_tag_description { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) tag_description_id: String, - pub(crate) parameters: models::TagDescriptionCreateParameters, + pub(crate) issue_id: String, + pub(crate) comment_id: String, + pub(crate) parameters: models::IssueCommentContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -10831,15 +11126,7 @@ pub mod api_tag_description { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.tag_description_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10849,7 +11136,7 @@ pub mod api_tag_description { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -10862,8 +11149,8 @@ pub mod api_tag_description { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10897,7 +11184,8 @@ pub mod api_tag_description { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) tag_description_id: String, + pub(crate) issue_id: String, + pub(crate) comment_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -10910,15 +11198,7 @@ pub mod api_tag_description { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.tag_description_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10928,7 +11208,7 @@ pub mod api_tag_description { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -10961,7 +11241,8 @@ pub mod api_tag_description { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) api_id: String, - pub(crate) tag_description_id: String, + pub(crate) issue_id: String, + pub(crate) comment_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -10973,15 +11254,7 @@ pub mod api_tag_description { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id, - &this.tag_description_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . comment_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10991,7 +11264,7 @@ pub mod api_tag_description { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11001,304 +11274,115 @@ pub mod api_tag_description { } } } -pub mod operation { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists a collection of operations associated with tags."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_tags( - &self, - resource_group_name: impl Into, - service_name: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> list_by_tags::RequestBuilder { - list_by_tags::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - include_not_tagged_operations: None, - } - } - } - pub mod list_by_tags { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TagResourceCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) api_id: String, - pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) include_not_tagged_operations: Option, - } - impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "Include not tagged Operations."] - pub fn include_not_tagged_operations(mut self, include_not_tagged_operations: bool) -> Self { - self.include_not_tagged_operations = Some(include_not_tagged_operations); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/operationsByTags", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.api_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(include_not_tagged_operations) = &this.include_not_tagged_operations { - req.url_mut() - .query_pairs_mut() - .append_pair("includeNotTaggedOperations", &include_not_tagged_operations.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } -} -pub mod api_version_set { +pub mod api_issue_attachment { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of API Version Sets in the specified service instance."] + #[doc = "Lists all attachments for the Issue associated with the specified API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, + api_id: impl Into, + issue_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + api_id: api_id.into(), + issue_id: issue_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Gets the details of the Api Version Set specified by its identifier."] + #[doc = "Gets the details of the issue Attachment for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - version_set_id: impl Into, + api_id: impl Into, + issue_id: impl Into, + attachment_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - version_set_id: version_set_id.into(), + api_id: api_id.into(), + issue_id: issue_id.into(), + attachment_id: attachment_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or Updates a Api Version Set."] + #[doc = "Creates a new Attachment for the Issue in an API or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - version_set_id: impl Into, - parameters: impl Into, + api_id: impl Into, + issue_id: impl Into, + attachment_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - version_set_id: version_set_id.into(), + api_id: api_id.into(), + issue_id: issue_id.into(), + attachment_id: attachment_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the details of the Api VersionSet specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - version_set_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - version_set_id: version_set_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes specific Api Version Set."] + #[doc = "Deletes the specified comment from an Issue."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - version_set_id: impl Into, + api_id: impl Into, + issue_id: impl Into, + attachment_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -11306,30 +11390,38 @@ pub mod api_version_set { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - version_set_id: version_set_id.into(), + api_id: api_id.into(), + issue_id: issue_id.into(), + attachment_id: attachment_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the Api Version Set specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `attachment_id`: Attachment identifier within an Issue. Must be unique in the current Issue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - version_set_id: impl Into, + api_id: impl Into, + issue_id: impl Into, + attachment_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - version_set_id: version_set_id.into(), + api_id: api_id.into(), + issue_id: issue_id.into(), + attachment_id: attachment_id.into(), subscription_id: subscription_id.into(), } } @@ -11338,9 +11430,9 @@ pub mod api_version_set { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiVersionSetCollection = serde_json::from_slice(&bytes)?; + let body: models::IssueAttachmentCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11379,13 +11471,15 @@ pub mod api_version_set { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) api_id: String, + pub(crate) issue_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -11400,17 +11494,11 @@ pub mod api_version_set { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -11427,7 +11515,7 @@ pub mod api_version_set { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11443,7 +11531,7 @@ pub mod api_version_set { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -11476,9 +11564,9 @@ pub mod api_version_set { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; + let body: models::IssueAttachmentContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11527,7 +11615,9 @@ pub mod api_version_set { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) version_set_id: String, + pub(crate) api_id: String, + pub(crate) issue_id: String, + pub(crate) attachment_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -11539,14 +11629,7 @@ pub mod api_version_set { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.version_set_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -11556,7 +11639,7 @@ pub mod api_version_set { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11565,8 +11648,8 @@ pub mod api_version_set { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11581,9 +11664,9 @@ pub mod api_version_set { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; + let body: models::IssueAttachmentContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11632,8 +11715,10 @@ pub mod api_version_set { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) version_set_id: String, - pub(crate) parameters: models::ApiVersionSetContract, + pub(crate) api_id: String, + pub(crate) issue_id: String, + pub(crate) attachment_id: String, + pub(crate) parameters: models::IssueAttachmentContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -11651,14 +11736,7 @@ pub mod api_version_set { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.version_set_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -11668,7 +11746,7 @@ pub mod api_version_set { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -11681,8 +11759,8 @@ pub mod api_version_set { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11693,42 +11771,9 @@ pub mod api_version_set { } } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -11748,8 +11793,9 @@ pub mod api_version_set { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) version_set_id: String, - pub(crate) parameters: models::ApiVersionSetUpdateParameters, + pub(crate) api_id: String, + pub(crate) issue_id: String, + pub(crate) attachment_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -11762,15 +11808,8 @@ pub mod api_version_set { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.version_set_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -11779,30 +11818,17 @@ pub mod api_version_set { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod delete { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -11824,8 +11850,9 @@ pub mod api_version_set { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) version_set_id: String, - pub(crate) if_match: String, + pub(crate) api_id: String, + pub(crate) issue_id: String, + pub(crate) attachment_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -11837,15 +11864,8 @@ pub mod api_version_set { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.version_set_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/issues/{}/attachments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_id , & this . issue_id , & this . attachment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -11854,68 +11874,7 @@ pub mod api_version_set { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) version_set_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.version_set_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11925,121 +11884,104 @@ pub mod api_version_set { } } } -pub mod authorization_server { +pub mod api_tag_description { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of authorization servers defined within a service instance."] + #[doc = "Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level but tag may be assigned to the Operations"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, + api_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + api_id: api_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Gets the details of the authorization server specified by its identifier."] + #[doc = "Get Tag description in scope of API"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `authsid`: Identifier of the authorization server."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - authsid: impl Into, + api_id: impl Into, + tag_description_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - authsid: authsid.into(), + api_id: api_id.into(), + tag_description_id: tag_description_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates new authorization server or updates an existing authorization server."] + #[doc = "Create/Update tag description in scope of the Api."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `authsid`: Identifier of the authorization server."] - #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - authsid: impl Into, - parameters: impl Into, + api_id: impl Into, + tag_description_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - authsid: authsid.into(), + api_id: api_id.into(), + tag_description_id: tag_description_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the details of the authorization server specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `authsid`: Identifier of the authorization server."] - #[doc = "* `parameters`: OAuth2 Server settings Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - authsid: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - authsid: authsid.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes specific authorization server instance."] + #[doc = "Delete tag description for the Api."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - authsid: impl Into, + api_id: impl Into, + tag_description_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -12047,52 +11989,34 @@ pub mod authorization_server { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - authsid: authsid.into(), + api_id: api_id.into(), + tag_description_id: tag_description_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the authorizationServer specified by its identifier."] + #[doc = "Gets the entity state version of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `authsid`: Identifier of the authorization server."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `tag_description_id`: Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - authsid: impl Into, + api_id: impl Into, + tag_description_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - authsid: authsid.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the client secret details of the authorization server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `authsid`: Identifier of the authorization server."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_secrets( - &self, - resource_group_name: impl Into, - service_name: impl Into, - authsid: impl Into, - subscription_id: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - authsid: authsid.into(), + api_id: api_id.into(), + tag_description_id: tag_description_id.into(), subscription_id: subscription_id.into(), } } @@ -12101,9 +12025,9 @@ pub mod authorization_server { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AuthorizationServerCollection = serde_json::from_slice(&bytes)?; + let body: models::TagDescriptionCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12142,13 +12066,14 @@ pub mod authorization_server { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -12163,16 +12088,17 @@ pub mod authorization_server { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.api_id ))?; let rsp = match continuation { Some(value) => { @@ -12190,7 +12116,7 @@ pub mod authorization_server { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12206,7 +12132,7 @@ pub mod authorization_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -12239,9 +12165,9 @@ pub mod authorization_server { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AuthorizationServerContract = serde_json::from_slice(&bytes)?; + let body: models::TagDescriptionContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12290,7 +12216,8 @@ pub mod authorization_server { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) authsid: String, + pub(crate) api_id: String, + pub(crate) tag_description_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -12303,12 +12230,13 @@ pub mod authorization_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.authsid + &this.api_id, + &this.tag_description_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -12319,7 +12247,7 @@ pub mod authorization_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12328,8 +12256,8 @@ pub mod authorization_server { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -12344,9 +12272,9 @@ pub mod authorization_server { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AuthorizationServerContract = serde_json::from_slice(&bytes)?; + let body: models::TagDescriptionContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12395,8 +12323,9 @@ pub mod authorization_server { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) authsid: String, - pub(crate) parameters: models::AuthorizationServerContract, + pub(crate) api_id: String, + pub(crate) tag_description_id: String, + pub(crate) parameters: models::TagDescriptionCreateParameters, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -12415,12 +12344,13 @@ pub mod authorization_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.authsid + &this.api_id, + &this.tag_description_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -12431,7 +12361,7 @@ pub mod authorization_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -12444,117 +12374,8 @@ pub mod authorization_server { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AuthorizationServerContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) authsid: String, - pub(crate) parameters: models::AuthorizationServerUpdateContract, - pub(crate) if_match: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.authsid - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -12587,7 +12408,8 @@ pub mod authorization_server { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) authsid: String, + pub(crate) api_id: String, + pub(crate) tag_description_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -12601,12 +12423,13 @@ pub mod authorization_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.authsid + &this.api_id, + &this.tag_description_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -12617,7 +12440,7 @@ pub mod authorization_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12649,7 +12472,8 @@ pub mod authorization_server { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) authsid: String, + pub(crate) api_id: String, + pub(crate) tag_description_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -12662,12 +12486,13 @@ pub mod authorization_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/tagDescriptions/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.authsid + &this.api_id, + &this.tag_description_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -12678,7 +12503,7 @@ pub mod authorization_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12687,13 +12512,45 @@ pub mod authorization_server { } } } - pub mod list_secrets { +} +pub mod operation { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of operations associated with tags."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_tags( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list_by_tags::RequestBuilder { + list_by_tags::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + include_not_tagged_operations: None, + } + } + } + pub mod list_by_tags { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AuthorizationServerSecretsContract = serde_json::from_slice(&bytes)?; + let body: models::TagResourceCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12702,9 +12559,6 @@ pub mod authorization_server { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -12716,13 +12570,6 @@ pub mod authorization_server { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -12742,140 +12589,180 @@ pub mod authorization_server { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) authsid: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) include_not_tagged_operations: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Include not tagged Operations."] + pub fn include_not_tagged_operations(mut self, include_not_tagged_operations: bool) -> Self { + self.include_not_tagged_operations = Some(include_not_tagged_operations); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authsid)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/operationsByTags", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.api_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(include_not_tagged_operations) = &this.include_not_tagged_operations { + req.url_mut() + .query_pairs_mut() + .append_pair("includeNotTaggedOperations", &include_not_tagged_operations.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod backend { +pub mod api_wiki { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of backends in the specified service instance."] + #[doc = "Gets the details of the Wiki for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, + api_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + api_id: api_id.into(), subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, } } - #[doc = "Gets the details of the backend specified by its identifier."] + #[doc = "Creates a new Wiki for an API or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - backend_id: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - backend_id: backend_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates or Updates a backend."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - backend_id: impl Into, - parameters: impl Into, + api_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - backend_id: backend_id.into(), + api_id: api_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates an existing backend."] + #[doc = "Updates the details of the Wiki for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Update parameters."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Wiki Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - backend_id: impl Into, - parameters: impl Into, + api_id: impl Into, + parameters: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { @@ -12883,25 +12770,25 @@ pub mod backend { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - backend_id: backend_id.into(), + api_id: api_id.into(), parameters: parameters.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes the specified backend."] + #[doc = "Deletes the specified Wiki from an API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - backend_id: impl Into, + api_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -12909,192 +12796,31 @@ pub mod backend { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - backend_id: backend_id.into(), + api_id: api_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the backend specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the Wiki for an API specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - backend_id: impl Into, + api_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - backend_id: backend_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was specified, timeout of 2 minutes is used."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn reconnect( - &self, - resource_group_name: impl Into, - service_name: impl Into, - backend_id: impl Into, - subscription_id: impl Into, - ) -> reconnect::RequestBuilder { - reconnect::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - backend_id: backend_id.into(), + api_id: api_id.into(), subscription_id: subscription_id.into(), - parameters: None, - } - } - } - pub mod list_by_service { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::BackendCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) } } } @@ -13102,9 +12828,9 @@ pub mod backend { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BackendContract = serde_json::from_slice(&bytes)?; + let body: models::WikiContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13153,7 +12879,7 @@ pub mod backend { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) backend_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -13166,12 +12892,12 @@ pub mod backend { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/wikis/default", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.backend_id + &this.api_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -13182,7 +12908,7 @@ pub mod backend { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13191,8 +12917,8 @@ pub mod backend { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -13207,9 +12933,9 @@ pub mod backend { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BackendContract = serde_json::from_slice(&bytes)?; + let body: models::WikiContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13258,8 +12984,8 @@ pub mod backend { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) backend_id: String, - pub(crate) parameters: models::BackendContract, + pub(crate) api_id: String, + pub(crate) parameters: models::WikiContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -13278,12 +13004,12 @@ pub mod backend { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/wikis/default", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.backend_id + &this.api_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -13294,7 +13020,7 @@ pub mod backend { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -13307,8 +13033,8 @@ pub mod backend { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -13323,9 +13049,9 @@ pub mod backend { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BackendContract = serde_json::from_slice(&bytes)?; + let body: models::WikiContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13374,8 +13100,8 @@ pub mod backend { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) backend_id: String, - pub(crate) parameters: models::BackendUpdateParameters, + pub(crate) api_id: String, + pub(crate) parameters: models::WikiUpdateContract, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -13389,12 +13115,12 @@ pub mod backend { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/wikis/default", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.backend_id + &this.api_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -13405,7 +13131,7 @@ pub mod backend { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -13416,8 +13142,8 @@ pub mod backend { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -13450,7 +13176,7 @@ pub mod backend { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) backend_id: String, + pub(crate) api_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -13464,12 +13190,12 @@ pub mod backend { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/wikis/default", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.backend_id + &this.api_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -13480,7 +13206,7 @@ pub mod backend { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13512,7 +13238,7 @@ pub mod backend { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) backend_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -13525,12 +13251,12 @@ pub mod backend { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/wikis/default", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.backend_id + &this.api_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -13541,7 +13267,7 @@ pub mod backend { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13550,9 +13276,63 @@ pub mod backend { } } } - pub mod reconnect { +} +pub mod api_wikis { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the wikis for an API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -13572,66 +13352,112 @@ pub mod backend { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) backend_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, - pub(crate) parameters: Option, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Reconnect request parameters."] - pub fn parameters(mut self, parameters: impl Into) -> Self { - self.parameters = Some(parameters.into()); + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | eq | contains |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}/reconnect", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apis/{}/wikis", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.backend_id + &this.api_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = if let Some(parameters) = &this.parameters { - req.insert_header("content-type", "application/json"); - azure_core::to_json(parameters)? - } else { - azure_core::EMPTY_BODY + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod cache { +pub mod api_version_set { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of all external Caches in the specified service instance."] + #[doc = "Lists a collection of API Version Sets in the specified service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -13643,73 +13469,74 @@ pub mod cache { resource_group_name: resource_group_name.into(), service_name: service_name.into(), subscription_id: subscription_id.into(), + filter: None, top: None, skip: None, } } - #[doc = "Gets the details of the Cache specified by its identifier."] + #[doc = "Gets the details of the Api Version Set specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - cache_id: impl Into, + version_set_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - cache_id: cache_id.into(), + version_set_id: version_set_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates an External Cache to be used in Api Management instance."] + #[doc = "Creates or Updates a Api Version Set."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] - #[doc = "* `parameters`: Create or Update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - cache_id: impl Into, - parameters: impl Into, + version_set_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - cache_id: cache_id.into(), + version_set_id: version_set_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the details of the cache specified by its identifier."] + #[doc = "Updates the details of the Api VersionSet specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - cache_id: impl Into, - parameters: impl Into, + version_set_id: impl Into, + parameters: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { @@ -13717,25 +13544,25 @@ pub mod cache { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - cache_id: cache_id.into(), + version_set_id: version_set_id.into(), parameters: parameters.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes specific Cache."] + #[doc = "Deletes specific Api Version Set."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - cache_id: impl Into, + version_set_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -13743,30 +13570,30 @@ pub mod cache { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - cache_id: cache_id.into(), + version_set_id: version_set_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the Cache specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the Api Version Set specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - cache_id: impl Into, + version_set_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - cache_id: cache_id.into(), + version_set_id: version_set_id.into(), subscription_id: subscription_id.into(), } } @@ -13775,9 +13602,9 @@ pub mod cache { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CacheCollection = serde_json::from_slice(&bytes)?; + let body: models::ApiVersionSetCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13817,10 +13644,16 @@ pub mod cache { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } #[doc = "Number of records to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -13831,12 +13664,12 @@ pub mod cache { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -13858,7 +13691,7 @@ pub mod cache { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13874,7 +13707,10 @@ pub mod cache { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -13904,9 +13740,9 @@ pub mod cache { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CacheContract = serde_json::from_slice(&bytes)?; + let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -13955,7 +13791,7 @@ pub mod cache { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) cache_id: String, + pub(crate) version_set_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -13968,12 +13804,12 @@ pub mod cache { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.cache_id + &this.version_set_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -13984,7 +13820,7 @@ pub mod cache { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13993,8 +13829,8 @@ pub mod cache { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14009,9 +13845,9 @@ pub mod cache { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CacheContract = serde_json::from_slice(&bytes)?; + let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14060,8 +13896,8 @@ pub mod cache { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) cache_id: String, - pub(crate) parameters: models::CacheContract, + pub(crate) version_set_id: String, + pub(crate) parameters: models::ApiVersionSetContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -14080,12 +13916,12 @@ pub mod cache { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.cache_id + &this.version_set_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -14096,7 +13932,7 @@ pub mod cache { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -14109,8 +13945,8 @@ pub mod cache { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14125,9 +13961,9 @@ pub mod cache { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CacheContract = serde_json::from_slice(&bytes)?; + let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14176,8 +14012,8 @@ pub mod cache { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) cache_id: String, - pub(crate) parameters: models::CacheUpdateParameters, + pub(crate) version_set_id: String, + pub(crate) parameters: models::ApiVersionSetUpdateParameters, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -14191,12 +14027,12 @@ pub mod cache { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.cache_id + &this.version_set_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -14207,7 +14043,7 @@ pub mod cache { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -14218,8 +14054,8 @@ pub mod cache { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14252,7 +14088,7 @@ pub mod cache { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) cache_id: String, + pub(crate) version_set_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -14266,12 +14102,12 @@ pub mod cache { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.cache_id + &this.version_set_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -14282,7 +14118,7 @@ pub mod cache { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14314,7 +14150,7 @@ pub mod cache { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) cache_id: String, + pub(crate) version_set_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -14327,12 +14163,12 @@ pub mod cache { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/apiVersionSets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.cache_id + &this.version_set_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -14343,7 +14179,7 @@ pub mod cache { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -14353,16 +14189,16 @@ pub mod cache { } } } -pub mod certificate { +pub mod authorization_provider { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of all certificates in the specified service instance."] + #[doc = "Lists a collection of authorization providers defined within a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -14377,70 +14213,69 @@ pub mod certificate { filter: None, top: None, skip: None, - is_key_vault_refresh_failed: None, } } - #[doc = "Gets the details of the certificate specified by its identifier."] + #[doc = "Gets the details of the authorization provider specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - certificate_id: impl Into, + authorization_provider_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - certificate_id: certificate_id.into(), + authorization_provider_id: authorization_provider_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates the certificate being used for authentication with the backend."] + #[doc = "Creates or updates authorization provider."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create or Update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - certificate_id: impl Into, - parameters: impl Into, + authorization_provider_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - certificate_id: certificate_id.into(), + authorization_provider_id: authorization_provider_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Deletes specific certificate."] + #[doc = "Deletes specific authorization provider from the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - certificate_id: impl Into, + authorization_provider_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -14448,63 +14283,19 @@ pub mod certificate { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - certificate_id: certificate_id.into(), + authorization_provider_id: authorization_provider_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the certificate specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - certificate_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - certificate_id: certificate_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "From KeyVault, Refresh the certificate being used for authentication with the backend."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn refresh_secret( - &self, - resource_group_name: impl Into, - service_name: impl Into, - certificate_id: impl Into, - subscription_id: impl Into, - ) -> refresh_secret::RequestBuilder { - refresh_secret::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - certificate_id: certificate_id.into(), - subscription_id: subscription_id.into(), - } - } } pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CertificateCollection = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationProviderCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14547,10 +14338,9 @@ pub mod certificate { pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) is_key_vault_refresh_failed: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| subject | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -14565,17 +14355,12 @@ pub mod certificate { self.skip = Some(skip); self } - #[doc = "When set to true, the response contains only certificates entities which failed refresh."] - pub fn is_key_vault_refresh_failed(mut self, is_key_vault_refresh_failed: bool) -> Self { - self.is_key_vault_refresh_failed = Some(is_key_vault_refresh_failed); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -14597,7 +14382,7 @@ pub mod certificate { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14613,7 +14398,7 @@ pub mod certificate { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -14623,11 +14408,6 @@ pub mod certificate { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } - if let Some(is_key_vault_refresh_failed) = &this.is_key_vault_refresh_failed { - req.url_mut() - .query_pairs_mut() - .append_pair("isKeyVaultRefreshFailed", &is_key_vault_refresh_failed.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -14651,9 +14431,9 @@ pub mod certificate { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CertificateContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationProviderContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14702,7 +14482,7 @@ pub mod certificate { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) certificate_id: String, + pub(crate) authorization_provider_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -14715,12 +14495,12 @@ pub mod certificate { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.certificate_id + &this.authorization_provider_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -14731,7 +14511,7 @@ pub mod certificate { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -14740,8 +14520,8 @@ pub mod certificate { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14756,9 +14536,9 @@ pub mod certificate { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CertificateContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationProviderContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -14807,8 +14587,8 @@ pub mod certificate { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) certificate_id: String, - pub(crate) parameters: models::CertificateCreateOrUpdateParameters, + pub(crate) authorization_provider_id: String, + pub(crate) parameters: models::AuthorizationProviderContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -14827,12 +14607,12 @@ pub mod certificate { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.certificate_id + &this.authorization_provider_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -14843,7 +14623,7 @@ pub mod certificate { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -14856,8 +14636,8 @@ pub mod certificate { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -14890,7 +14670,7 @@ pub mod certificate { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) certificate_id: String, + pub(crate) authorization_provider_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -14904,12 +14684,12 @@ pub mod certificate { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.certificate_id + &this.authorization_provider_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -14920,7 +14700,7 @@ pub mod certificate { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -14930,247 +14710,105 @@ pub mod certificate { } } } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) certificate_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.certificate_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod refresh_secret { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CertificateContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) certificate_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}/refreshSecret" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . certificate_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } } -pub mod content_type { +pub mod authorization { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Returns list of content types"] + #[doc = "Lists a collection of authorization providers defined within a authorization provider."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_authorization_provider( &self, resource_group_name: impl Into, service_name: impl Into, + authorization_provider_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_authorization_provider::RequestBuilder { + list_by_authorization_provider::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + authorization_provider_id: authorization_provider_id.into(), subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, } } - #[doc = "Gets API Management content type details."] + #[doc = "Gets the details of the authorization specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates an Content Type."] + #[doc = "Creates or updates authorization."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Removes specified content type."] + #[doc = "Deletes specific Authorization from the Authorization provider."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -15178,19 +14816,48 @@ pub mod content_type { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } + #[doc = "Confirm valid consent code to suppress Authorizations anti-phishing page."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn confirm_consent_code( + &self, + resource_group_name: impl Into, + service_name: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> confirm_consent_code::RequestBuilder { + confirm_consent_code::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } } - pub mod list_by_service { + pub mod list_by_authorization_provider { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ContentTypeCollection = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15229,20 +14896,33 @@ pub mod content_type { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) authorization_provider_id: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -15259,7 +14939,7 @@ pub mod content_type { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15275,7 +14955,16 @@ pub mod content_type { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -15299,9 +14988,9 @@ pub mod content_type { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ContentTypeContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15350,7 +15039,8 @@ pub mod content_type { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -15362,14 +15052,7 @@ pub mod content_type { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.content_type_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -15379,7 +15062,7 @@ pub mod content_type { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15388,8 +15071,8 @@ pub mod content_type { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15404,9 +15087,9 @@ pub mod content_type { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ContentTypeContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15455,7 +15138,9 @@ pub mod content_type { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, + pub(crate) parameters: models::AuthorizationContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -15473,14 +15158,7 @@ pub mod content_type { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.content_type_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -15490,11 +15168,12 @@ pub mod content_type { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { req.insert_header("if-match", if_match); } - let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -15502,8 +15181,8 @@ pub mod content_type { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15536,7 +15215,8 @@ pub mod content_type { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -15549,14 +15229,7 @@ pub mod content_type { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.content_type_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -15566,7 +15239,7 @@ pub mod content_type { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15576,99 +15249,307 @@ pub mod content_type { } } } + pub mod confirm_consent_code { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, + pub(crate) parameters: models::AuthorizationConfirmConsentCodeRequestContract, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}/confirmConsentCode" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } -pub mod content_item { +pub mod authorization_login_links { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Returns list of content items"] + #[doc = "Gets authorization login links."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn post( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + parameters: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> post::RequestBuilder { + post::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod post { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AuthorizationLoginResponseContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, + pub(crate) parameters: models::AuthorizationLoginRequestContract, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}/getLoginLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod authorization_access_policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of authorization access policy defined within a authorization."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_authorization( + &self, + resource_group_name: impl Into, + service_name: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + subscription_id: impl Into, + ) -> list_by_authorization::RequestBuilder { + list_by_authorization::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, } } - #[doc = "Returns content item details"] + #[doc = "Gets the details of the authorization access policy specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `content_item_id`: Content item identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `authorization_access_policy_id`: Identifier of the authorization access policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, - content_item_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + authorization_access_policy_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), - content_item_id: content_item_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), + authorization_access_policy_id: authorization_access_policy_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates new content item"] + #[doc = "Creates or updates Authorization Access Policy."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `content_item_id`: Content item identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `authorization_access_policy_id`: Identifier of the authorization access policy."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, - content_item_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + authorization_access_policy_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), - content_item_id: content_item_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), + authorization_access_policy_id: authorization_access_policy_id.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Removes specified content item."] + #[doc = "Deletes specific access policy from the Authorization."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `content_item_id`: Content item identifier."] + #[doc = "* `authorization_provider_id`: Identifier of the authorization provider."] + #[doc = "* `authorization_id`: Identifier of the authorization."] + #[doc = "* `authorization_access_policy_id`: Identifier of the authorization access policy."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - content_type_id: impl Into, - content_item_id: impl Into, + authorization_provider_id: impl Into, + authorization_id: impl Into, + authorization_access_policy_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -15676,45 +15557,21 @@ pub mod content_item { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - content_type_id: content_type_id.into(), - content_item_id: content_item_id.into(), + authorization_provider_id: authorization_provider_id.into(), + authorization_id: authorization_id.into(), + authorization_access_policy_id: authorization_access_policy_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Returns content item metadata"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `content_type_id`: Content type identifier."] - #[doc = "* `content_item_id`: Content item identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - content_type_id: impl Into, - content_item_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - content_type_id: content_type_id.into(), - content_item_id: content_item_id.into(), - subscription_id: subscription_id.into(), - } - } } - pub mod list_by_service { + pub mod list_by_authorization { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ContentItemCollection = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationAccessPolicyCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15753,15 +15610,34 @@ pub mod content_item { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}/accessPolicies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -15778,7 +15654,7 @@ pub mod content_item { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -15794,7 +15670,16 @@ pub mod content_item { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -15818,9 +15703,9 @@ pub mod content_item { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ContentItemContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationAccessPolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15869,8 +15754,9 @@ pub mod content_item { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, - pub(crate) content_item_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, + pub(crate) authorization_access_policy_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -15882,7 +15768,7 @@ pub mod content_item { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}/accessPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id , & this . authorization_access_policy_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -15892,7 +15778,7 @@ pub mod content_item { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15901,8 +15787,8 @@ pub mod content_item { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -15917,9 +15803,9 @@ pub mod content_item { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ContentItemContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationAccessPolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -15968,8 +15854,10 @@ pub mod content_item { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, - pub(crate) content_item_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, + pub(crate) authorization_access_policy_id: String, + pub(crate) parameters: models::AuthorizationAccessPolicyContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -15987,7 +15875,7 @@ pub mod content_item { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}/accessPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id , & this . authorization_access_policy_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -15997,11 +15885,12 @@ pub mod content_item { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { req.insert_header("if-match", if_match); } - let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -16009,8 +15898,8 @@ pub mod content_item { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16043,8 +15932,9 @@ pub mod content_item { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) content_type_id: String, - pub(crate) content_item_id: String, + pub(crate) authorization_provider_id: String, + pub(crate) authorization_id: String, + pub(crate) authorization_access_policy_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -16057,7 +15947,7 @@ pub mod content_item { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationProviders/{}/authorizations/{}/accessPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authorization_provider_id , & this . authorization_id , & this . authorization_access_policy_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -16067,7 +15957,7 @@ pub mod content_item { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -16077,121 +15967,186 @@ pub mod content_item { } } } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) content_type_id: String, - pub(crate) content_item_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } } -pub mod deleted_services { +pub mod authorization_server { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all soft-deleted services available for undelete for the given subscription."] + #[doc = "Lists a collection of authorization servers defined within a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, } } - #[doc = "Get soft-deleted Api Management Service by name."] + #[doc = "Gets the details of the authorization server specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `location`: The location of the deleted API Management service."] - pub fn get_by_name( + #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( &self, + resource_group_name: impl Into, service_name: impl Into, + authsid: impl Into, subscription_id: impl Into, - location: impl Into, - ) -> get_by_name::RequestBuilder { - get_by_name::RequestBuilder { + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), service_name: service_name.into(), + authsid: authsid.into(), subscription_id: subscription_id.into(), - location: location.into(), } } - #[doc = "Purges Api Management Service (deletes it with no option to undelete)."] + #[doc = "Creates new authorization server or updates an existing authorization server."] #[doc = ""] #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `location`: The location of the deleted API Management service."] - pub fn purge( + #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( &self, + resource_group_name: impl Into, service_name: impl Into, + authsid: impl Into, + parameters: impl Into, subscription_id: impl Into, - location: impl Into, - ) -> purge::RequestBuilder { - purge::RequestBuilder { + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), service_name: service_name.into(), + authsid: authsid.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the authorization server specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `parameters`: OAuth2 Server settings Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + authsid: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + authsid: authsid.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific authorization server instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + authsid: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + authsid: authsid.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the authorizationServer specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + authsid: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + authsid: authsid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the client secret details of the authorization server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `authsid`: Identifier of the authorization server."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + authsid: impl Into, + subscription_id: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + authsid: authsid.into(), subscription_id: subscription_id.into(), - location: location.into(), } } } - pub mod list_by_subscription { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DeletedServicesCollection = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationServerCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16228,17 +16183,39 @@ pub mod deleted_services { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/deletedservices", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.service_name ))?; let rsp = match continuation { Some(value) => { @@ -16256,7 +16233,7 @@ pub mod deleted_services { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -16272,7 +16249,16 @@ pub mod deleted_services { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -16292,13 +16278,13 @@ pub mod deleted_services { } } } - pub mod get_by_name { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DeletedServiceContract = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationServerContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16307,6 +16293,9 @@ pub mod deleted_services { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -16318,6 +16307,13 @@ pub mod deleted_services { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -16335,9 +16331,10 @@ pub mod deleted_services { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) authsid: String, pub(crate) subscription_id: String, - pub(crate) location: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -16349,11 +16346,12 @@ pub mod deleted_services { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/locations/{}/deletedservices/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", this.client.endpoint(), &this.subscription_id, - &this.location, - &this.service_name + &this.resource_group_name, + &this.service_name, + &this.authsid ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -16364,7 +16362,7 @@ pub mod deleted_services { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -16373,8 +16371,8 @@ pub mod deleted_services { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -16385,9 +16383,42 @@ pub mod deleted_services { } } } - pub mod purge { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AuthorizationServerContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -16405,11 +16436,19 @@ pub mod deleted_services { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) authsid: String, + pub(crate) parameters: models::AuthorizationServerContract, pub(crate) subscription_id: String, - pub(crate) location: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16419,13 +16458,14 @@ pub mod deleted_services { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/locations/{}/deletedservices/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", this.client.endpoint(), &this.subscription_id, - &this.location, - &this.service_name + &this.resource_group_name, + &this.service_name, + &this.authsid ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -16434,32 +16474,38 @@ pub mod deleted_services { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - } -} -pub mod api_management_operations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all of the available REST API operations of the Microsoft.ApiManagement provider."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } } } - pub mod list { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + let body: models::AuthorizationServerContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16468,6 +16514,9 @@ pub mod api_management_operations { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -16479,6 +16528,13 @@ pub mod api_management_operations { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -16496,118 +16552,127 @@ pub mod api_management_operations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) authsid: String, + pub(crate) parameters: models::AuthorizationServerUpdateContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = - azure_core::Url::parse(&format!("{}/providers/Microsoft.ApiManagement/operations", this.client.endpoint(),))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.authsid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } - } -} -pub mod api_management_service_skus { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets available SKUs for API Management service"] - #[doc = "Gets all available SKU for a given API Management service"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_available_service_skus( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> list_available_service_skus::RequestBuilder { - list_available_service_skus::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_available_service_skus { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceSkuResults = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) authsid: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.authsid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -16627,305 +16692,324 @@ pub mod api_management_service_skus { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) authsid: String, pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/skus", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.authsid ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + } + pub mod list_secrets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AuthorizationServerSecretsContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) authsid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/authorizationServers/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . authsid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } } -pub mod api_management_service { +pub mod backend { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Parameters supplied to the Restore API Management service from backup operation."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn restore( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> restore::RequestBuilder { - restore::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete."] + #[doc = "Lists a collection of backends in the specified service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Parameters supplied to the ApiManagementService_Backup operation."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn backup( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, subscription_id: impl Into, - ) -> backup::RequestBuilder { - backup::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, } } - #[doc = "Gets an API Management service resource description."] + #[doc = "Gets the details of the backend specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, + backend_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + backend_id: backend_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates an API Management service. This is long running operation and could take several minutes to complete."] + #[doc = "Creates or Updates a backend."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate API Management service operation."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, + backend_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + backend_id: backend_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), + if_match: None, } } - #[doc = "Updates an existing API Management service."] + #[doc = "Updates an existing backend."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate API Management service operation."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, + backend_id: impl Into, + parameters: impl Into, + if_match: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + backend_id: backend_id.into(), parameters: parameters.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes an existing API Management service."] + #[doc = "Deletes the specified backend."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, + backend_id: impl Into, + if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + backend_id: backend_id.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "List all API Management services within a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_resource_group( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Lists all API Management services within an Azure subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes."] + #[doc = "Gets the entity state (Etag) version of the backend specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_sso_token( + #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, + backend_id: impl Into, subscription_id: impl Into, - ) -> get_sso_token::RequestBuilder { - get_sso_token::RequestBuilder { + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + backend_id: backend_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Checks availability and correctness of a name for an API Management service."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `parameters`: Parameters supplied to the CheckNameAvailability operation."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_name_availability( - &self, - parameters: impl Into, - subscription_id: impl Into, - ) -> check_name_availability::RequestBuilder { - check_name_availability::RequestBuilder { - client: self.0.clone(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Get the custom domain ownership identifier for an API Management service."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_domain_ownership_identifier( - &self, - subscription_id: impl Into, - ) -> get_domain_ownership_identifier::RequestBuilder { - get_domain_ownership_identifier::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes."] + #[doc = "Notifies the API Management gateway to create a new connection to the backend after the specified timeout. If no timeout was specified, timeout of 2 minutes is used."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn apply_network_configuration_updates( + #[doc = "* `backend_id`: Identifier of the Backend entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn reconnect( &self, resource_group_name: impl Into, service_name: impl Into, + backend_id: impl Into, subscription_id: impl Into, - ) -> apply_network_configuration_updates::RequestBuilder { - apply_network_configuration_updates::RequestBuilder { + ) -> reconnect::RequestBuilder { + reconnect::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + backend_id: backend_id.into(), subscription_id: subscription_id.into(), parameters: None, } } } - pub mod restore { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + let body: models::BackendCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -16964,64 +17048,106 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::ApiManagementServiceBackupRestoreParameters, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/restore", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod backup { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + let body: models::BackendContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17030,6 +17156,9 @@ pub mod api_management_service { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -17041,6 +17170,13 @@ pub mod api_management_service { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17060,11 +17196,10 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::ApiManagementServiceBackupRestoreParameters, + pub(crate) backend_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17074,13 +17209,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backup", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.backend_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17089,9 +17225,8 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -17099,8 +17234,8 @@ pub mod api_management_service { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17111,13 +17246,13 @@ pub mod api_management_service { } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + let body: models::BackendContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17126,6 +17261,9 @@ pub mod api_management_service { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -17137,6 +17275,13 @@ pub mod api_management_service { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17156,9 +17301,17 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) backend_id: String, + pub(crate) parameters: models::BackendContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17168,13 +17321,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.backend_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17183,8 +17337,12 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -17192,8 +17350,8 @@ pub mod api_management_service { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17204,13 +17362,13 @@ pub mod api_management_service { } } } - pub mod create_or_update { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + let body: models::BackendContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17219,6 +17377,9 @@ pub mod api_management_service { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -17230,6 +17391,13 @@ pub mod api_management_service { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17249,11 +17417,12 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::ApiManagementServiceResource, + pub(crate) backend_id: String, + pub(crate) parameters: models::BackendUpdateParameters, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17263,13 +17432,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.backend_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17278,9 +17448,10 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -17288,8 +17459,8 @@ pub mod api_management_service { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17300,32 +17471,9 @@ pub mod api_management_service { } } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17345,11 +17493,11 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::ApiManagementServiceUpdateParameters, + pub(crate) backend_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17359,13 +17507,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.backend_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17374,29 +17523,17 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod delete { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -17418,10 +17555,10 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) backend_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17431,13 +17568,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.backend_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17446,7 +17584,7 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -17455,32 +17593,9 @@ pub mod api_management_service { } } } - pub mod list_by_resource_group { + pub mod reconnect { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17499,78 +17614,213 @@ pub mod api_management_service { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) backend_id: String, pub(crate) subscription_id: String, + pub(crate) parameters: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Reconnect request parameters."] + pub fn parameters(mut self, parameters: impl Into) -> Self { + self.parameters = Some(parameters.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backends/{}/reconnect", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name + &this.resource_group_name, + &this.service_name, + &this.backend_id ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = if let Some(parameters) = &this.parameters { + req.insert_header("content-type", "application/json"); + azure_core::to_json(parameters)? + } else { + azure_core::EMPTY_BODY }; - rsp?.into_body().await + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } - pub mod list { +} +pub mod cache { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of all external Caches in the specified service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + } + } + #[doc = "Gets the details of the Cache specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + cache_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + cache_id: cache_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates an External Cache to be used in Api Management instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `parameters`: Create or Update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + cache_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + cache_id: cache_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the cache specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + cache_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + cache_id: cache_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific Cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + cache_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + cache_id: cache_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Cache specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `cache_id`: Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + cache_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + cache_id: cache_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceListResult = serde_json::from_slice(&bytes)?; + let body: models::CacheCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17607,17 +17857,33 @@ pub mod api_management_service { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/service", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.service_name ))?; let rsp = match continuation { Some(value) => { @@ -17635,7 +17901,7 @@ pub mod api_management_service { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17651,7 +17917,13 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -17671,13 +17943,13 @@ pub mod api_management_service { } } } - pub mod get_sso_token { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceGetSsoTokenResult = serde_json::from_slice(&bytes)?; + let body: models::CacheContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17686,6 +17958,9 @@ pub mod api_management_service { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -17697,6 +17972,13 @@ pub mod api_management_service { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17716,6 +17998,7 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) cache_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -17728,13 +18011,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/getssotoken", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.cache_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17743,9 +18027,8 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -17753,8 +18036,8 @@ pub mod api_management_service { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17765,13 +18048,13 @@ pub mod api_management_service { } } } - pub mod check_name_availability { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceNameAvailabilityResult = serde_json::from_slice(&bytes)?; + let body: models::CacheContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17780,6 +18063,9 @@ pub mod api_management_service { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -17791,6 +18077,13 @@ pub mod api_management_service { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17808,10 +18101,19 @@ pub mod api_management_service { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) parameters: models::ApiManagementServiceCheckNameAvailabilityParameters, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) cache_id: String, + pub(crate) parameters: models::CacheContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17821,11 +18123,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/checkNameAvailability", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.cache_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17834,9 +18139,12 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -17844,8 +18152,8 @@ pub mod api_management_service { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17856,13 +18164,13 @@ pub mod api_management_service { } } } - pub mod get_domain_ownership_identifier { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementServiceGetDomainOwnershipIdentifierResult = serde_json::from_slice(&bytes)?; + let body: models::CacheContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -17871,6 +18179,9 @@ pub mod api_management_service { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -17882,6 +18193,13 @@ pub mod api_management_service { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -17899,6 +18217,11 @@ pub mod api_management_service { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) cache_id: String, + pub(crate) parameters: models::CacheUpdateParameters, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -17911,11 +18234,14 @@ pub mod api_management_service { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.cache_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17924,9 +18250,10 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -17934,9 +18261,8 @@ pub mod api_management_service { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = - futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -17947,7 +18273,7 @@ pub mod api_management_service { } } } - pub mod apply_network_configuration_updates { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -17969,16 +18295,72 @@ pub mod api_management_service { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) cache_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) parameters: Option, } impl RequestBuilder { - #[doc = "Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which the Api Management service is deployed will be updated sequentially without incurring downtime in the region."] - pub fn parameters(mut self, parameters: impl Into) -> Self { - self.parameters = Some(parameters.into()); - self + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.cache_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) cache_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -17987,8 +18369,15 @@ pub mod api_management_service { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/applynetworkconfigurationupdates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/caches/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.cache_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -17997,13 +18386,8 @@ pub mod api_management_service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = if let Some(parameters) = &this.parameters { - req.insert_header("content-type", "application/json"); - azure_core::to_json(parameters)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -18012,16 +18396,16 @@ pub mod api_management_service { } } } -pub mod diagnostic { +pub mod certificate { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all diagnostics of the API Management service instance."] + #[doc = "Lists a collection of all certificates in the specified service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -18036,128 +18420,123 @@ pub mod diagnostic { filter: None, top: None, skip: None, + is_key_vault_refresh_failed: None, } } - #[doc = "Gets the details of the Diagnostic specified by its identifier."] + #[doc = "Gets the details of the certificate specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - diagnostic_id: impl Into, + certificate_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - diagnostic_id: diagnostic_id.into(), + certificate_id: certificate_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates a new Diagnostic or updates an existing one."] + #[doc = "Creates or updates the certificate being used for authentication with the backend."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or Update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - diagnostic_id: impl Into, - parameters: impl Into, + certificate_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - diagnostic_id: diagnostic_id.into(), + certificate_id: certificate_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the details of the Diagnostic specified by its identifier."] + #[doc = "Deletes specific certificate."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Diagnostic Update parameters."] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - diagnostic_id: impl Into, - parameters: impl Into, + certificate_id: impl Into, if_match: impl Into, subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - diagnostic_id: diagnostic_id.into(), - parameters: parameters.into(), + certificate_id: certificate_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes the specified Diagnostic."] + #[doc = "Gets the entity state (Etag) version of the certificate specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - diagnostic_id: impl Into, - if_match: impl Into, + certificate_id: impl Into, subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - diagnostic_id: diagnostic_id.into(), - if_match: if_match.into(), + certificate_id: certificate_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the Diagnostic specified by its identifier."] + #[doc = "From KeyVault, Refresh the certificate being used for authentication with the backend."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn refresh_secret( &self, resource_group_name: impl Into, service_name: impl Into, - diagnostic_id: impl Into, + certificate_id: impl Into, subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { + ) -> refresh_secret::RequestBuilder { + refresh_secret::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - diagnostic_id: diagnostic_id.into(), + certificate_id: certificate_id.into(), subscription_id: subscription_id.into(), } } @@ -18166,9 +18545,9 @@ pub mod diagnostic { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticCollection = serde_json::from_slice(&bytes)?; + let body: models::CertificateCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18211,9 +18590,10 @@ pub mod diagnostic { pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, + pub(crate) is_key_vault_refresh_failed: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| subject | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -18228,12 +18608,17 @@ pub mod diagnostic { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "When set to true, the response contains only certificates entities which failed refresh."] + pub fn is_key_vault_refresh_failed(mut self, is_key_vault_refresh_failed: bool) -> Self { + self.is_key_vault_refresh_failed = Some(is_key_vault_refresh_failed); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -18255,7 +18640,7 @@ pub mod diagnostic { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -18271,7 +18656,7 @@ pub mod diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -18281,6 +18666,11 @@ pub mod diagnostic { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } + if let Some(is_key_vault_refresh_failed) = &this.is_key_vault_refresh_failed { + req.url_mut() + .query_pairs_mut() + .append_pair("isKeyVaultRefreshFailed", &is_key_vault_refresh_failed.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -18304,9 +18694,9 @@ pub mod diagnostic { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; + let body: models::CertificateContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18355,7 +18745,7 @@ pub mod diagnostic { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) diagnostic_id: String, + pub(crate) certificate_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -18368,12 +18758,12 @@ pub mod diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.diagnostic_id + &this.certificate_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -18384,7 +18774,7 @@ pub mod diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18393,8 +18783,8 @@ pub mod diagnostic { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -18409,9 +18799,9 @@ pub mod diagnostic { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; + let body: models::CertificateContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18460,8 +18850,8 @@ pub mod diagnostic { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) diagnostic_id: String, - pub(crate) parameters: models::DiagnosticContract, + pub(crate) certificate_id: String, + pub(crate) parameters: models::CertificateCreateOrUpdateParameters, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -18480,12 +18870,12 @@ pub mod diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.diagnostic_id + &this.certificate_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -18496,7 +18886,7 @@ pub mod diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -18509,8 +18899,8 @@ pub mod diagnostic { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -18521,42 +18911,9 @@ pub mod diagnostic { } } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -18576,8 +18933,7 @@ pub mod diagnostic { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) diagnostic_id: String, - pub(crate) parameters: models::DiagnosticContract, + pub(crate) certificate_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -18591,14 +18947,14 @@ pub mod diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.diagnostic_id + &this.certificate_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -18607,30 +18963,17 @@ pub mod diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod delete { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -18652,8 +18995,7 @@ pub mod diagnostic { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) diagnostic_id: String, - pub(crate) if_match: String, + pub(crate) certificate_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -18666,14 +19008,14 @@ pub mod diagnostic { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.diagnostic_id + &this.certificate_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -18682,8 +19024,7 @@ pub mod diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18692,9 +19033,42 @@ pub mod diagnostic { } } } - pub mod get_entity_tag { + pub mod refresh_secret { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CertificateContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -18714,7 +19088,7 @@ pub mod diagnostic { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) diagnostic_id: String, + pub(crate) certificate_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -18726,15 +19100,8 @@ pub mod diagnostic { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.diagnostic_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/certificates/{}/refreshSecret" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . certificate_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -18743,26 +19110,124 @@ pub mod diagnostic { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod email_template { +impl Client { + #[doc = "Performs a connectivity check between the API Management service and a given destination, and returns metrics for the connection, as well as errors encountered while trying to establish it."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `connectivity_check_request_params`: Connectivity Check request parameters."] + pub fn perform_connectivity_check_async( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + connectivity_check_request_params: impl Into, + ) -> perform_connectivity_check_async::RequestBuilder { + perform_connectivity_check_async::RequestBuilder { + client: self.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + connectivity_check_request_params: connectivity_check_request_params.into(), + } + } +} +pub mod perform_connectivity_check_async { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) connectivity_check_request_params: models::ConnectivityCheckRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/connectivityCheck", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.connectivity_check_request_params)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } +} +pub mod content_type { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all email templates"] + #[doc = "Lists the developer portal's content types. Content types describe content items' properties, validation rules, and constraints."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -18774,100 +19239,69 @@ pub mod email_template { resource_group_name: resource_group_name.into(), service_name: service_name.into(), subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, } } - #[doc = "Gets the details of the email template specified by its identifier."] + #[doc = "Gets the details of the developer portal's content type. Content types describe content items' properties, validation rules, and constraints."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `template_name`: Email Template Name Identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - template_name: impl Into, + content_type_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - template_name: template_name.into(), + content_type_id: content_type_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Updates an Email Template."] + #[doc = "Creates or updates the developer portal's content type. Content types describe content items' properties, validation rules, and constraints. Custom content types' identifiers need to start with the `c-` prefix. Built-in content types can't be modified."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `template_name`: Email Template Name Identifier."] - #[doc = "* `parameters`: Email Template update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - template_name: impl Into, - parameters: impl Into, + content_type_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - template_name: template_name.into(), + content_type_id: content_type_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates API Management email template"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `template_name`: Email Template Name Identifier."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - template_name: impl Into, - if_match: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - template_name: template_name.into(), - if_match: if_match.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Reset the Email Template to default template provided by the API Management service instance."] + #[doc = "Removes the specified developer portal's content type. Content types describe content items' properties, validation rules, and constraints. Built-in content types (with identifiers starting with the `c-` prefix) can't be removed."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `template_name`: Email Template Name Identifier."] + #[doc = "* `content_type_id`: Content type identifier."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - template_name: impl Into, + content_type_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -18875,41 +19309,19 @@ pub mod email_template { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - template_name: template_name.into(), + content_type_id: content_type_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the email template specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `template_name`: Email Template Name Identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - template_name: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - template_name: template_name.into(), - subscription_id: subscription_id.into(), - } - } } pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EmailTemplateCollection = serde_json::from_slice(&bytes)?; + let body: models::ContentTypeCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -18949,32 +19361,14 @@ pub mod email_template { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -18996,7 +19390,7 @@ pub mod email_template { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -19012,16 +19406,7 @@ pub mod email_template { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -19045,9 +19430,9 @@ pub mod email_template { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EmailTemplateContract = serde_json::from_slice(&bytes)?; + let body: models::ContentTypeContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19096,7 +19481,7 @@ pub mod email_template { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) template_name: String, + pub(crate) content_type_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -19109,12 +19494,12 @@ pub mod email_template { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.template_name + &this.content_type_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -19125,7 +19510,7 @@ pub mod email_template { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19134,8 +19519,8 @@ pub mod email_template { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19150,115 +19535,9 @@ pub mod email_template { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EmailTemplateContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) template_name: String, - pub(crate) parameters: models::EmailTemplateUpdateParameters, - pub(crate) subscription_id: String, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.template_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EmailTemplateContract = serde_json::from_slice(&bytes)?; + let body: models::ContentTypeContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19307,12 +19586,17 @@ pub mod email_template { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) template_name: String, - pub(crate) if_match: String, - pub(crate) parameters: models::EmailTemplateUpdateParameters, + pub(crate) content_type_id: String, + pub(crate) parameters: models::ContentTypeContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -19322,14 +19606,14 @@ pub mod email_template { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.template_name + &this.content_type_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -19338,8 +19622,10 @@ pub mod email_template { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -19349,8 +19635,8 @@ pub mod email_template { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19383,7 +19669,7 @@ pub mod email_template { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) template_name: String, + pub(crate) content_type_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -19397,12 +19683,12 @@ pub mod email_template { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.template_name + &this.content_type_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -19413,7 +19699,7 @@ pub mod email_template { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -19423,180 +19709,102 @@ pub mod email_template { } } } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) template_name: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.template_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } } -pub mod gateway { +pub mod content_item { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of gateways registered with service instance."] + #[doc = "Lists developer portal's content items specified by the provided content type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, + content_type_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + content_type_id: content_type_id.into(), subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, } } - #[doc = "Gets the details of the Gateway specified by its identifier."] + #[doc = "Returns the developer portal's content item specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `content_item_id`: Content item identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - gateway_id: impl Into, + content_type_id: impl Into, + content_item_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - gateway_id: gateway_id.into(), + content_type_id: content_type_id.into(), + content_item_id: content_item_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates a Gateway to be used in Api Management instance."] + #[doc = "Creates a new developer portal's content item specified by the provided content type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `content_item_id`: Content item identifier."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - gateway_id: impl Into, - parameters: impl Into, + content_type_id: impl Into, + content_item_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - gateway_id: gateway_id.into(), + content_type_id: content_type_id.into(), + content_item_id: content_item_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the details of the gateway specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes specific Gateway."] + #[doc = "Removes the specified developer portal's content item."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `content_item_id`: Content item identifier."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - gateway_id: impl Into, + content_type_id: impl Into, + content_item_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -19604,112 +19812,46 @@ pub mod gateway { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - gateway_id: gateway_id.into(), + content_type_id: content_type_id.into(), + content_item_id: content_item_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the Gateway specified by its identifier."] + #[doc = "Returns the entity state (ETag) version of the developer portal's content item specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `content_type_id`: Content type identifier."] + #[doc = "* `content_item_id`: Content item identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - gateway_id: impl Into, + content_type_id: impl Into, + content_item_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - gateway_id: gateway_id.into(), + content_type_id: content_type_id.into(), + content_item_id: content_item_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Retrieves gateway keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_keys( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - subscription_id: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Regenerates specified gateway key invalidating any tokens created with it."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn regenerate_key( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> regenerate_key::RequestBuilder { - regenerate_key::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the Shared Access Authorization Token for the gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn generate_token( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> generate_token::RequestBuilder { - generate_token::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list_by_service { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GatewayCollection = serde_json::from_slice(&bytes)?; - Ok(body) + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ContentItemCollection = serde_json::from_slice(&bytes)?; + Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { self.0 @@ -19747,38 +19889,15 @@ pub mod gateway { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) content_type_id: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| region | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -19795,7 +19914,7 @@ pub mod gateway { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -19811,16 +19930,7 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -19844,9 +19954,9 @@ pub mod gateway { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayContract = serde_json::from_slice(&bytes)?; + let body: models::ContentItemContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -19895,7 +20005,8 @@ pub mod gateway { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, + pub(crate) content_type_id: String, + pub(crate) content_item_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -19907,14 +20018,7 @@ pub mod gateway { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -19924,7 +20028,7 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19933,8 +20037,8 @@ pub mod gateway { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -19949,9 +20053,9 @@ pub mod gateway { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayContract = serde_json::from_slice(&bytes)?; + let body: models::ContentItemContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20000,8 +20104,9 @@ pub mod gateway { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) parameters: models::GatewayContract, + pub(crate) content_type_id: String, + pub(crate) content_item_id: String, + pub(crate) parameters: models::ContentItemContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -20019,14 +20124,7 @@ pub mod gateway { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -20036,7 +20134,7 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -20049,8 +20147,8 @@ pub mod gateway { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20061,42 +20159,9 @@ pub mod gateway { } } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GatewayContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -20116,8 +20181,8 @@ pub mod gateway { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) parameters: models::GatewayContract, + pub(crate) content_type_id: String, + pub(crate) content_item_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -20130,15 +20195,8 @@ pub mod gateway { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -20147,30 +20205,17 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod delete { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -20192,8 +20237,8 @@ pub mod gateway { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) if_match: String, + pub(crate) content_type_id: String, + pub(crate) content_item_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -20205,15 +20250,8 @@ pub mod gateway { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/contentTypes/{}/contentItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . content_type_id , & this . content_item_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -20222,8 +20260,7 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -20232,9 +20269,86 @@ pub mod gateway { } } } - pub mod get_entity_tag { +} +pub mod deleted_services { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all soft-deleted services available for undelete for the given subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get soft-deleted Api Management Service by name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The location of the deleted API Management service."] + pub fn get_by_name( + &self, + service_name: impl Into, + subscription_id: impl Into, + location: impl Into, + ) -> get_by_name::RequestBuilder { + get_by_name::RequestBuilder { + client: self.0.clone(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + #[doc = "Purges Api Management Service (deletes it with no option to undelete)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The location of the deleted API Management service."] + pub fn purge( + &self, + service_name: impl Into, + subscription_id: impl Into, + location: impl Into, + ) -> purge::RequestBuilder { + purge::RequestBuilder { + client: self.0.clone(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + } + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeletedServicesCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -20252,53 +20366,77 @@ pub mod gateway { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) gateway_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/deletedservices", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod list_keys { + pub mod get_by_name { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayKeysContract = serde_json::from_slice(&bytes)?; + let body: models::DeletedServiceContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20307,9 +20445,6 @@ pub mod gateway { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -20321,13 +20456,6 @@ pub mod gateway { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -20345,10 +20473,9 @@ pub mod gateway { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, pub(crate) subscription_id: String, + pub(crate) location: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -20360,14 +20487,13 @@ pub mod gateway { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/listKeys", + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/locations/{}/deletedservices/{}", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id + &this.location, + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -20376,9 +20502,8 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -20386,8 +20511,8 @@ pub mod gateway { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20398,7 +20523,7 @@ pub mod gateway { } } } - pub mod regenerate_key { + pub mod purge { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -20418,13 +20543,12 @@ pub mod gateway { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) parameters: models::GatewayKeyRegenerationRequestContract, pub(crate) subscription_id: String, + pub(crate) location: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -20434,14 +20558,13 @@ pub mod gateway { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/regenerateKey", + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/locations/{}/deletedservices/{}", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id + &this.location, + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -20450,9 +20573,8 @@ pub mod gateway { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -20460,13 +20582,23 @@ pub mod gateway { } } } - pub mod generate_token { +} +pub mod api_management_operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available REST API operations of the Microsoft.ApiManagement provider."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayTokenContract = serde_json::from_slice(&bytes)?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20503,204 +20635,99 @@ pub mod gateway { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) parameters: models::GatewayTokenRequestContract, - pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/generateToken", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.gateway_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod gateway_hostname_configuration { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the collection of hostname configurations for the specified gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - } - } - #[doc = "Get details of a hostname configuration"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - hc_id: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - hc_id: hc_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates of updates hostname configuration for a Gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - hc_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - hc_id: hc_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Deletes the specified hostname configuration from the specified Gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - hc_id: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - hc_id: hc_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.ApiManagement/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } - #[doc = "Checks that hostname configuration entity specified by identifier exists for specified Gateway entity."] + } +} +pub mod api_management_service_skus { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets available SKUs for API Management service"] + #[doc = "Gets all available SKU for a given API Management service"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_available_service_skus( &self, resource_group_name: impl Into, service_name: impl Into, - gateway_id: impl Into, - hc_id: impl Into, subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { + ) -> list_available_service_skus::RequestBuilder { + list_available_service_skus::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - gateway_id: gateway_id.into(), - hc_id: hc_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list_by_service { + pub mod list_available_service_skus { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayHostnameConfigurationCollection = serde_json::from_slice(&bytes)?; + let body: models::ResourceSkuResults = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20739,33 +20766,20 @@ pub mod gateway_hostname_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| hostname | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/skus", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -20782,7 +20796,7 @@ pub mod gateway_hostname_configuration { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -20798,16 +20812,7 @@ pub mod gateway_hostname_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -20827,13 +20832,258 @@ pub mod gateway_hostname_configuration { } } } - pub mod get { +} +pub mod api_management_service { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Parameters supplied to the Restore API Management service from backup operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn restore( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> restore::RequestBuilder { + restore::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Parameters supplied to the ApiManagementService_Backup operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn backup( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> backup::RequestBuilder { + backup::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets an API Management service resource description."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates an API Management service. This is long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate API Management service operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Updates an existing API Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate API Management service operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes an existing API Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. This change is not reversible. This is long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn migrate_to_stv2( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> migrate_to_stv2::RequestBuilder { + migrate_to_stv2::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List all API Management services within a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_resource_group( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all API Management services within an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_sso_token( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get_sso_token::RequestBuilder { + get_sso_token::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Checks availability and correctness of a name for an API Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `parameters`: Parameters supplied to the CheckNameAvailability operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_name_availability( + &self, + parameters: impl Into, + subscription_id: impl Into, + ) -> check_name_availability::RequestBuilder { + check_name_availability::RequestBuilder { + client: self.0.clone(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the custom domain ownership identifier for an API Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_domain_ownership_identifier( + &self, + subscription_id: impl Into, + ) -> get_domain_ownership_identifier::RequestBuilder { + get_domain_ownership_identifier::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn apply_network_configuration_updates( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> apply_network_configuration_updates::RequestBuilder { + apply_network_configuration_updates::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + parameters: None, + } + } + } + pub mod restore { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayHostnameConfigurationContract = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20858,9 +21108,8 @@ pub mod gateway_hostname_configuration { } pub struct Headers<'a>(&'a azure_core::headers::Headers); impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) } } #[derive(Clone)] @@ -20882,11 +21131,11 @@ pub mod gateway_hostname_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) hc_id: String, + pub(crate) parameters: models::ApiManagementServiceBackupRestoreParameters, pub(crate) subscription_id: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -20895,8 +21144,14 @@ pub mod gateway_hostname_configuration { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/restore", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -20905,8 +21160,9 @@ pub mod gateway_hostname_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -20914,8 +21170,8 @@ pub mod gateway_hostname_configuration { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -20926,13 +21182,13 @@ pub mod gateway_hostname_configuration { } } } - pub mod create_or_update { + pub mod backup { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayHostnameConfigurationContract = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -20957,9 +21213,8 @@ pub mod gateway_hostname_configuration { } pub struct Headers<'a>(&'a azure_core::headers::Headers); impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) } } #[derive(Clone)] @@ -20981,18 +21236,11 @@ pub mod gateway_hostname_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) hc_id: String, - pub(crate) parameters: models::GatewayHostnameConfigurationContract, + pub(crate) parameters: models::ApiManagementServiceBackupRestoreParameters, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -21001,8 +21249,14 @@ pub mod gateway_hostname_configuration { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/backup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -21011,10 +21265,7 @@ pub mod gateway_hostname_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -21024,8 +21275,8 @@ pub mod gateway_hostname_configuration { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -21036,9 +21287,32 @@ pub mod gateway_hostname_configuration { } } } - pub mod delete { + pub mod get { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -21058,9 +21332,6 @@ pub mod gateway_hostname_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) hc_id: String, - pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -21072,8 +21343,14 @@ pub mod gateway_hostname_configuration { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -21082,8 +21359,7 @@ pub mod gateway_hostname_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -21091,175 +21367,26 @@ pub mod gateway_hostname_configuration { }) } } - } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) hc_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod gateway_api { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists a collection of the APIs associated with a gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - } - } - #[doc = "Adds an API to the specified Gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), - parameters: None, - } - } - #[doc = "Deletes the specified API from the specified Gateway."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Checks that API entity specified by identifier is associated with the Gateway entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_service { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiCollection = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21298,108 +21425,64 @@ pub mod gateway_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, + pub(crate) parameters: models::ApiManagementServiceResource, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.gateway_id + &this.service_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod create_or_update { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiContract = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21408,6 +21491,9 @@ pub mod gateway_api { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21419,6 +21505,13 @@ pub mod gateway_api { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Location header"] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -21438,16 +21531,11 @@ pub mod gateway_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) api_id: String, + pub(crate) parameters: models::ApiManagementServiceUpdateParameters, pub(crate) subscription_id: String, - pub(crate) parameters: Option, } impl RequestBuilder { - pub fn parameters(mut self, parameters: impl Into) -> Self { - self.parameters = Some(parameters.into()); - self - } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -21457,15 +21545,13 @@ pub mod gateway_api { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.gateway_id, - &this.api_id + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -21474,13 +21560,9 @@ pub mod gateway_api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = if let Some(parameters) = &this.parameters { - req.insert_header("content-type", "application/json"); - azure_core::to_json(parameters)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -21488,8 +21570,8 @@ pub mod gateway_api { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -21522,11 +21604,10 @@ pub mod gateway_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) api_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -21536,13 +21617,11 @@ pub mod gateway_api { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.gateway_id, - &this.api_id + &this.service_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -21553,7 +21632,7 @@ pub mod gateway_api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -21562,9 +21641,41 @@ pub mod gateway_api { } } } - pub mod get_entity_tag { + pub mod migrate_to_stv2 { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -21584,11 +21695,10 @@ pub mod gateway_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) api_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -21598,15 +21708,13 @@ pub mod gateway_api { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/migrateToStv2", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.gateway_id, - &this.api_id + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -21615,159 +21723,144 @@ pub mod gateway_api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - } -} -pub mod gateway_certificate_authority { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the collection of Certificate Authorities for the specified Gateway entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } - #[doc = "Get assigned Gateway Certificate Authority details."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - certificate_id: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - certificate_id: certificate_id.into(), - subscription_id: subscription_id.into(), + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiManagementServiceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "Assign Certificate entity to Gateway entity as Certificate Authority."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - certificate_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - certificate_id: certificate_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Remove relationship between Certificate Authority and Gateway entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - certificate_id: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - certificate_id: certificate_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Checks if Certificate entity is assigned to Gateway entity as Certificate Authority."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] - #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - gateway_id: impl Into, - certificate_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - gateway_id: gateway_id.into(), - certificate_id: certificate_id.into(), - subscription_id: subscription_id.into(), + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } - pub mod list_by_service { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayCertificateAuthorityCollection = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21804,35 +21897,18 @@ pub mod gateway_certificate_authority { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) gateway_id: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | eq, ne | |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/service", + this.client.endpoint(), + &this.subscription_id + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -21849,7 +21925,7 @@ pub mod gateway_certificate_authority { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -21865,16 +21941,7 @@ pub mod gateway_certificate_authority { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -21894,13 +21961,13 @@ pub mod gateway_certificate_authority { } } } - pub mod get { + pub mod get_sso_token { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayCertificateAuthorityContract = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceGetSsoTokenResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -21909,9 +21976,6 @@ pub mod gateway_certificate_authority { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -21923,13 +21987,6 @@ pub mod gateway_certificate_authority { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -21949,8 +22006,6 @@ pub mod gateway_certificate_authority { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) certificate_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -21962,8 +22017,14 @@ pub mod gateway_certificate_authority { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/getssotoken", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -21972,8 +22033,9 @@ pub mod gateway_certificate_authority { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -21981,8 +22043,8 @@ pub mod gateway_certificate_authority { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -21993,13 +22055,13 @@ pub mod gateway_certificate_authority { } } } - pub mod create_or_update { + pub mod check_name_availability { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GatewayCertificateAuthorityContract = serde_json::from_slice(&bytes)?; + let body: models::ApiManagementServiceNameAvailabilityResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22008,9 +22070,6 @@ pub mod gateway_certificate_authority { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -22022,13 +22081,6 @@ pub mod gateway_certificate_authority { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -22046,20 +22098,10 @@ pub mod gateway_certificate_authority { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) certificate_id: String, - pub(crate) parameters: models::GatewayCertificateAuthorityContract, + pub(crate) parameters: models::ApiManagementServiceCheckNameAvailabilityParameters, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -22068,8 +22110,12 @@ pub mod gateway_certificate_authority { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/checkNameAvailability", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -22078,10 +22124,7 @@ pub mod gateway_certificate_authority { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -22091,8 +22134,8 @@ pub mod gateway_certificate_authority { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22103,9 +22146,32 @@ pub mod gateway_certificate_authority { } } } - pub mod delete { + pub mod get_domain_ownership_identifier { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiManagementServiceGetDomainOwnershipIdentifierResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -22123,11 +22189,6 @@ pub mod gateway_certificate_authority { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) certificate_id: String, - pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -22139,8 +22200,12 @@ pub mod gateway_certificate_authority { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -22149,19 +22214,64 @@ pub mod gateway_certificate_authority { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = + futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_entity_tag { + pub mod apply_network_configuration_updates { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiManagementServiceResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -22181,11 +22291,16 @@ pub mod gateway_certificate_authority { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) gateway_id: String, - pub(crate) certificate_id: String, pub(crate) subscription_id: String, + pub(crate) parameters: Option, } impl RequestBuilder { + #[doc = "Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which the Api Management service is deployed will be updated sequentially without incurring downtime in the region."] + pub fn parameters(mut self, parameters: impl Into) -> Self { + self.parameters = Some(parameters.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -22194,8 +22309,8 @@ pub mod gateway_certificate_authority { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/applynetworkconfigurationupdates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -22204,26 +22319,43 @@ pub mod gateway_certificate_authority { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = if let Some(parameters) = &this.parameters { + req.insert_header("content-type", "application/json"); + azure_core::to_json(parameters)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod group { +pub mod diagnostic { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of groups defined within a service instance."] + #[doc = "Lists all diagnostics of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -22240,69 +22372,69 @@ pub mod group { skip: None, } } - #[doc = "Gets the details of the group specified by its identifier."] + #[doc = "Gets the details of the Diagnostic specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, + diagnostic_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), + diagnostic_id: diagnostic_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or Updates a group."] + #[doc = "Creates a new Diagnostic or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, - parameters: impl Into, + diagnostic_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), + diagnostic_id: diagnostic_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the details of the group specified by its identifier."] + #[doc = "Updates the details of the Diagnostic specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Update parameters."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Diagnostic Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, - parameters: impl Into, + diagnostic_id: impl Into, + parameters: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { @@ -22310,25 +22442,25 @@ pub mod group { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), + diagnostic_id: diagnostic_id.into(), parameters: parameters.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes specific group of the API Management service instance."] + #[doc = "Deletes the specified Diagnostic."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, + diagnostic_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -22336,30 +22468,30 @@ pub mod group { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), + diagnostic_id: diagnostic_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the group specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the Diagnostic specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `diagnostic_id`: Diagnostic identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, + diagnostic_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), + diagnostic_id: diagnostic_id.into(), subscription_id: subscription_id.into(), } } @@ -22368,9 +22500,9 @@ pub mod group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GroupCollection = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22415,7 +22547,7 @@ pub mod group { pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -22430,12 +22562,12 @@ pub mod group { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -22457,7 +22589,7 @@ pub mod group { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -22473,7 +22605,7 @@ pub mod group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -22506,9 +22638,9 @@ pub mod group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GroupContract = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22557,7 +22689,7 @@ pub mod group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, + pub(crate) diagnostic_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -22570,12 +22702,12 @@ pub mod group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id + &this.diagnostic_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -22586,7 +22718,7 @@ pub mod group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -22595,8 +22727,8 @@ pub mod group { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22611,9 +22743,9 @@ pub mod group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GroupContract = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22662,8 +22794,8 @@ pub mod group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, - pub(crate) parameters: models::GroupCreateParameters, + pub(crate) diagnostic_id: String, + pub(crate) parameters: models::DiagnosticContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -22682,12 +22814,12 @@ pub mod group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id + &this.diagnostic_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -22698,7 +22830,7 @@ pub mod group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -22711,8 +22843,8 @@ pub mod group { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22727,9 +22859,9 @@ pub mod group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GroupContract = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -22778,8 +22910,8 @@ pub mod group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, - pub(crate) parameters: models::GroupUpdateParameters, + pub(crate) diagnostic_id: String, + pub(crate) parameters: models::DiagnosticContract, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -22793,12 +22925,12 @@ pub mod group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id + &this.diagnostic_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -22809,7 +22941,7 @@ pub mod group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -22820,8 +22952,8 @@ pub mod group { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -22854,7 +22986,7 @@ pub mod group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, + pub(crate) diagnostic_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -22868,12 +23000,12 @@ pub mod group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id + &this.diagnostic_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -22884,7 +23016,7 @@ pub mod group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -22916,7 +23048,7 @@ pub mod group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, + pub(crate) diagnostic_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -22929,12 +23061,12 @@ pub mod group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/diagnostics/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id + &this.diagnostic_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -22945,7 +23077,7 @@ pub mod group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -22955,118 +23087,163 @@ pub mod group { } } } -pub mod group_user { +pub mod documentation { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of user entities associated with the group."] + #[doc = "Lists all Documentations of the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Add existing user to existing group"] + #[doc = "Gets the details of the Documentation specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create( + #[doc = "* `documentation_id`: Documentation identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, - user_id: impl Into, + documentation_id: impl Into, subscription_id: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), - user_id: user_id.into(), + documentation_id: documentation_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Remove existing user from existing group."] + #[doc = "Creates a new Documentation or updates an existing one."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `documentation_id`: Documentation identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + documentation_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + documentation_id: documentation_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the Documentation for an API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `documentation_id`: Documentation identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Documentation Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + documentation_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + documentation_id: documentation_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified Documentation from an API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `documentation_id`: Documentation identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, - user_id: impl Into, + documentation_id: impl Into, + if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), - user_id: user_id.into(), + documentation_id: documentation_id.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Checks that user entity specified by identifier is associated with the group entity."] + #[doc = "Gets the entity state (Etag) version of the Documentation by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_entity_exists( + #[doc = "* `documentation_id`: Documentation identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - group_id: impl Into, - user_id: impl Into, + documentation_id: impl Into, subscription_id: impl Into, - ) -> check_entity_exists::RequestBuilder { - check_entity_exists::RequestBuilder { + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - group_id: group_id.into(), - user_id: user_id.into(), + documentation_id: documentation_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserCollection = serde_json::from_slice(&bytes)?; + let body: models::DocumentationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23105,14 +23282,13 @@ pub mod group_user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | eq | contains |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -23127,17 +23303,16 @@ pub mod group_user { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/documentations", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.group_id + &this.service_name ))?; let rsp = match continuation { Some(value) => { @@ -23155,7 +23330,7 @@ pub mod group_user { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -23171,7 +23346,7 @@ pub mod group_user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -23200,13 +23375,13 @@ pub mod group_user { } } } - pub mod create { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserContract = serde_json::from_slice(&bytes)?; + let body: models::DocumentationContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23215,6 +23390,9 @@ pub mod group_user { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -23226,6 +23404,13 @@ pub mod group_user { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -23245,8 +23430,7 @@ pub mod group_user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, - pub(crate) user_id: String, + pub(crate) documentation_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -23259,15 +23443,14 @@ pub mod group_user { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/documentations/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id, - &this.user_id + &this.documentation_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -23276,7 +23459,7 @@ pub mod group_user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -23285,8 +23468,233 @@ pub mod group_user { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DocumentationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) documentation_id: String, + pub(crate) parameters: models::DocumentationContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/documentations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.documentation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DocumentationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) documentation_id: String, + pub(crate) parameters: models::DocumentationUpdateContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/documentations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.documentation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -23319,8 +23727,8 @@ pub mod group_user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, - pub(crate) user_id: String, + pub(crate) documentation_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -23333,13 +23741,12 @@ pub mod group_user { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/documentations/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id, - &this.user_id + &this.documentation_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -23350,7 +23757,8 @@ pub mod group_user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -23359,7 +23767,7 @@ pub mod group_user { } } } - pub mod check_entity_exists { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -23381,8 +23789,7 @@ pub mod group_user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) group_id: String, - pub(crate) user_id: String, + pub(crate) documentation_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -23395,13 +23802,12 @@ pub mod group_user { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/documentations/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.group_id, - &this.user_id + &this.documentation_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -23412,7 +23818,7 @@ pub mod group_user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -23422,16 +23828,16 @@ pub mod group_user { } } } -pub mod identity_provider { +pub mod email_template { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of Identity Provider configured in the specified service instance."] + #[doc = "Gets all email templates"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -23443,97 +23849,100 @@ pub mod identity_provider { resource_group_name: resource_group_name.into(), service_name: service_name.into(), subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, } } - #[doc = "Gets the configuration details of the identity Provider configured in specified service instance."] + #[doc = "Gets the details of the email template specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `template_name`: Email Template Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - identity_provider_name: impl Into, + template_name: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - identity_provider_name: identity_provider_name.into(), + template_name: template_name.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or Updates the IdentityProvider configuration."] + #[doc = "Updates an Email Template."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `template_name`: Email Template Name Identifier."] + #[doc = "* `parameters`: Email Template update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - identity_provider_name: impl Into, - parameters: impl Into, + template_name: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - identity_provider_name: identity_provider_name.into(), + template_name: template_name.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates an existing IdentityProvider configuration."] + #[doc = "Updates API Management email template"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] - #[doc = "* `parameters`: Update parameters."] + #[doc = "* `template_name`: Email Template Name Identifier."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - identity_provider_name: impl Into, - parameters: impl Into, + template_name: impl Into, if_match: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - identity_provider_name: identity_provider_name.into(), - parameters: parameters.into(), + template_name: template_name.into(), if_match: if_match.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes the specified identity provider configuration."] + #[doc = "Reset the Email Template to default template provided by the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] + #[doc = "* `template_name`: Email Template Name Identifier."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - identity_provider_name: impl Into, + template_name: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -23541,52 +23950,30 @@ pub mod identity_provider { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - identity_provider_name: identity_provider_name.into(), + template_name: template_name.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the identityProvider specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the email template specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `template_name`: Email Template Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - identity_provider_name: impl Into, + template_name: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - identity_provider_name: identity_provider_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the client secret details of the Identity Provider."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_secrets( - &self, - resource_group_name: impl Into, - service_name: impl Into, - identity_provider_name: impl Into, - subscription_id: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - identity_provider_name: identity_provider_name.into(), + template_name: template_name.into(), subscription_id: subscription_id.into(), } } @@ -23595,9 +23982,9 @@ pub mod identity_provider { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IdentityProviderList = serde_json::from_slice(&bytes)?; + let body: models::EmailTemplateCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23637,14 +24024,32 @@ pub mod identity_provider { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -23666,7 +24071,7 @@ pub mod identity_provider { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -23682,7 +24087,16 @@ pub mod identity_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -23706,9 +24120,9 @@ pub mod identity_provider { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IdentityProviderContract = serde_json::from_slice(&bytes)?; + let body: models::EmailTemplateContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23757,7 +24171,7 @@ pub mod identity_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) identity_provider_name: String, + pub(crate) template_name: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -23770,12 +24184,12 @@ pub mod identity_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.identity_provider_name + &this.template_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -23786,7 +24200,7 @@ pub mod identity_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -23795,8 +24209,8 @@ pub mod identity_provider { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -23811,9 +24225,9 @@ pub mod identity_provider { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IdentityProviderContract = serde_json::from_slice(&bytes)?; + let body: models::EmailTemplateContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23822,9 +24236,6 @@ pub mod identity_provider { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -23836,13 +24247,6 @@ pub mod identity_provider { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -23862,8 +24266,8 @@ pub mod identity_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) identity_provider_name: String, - pub(crate) parameters: models::IdentityProviderCreateContract, + pub(crate) template_name: String, + pub(crate) parameters: models::EmailTemplateUpdateParameters, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -23882,12 +24286,12 @@ pub mod identity_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.identity_provider_name + &this.template_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -23898,7 +24302,7 @@ pub mod identity_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -23911,8 +24315,8 @@ pub mod identity_provider { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -23927,9 +24331,9 @@ pub mod identity_provider { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IdentityProviderContract = serde_json::from_slice(&bytes)?; + let body: models::EmailTemplateContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -23978,9 +24382,9 @@ pub mod identity_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) identity_provider_name: String, - pub(crate) parameters: models::IdentityProviderUpdateParameters, + pub(crate) template_name: String, pub(crate) if_match: String, + pub(crate) parameters: models::EmailTemplateUpdateParameters, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -23993,12 +24397,12 @@ pub mod identity_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.identity_provider_name + &this.template_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -24009,10 +24413,10 @@ pub mod identity_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -24020,8 +24424,8 @@ pub mod identity_provider { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -24054,7 +24458,7 @@ pub mod identity_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) identity_provider_name: String, + pub(crate) template_name: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -24068,12 +24472,12 @@ pub mod identity_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.identity_provider_name + &this.template_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -24084,7 +24488,7 @@ pub mod identity_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -24116,7 +24520,7 @@ pub mod identity_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) identity_provider_name: String, + pub(crate) template_name: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -24129,12 +24533,12 @@ pub mod identity_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/templates/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.identity_provider_name + &this.template_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -24145,125 +24549,26 @@ pub mod identity_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod list_secrets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ClientSecretContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) identity_provider_name: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . identity_provider_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod issue { +pub mod gateway { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of issues in the specified service instance."] + #[doc = "Lists a collection of gateways registered with service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -24280,25 +24585,194 @@ pub mod issue { skip: None, } } - #[doc = "Gets API Management issue details"] + #[doc = "Gets the details of the Gateway specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - issue_id: impl Into, + gateway_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - issue_id: issue_id.into(), + gateway_id: gateway_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates a Gateway to be used in Api Management instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the gateway specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific Gateway."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Gateway specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Retrieves gateway keys."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_keys( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + subscription_id: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Regenerates specified gateway key invalidating any tokens created with it."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn regenerate_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the Shared Access Authorization Token for the gateway."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn generate_token( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> generate_token::RequestBuilder { + generate_token::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), } } @@ -24307,9 +24781,9 @@ pub mod issue { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueCollection = serde_json::from_slice(&bytes)?; + let body: models::GatewayCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -24354,7 +24828,7 @@ pub mod issue { pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| region | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -24369,12 +24843,12 @@ pub mod issue { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/issues", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -24396,7 +24870,7 @@ pub mod issue { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -24412,7 +24886,7 @@ pub mod issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -24445,9 +24919,9 @@ pub mod issue { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IssueContract = serde_json::from_slice(&bytes)?; + let body: models::GatewayContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -24496,7 +24970,7 @@ pub mod issue { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) issue_id: String, + pub(crate) gateway_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -24509,12 +24983,12 @@ pub mod issue { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/issues/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.issue_id + &this.gateway_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -24525,7 +24999,7 @@ pub mod issue { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -24534,8 +25008,8 @@ pub mod issue { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -24546,164 +25020,13 @@ pub mod issue { } } } -} -pub mod logger { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists a collection of loggers in the specified service instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - } - } - #[doc = "Gets the details of the logger specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - logger_id: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - logger_id: logger_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates or Updates a logger."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - logger_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - logger_id: logger_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Updates an existing logger."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - logger_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - logger_id: logger_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes the specified logger."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - logger_id: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - logger_id: logger_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the entity state (Etag) version of the logger specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - logger_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - logger_id: logger_id.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list_by_service { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LoggerCollection = serde_json::from_slice(&bytes)?; + let body: models::GatewayContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -24712,6 +25035,9 @@ pub mod logger { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -24723,6 +25049,13 @@ pub mod logger { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -24742,106 +25075,74 @@ pub mod logger { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) gateway_id: String, + pub(crate) parameters: models::GatewayContract, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.gateway_id ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LoggerContract = serde_json::from_slice(&bytes)?; + let body: models::GatewayContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -24890,7 +25191,9 @@ pub mod logger { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) logger_id: String, + pub(crate) gateway_id: String, + pub(crate) parameters: models::GatewayContract, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -24903,14 +25206,14 @@ pub mod logger { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.logger_id + &this.gateway_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -24919,8 +25222,10 @@ pub mod logger { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -24928,8 +25233,8 @@ pub mod logger { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -24940,42 +25245,9 @@ pub mod logger { } } } - pub mod create_or_update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::LoggerContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -24995,17 +25267,11 @@ pub mod logger { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) logger_id: String, - pub(crate) parameters: models::LoggerContract, + pub(crate) gateway_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -25015,14 +25281,14 @@ pub mod logger { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.logger_id + &this.gateway_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -25031,38 +25297,83 @@ pub mod logger { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) gateway_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.gateway_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } } - pub mod update { + pub mod list_keys { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::LoggerContract = serde_json::from_slice(&bytes)?; + let body: models::GatewayKeysContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -25111,9 +25422,7 @@ pub mod logger { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) logger_id: String, - pub(crate) parameters: models::LoggerUpdateContract, - pub(crate) if_match: String, + pub(crate) gateway_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -25126,14 +25435,14 @@ pub mod logger { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/listKeys", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.logger_id + &this.gateway_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -25142,10 +25451,9 @@ pub mod logger { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -25153,8 +25461,8 @@ pub mod logger { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -25165,7 +25473,7 @@ pub mod logger { } } } - pub mod delete { + pub mod regenerate_key { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -25187,8 +25495,8 @@ pub mod logger { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) logger_id: String, - pub(crate) if_match: String, + pub(crate) gateway_id: String, + pub(crate) parameters: models::GatewayKeyRegenerationRequestContract, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -25201,14 +25509,14 @@ pub mod logger { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/regenerateKey", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.logger_id + &this.gateway_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -25217,9 +25525,9 @@ pub mod logger { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -25227,9 +25535,32 @@ pub mod logger { } } } - pub mod get_entity_tag { + pub mod generate_token { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GatewayTokenContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -25249,7 +25580,8 @@ pub mod logger { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) logger_id: String, + pub(crate) gateway_id: String, + pub(crate) parameters: models::GatewayTokenRequestContract, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -25262,14 +25594,14 @@ pub mod logger { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/generateToken", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.logger_id + &this.gateway_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -25278,132 +25610,126 @@ pub mod logger { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod named_value { +pub mod gateway_hostname_configuration { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of named values defined within a service instance."] + #[doc = "Lists the collection of hostname configurations for the specified gateway."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, + gateway_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + gateway_id: gateway_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, - is_key_vault_refresh_failed: None, } } - #[doc = "Gets the details of the named value specified by its identifier."] + #[doc = "Get details of a hostname configuration"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - named_value_id: impl Into, + gateway_id: impl Into, + hc_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - named_value_id: named_value_id.into(), + gateway_id: gateway_id.into(), + hc_id: hc_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates named value."] + #[doc = "Creates of updates hostname configuration for a Gateway."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - named_value_id: impl Into, - parameters: impl Into, + gateway_id: impl Into, + hc_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - named_value_id: named_value_id.into(), + gateway_id: gateway_id.into(), + hc_id: hc_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Updates the specific named value."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - named_value_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - named_value_id: named_value_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes specific named value from the API Management service instance."] + #[doc = "Deletes the specified hostname configuration from the specified Gateway."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - named_value_id: impl Into, + gateway_id: impl Into, + hc_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -25411,74 +25737,34 @@ pub mod named_value { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - named_value_id: named_value_id.into(), + gateway_id: gateway_id.into(), + hc_id: hc_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the named value specified by its identifier."] + #[doc = "Checks that hostname configuration entity specified by identifier exists for specified Gateway entity."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `hc_id`: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - named_value_id: impl Into, + gateway_id: impl Into, + hc_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - named_value_id: named_value_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the secret of the named value specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_value( - &self, - resource_group_name: impl Into, - service_name: impl Into, - named_value_id: impl Into, - subscription_id: impl Into, - ) -> list_value::RequestBuilder { - list_value::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - named_value_id: named_value_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Refresh the secret of the named value specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `named_value_id`: Identifier of the NamedValue."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn refresh_secret( - &self, - resource_group_name: impl Into, - service_name: impl Into, - named_value_id: impl Into, - subscription_id: impl Into, - ) -> refresh_secret::RequestBuilder { - refresh_secret::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - named_value_id: named_value_id.into(), + gateway_id: gateway_id.into(), + hc_id: hc_id.into(), subscription_id: subscription_id.into(), } } @@ -25487,9 +25773,9 @@ pub mod named_value { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NamedValueCollection = serde_json::from_slice(&bytes)?; + let body: models::GatewayHostnameConfigurationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -25528,14 +25814,14 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) gateway_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) is_key_vault_refresh_failed: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| hostname | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -25550,22 +25836,11 @@ pub mod named_value { self.skip = Some(skip); self } - #[doc = "When set to true, the response contains only named value entities which failed refresh."] - pub fn is_key_vault_refresh_failed(mut self, is_key_vault_refresh_failed: bool) -> Self { - self.is_key_vault_refresh_failed = Some(is_key_vault_refresh_failed); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -25582,7 +25857,7 @@ pub mod named_value { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -25598,7 +25873,7 @@ pub mod named_value { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -25608,11 +25883,6 @@ pub mod named_value { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } - if let Some(is_key_vault_refresh_failed) = &this.is_key_vault_refresh_failed { - req.url_mut() - .query_pairs_mut() - .append_pair("isKeyVaultRefreshFailed", &is_key_vault_refresh_failed.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -25636,9 +25906,9 @@ pub mod named_value { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NamedValueContract = serde_json::from_slice(&bytes)?; + let body: models::GatewayHostnameConfigurationContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -25687,7 +25957,8 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, + pub(crate) gateway_id: String, + pub(crate) hc_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -25699,14 +25970,7 @@ pub mod named_value { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.named_value_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -25716,7 +25980,7 @@ pub mod named_value { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -25725,8 +25989,8 @@ pub mod named_value { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -25740,6 +26004,39 @@ pub mod named_value { pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GatewayHostnameConfigurationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -25759,8 +26056,9 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, - pub(crate) parameters: models::NamedValueCreateContract, + pub(crate) gateway_id: String, + pub(crate) hc_id: String, + pub(crate) parameters: models::GatewayHostnameConfigurationContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -25770,7 +26068,6 @@ pub mod named_value { self.if_match = Some(if_match.into()); self } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -25779,14 +26076,7 @@ pub mod named_value { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.named_value_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -25796,20 +26086,32 @@ pub mod named_value { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(if_match) = &this.if_match { req.insert_header("if-match", if_match); } + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -25831,13 +26133,12 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, - pub(crate) parameters: models::NamedValueUpdateParameters, + pub(crate) gateway_id: String, + pub(crate) hc_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -25846,15 +26147,8 @@ pub mod named_value { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.named_value_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -25863,10 +26157,9 @@ pub mod named_value { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -25874,7 +26167,7 @@ pub mod named_value { } } } - pub mod delete { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -25896,8 +26189,8 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, - pub(crate) if_match: String, + pub(crate) gateway_id: String, + pub(crate) hc_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -25909,15 +26202,8 @@ pub mod named_value { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.named_value_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/hostnameConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . hc_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -25926,8 +26212,7 @@ pub mod named_value { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -25936,9 +26221,139 @@ pub mod named_value { } } } - pub mod get_entity_tag { +} +pub mod gateway_api { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the APIs associated with a gateway."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Adds an API to the specified Gateway."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + parameters: None, + } + } + #[doc = "Deletes the specified API from the specified Gateway."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Checks that API entity specified by identifier is associated with the Gateway entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -25958,51 +26373,108 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, + pub(crate) gateway_id: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.named_value_id + &this.gateway_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod list_value { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NamedValueSecretContract = serde_json::from_slice(&bytes)?; + let body: models::ApiContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26011,9 +26483,6 @@ pub mod named_value { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -26025,13 +26494,6 @@ pub mod named_value { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -26051,10 +26513,16 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, + pub(crate) gateway_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, + pub(crate) parameters: Option, } impl RequestBuilder { + pub fn parameters(mut self, parameters: impl Into) -> Self { + self.parameters = Some(parameters.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -26064,14 +26532,15 @@ pub mod named_value { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}/listValue", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.named_value_id + &this.gateway_id, + &this.api_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -26080,9 +26549,13 @@ pub mod named_value { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = if let Some(parameters) = &this.parameters { + req.insert_header("content-type", "application/json"); + azure_core::to_json(parameters)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -26090,8 +26563,8 @@ pub mod named_value { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -26102,7 +26575,7 @@ pub mod named_value { } } } - pub mod refresh_secret { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -26124,132 +26597,9 @@ pub mod named_value { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) named_value_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}/refreshSecret" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . named_value_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod network_status { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - pub fn list_by_service( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - service_name: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - } - } - #[doc = "Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `location_name`: Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South Central US."] - pub fn list_by_location( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - service_name: impl Into, - location_name: impl Into, - ) -> list_by_location::RequestBuilder { - list_by_location::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - location_name: location_name.into(), - } - } - } - pub mod list_by_service { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result> { - let bytes = self.0.into_body().collect().await?; - let body: Vec = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + pub(crate) gateway_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26261,13 +26611,15 @@ pub mod network_status { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/networkstatus", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.gateway_id, + &this.api_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -26276,7 +26628,7 @@ pub mod network_status { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -26284,45 +26636,10 @@ pub mod network_status { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result>; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod list_by_location { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NetworkStatusContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -26340,10 +26657,11 @@ pub mod network_status { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) location_name: String, + pub(crate) gateway_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -26355,14 +26673,15 @@ pub mod network_status { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/locations/{}/networkstatus", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/apis/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.location_name + &this.gateway_id, + &this.api_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -26371,7 +26690,7 @@ pub mod network_status { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -26379,98 +26698,151 @@ pub mod network_status { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod notification { +pub mod gateway_certificate_authority { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of properties defined within a service instance."] + #[doc = "Lists the collection of Certificate Authorities for the specified Gateway entity."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, + gateway_id: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + gateway_id: gateway_id.into(), subscription_id: subscription_id.into(), + filter: None, top: None, skip: None, } } - #[doc = "Gets the details of the Notification specified by its identifier."] + #[doc = "Get assigned Gateway Certificate Authority details."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - notification_name: impl Into, + gateway_id: impl Into, + certificate_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - notification_name: notification_name.into(), + gateway_id: gateway_id.into(), + certificate_id: certificate_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Create or Update API Management publisher notification."] + #[doc = "Assign Certificate entity to Gateway entity as Certificate Authority."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - notification_name: impl Into, + gateway_id: impl Into, + certificate_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - notification_name: notification_name.into(), + gateway_id: gateway_id.into(), + certificate_id: certificate_id.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - } - pub mod list_by_service { + #[doc = "Remove relationship between Certificate Authority and Gateway entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + certificate_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + certificate_id: certificate_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Checks if Certificate entity is assigned to Gateway entity as Certificate Authority."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `gateway_id`: Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'"] + #[doc = "* `certificate_id`: Identifier of the certificate entity. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + gateway_id: impl Into, + certificate_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + gateway_id: gateway_id.into(), + certificate_id: certificate_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NotificationCollection = serde_json::from_slice(&bytes)?; + let body: models::GatewayCertificateAuthorityCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26509,11 +26881,18 @@ pub mod notification { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) gateway_id: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | eq, ne | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } #[doc = "Number of records to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -26524,17 +26903,11 @@ pub mod notification { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -26551,7 +26924,7 @@ pub mod notification { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -26567,7 +26940,10 @@ pub mod notification { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -26597,9 +26973,9 @@ pub mod notification { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NotificationContract = serde_json::from_slice(&bytes)?; + let body: models::GatewayCertificateAuthorityContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26608,6 +26984,9 @@ pub mod notification { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -26619,6 +26998,13 @@ pub mod notification { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -26638,7 +27024,8 @@ pub mod notification { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, + pub(crate) gateway_id: String, + pub(crate) certificate_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -26650,14 +27037,7 @@ pub mod notification { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.notification_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -26667,7 +27047,7 @@ pub mod notification { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -26676,8 +27056,8 @@ pub mod notification { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -26692,9 +27072,9 @@ pub mod notification { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NotificationContract = serde_json::from_slice(&bytes)?; + let body: models::GatewayCertificateAuthorityContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26703,6 +27083,9 @@ pub mod notification { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -26714,6 +27097,13 @@ pub mod notification { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -26733,7 +27123,9 @@ pub mod notification { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, + pub(crate) gateway_id: String, + pub(crate) certificate_id: String, + pub(crate) parameters: models::GatewayCertificateAuthorityContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -26751,14 +27143,7 @@ pub mod notification { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.notification_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -26768,11 +27153,12 @@ pub mod notification { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(if_match) = &this.if_match { req.insert_header("if-match", if_match); } - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -26780,8 +27166,8 @@ pub mod notification { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -26792,116 +27178,274 @@ pub mod notification { } } } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) gateway_id: String, + pub(crate) certificate_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) gateway_id: String, + pub(crate) certificate_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/gateways/{}/certificateAuthorities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . gateway_id , & this . certificate_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } -pub mod notification_recipient_user { +pub mod group { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets the list of the Notification Recipient User subscribed to the notification."] + #[doc = "Lists a collection of groups defined within a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_notification( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - notification_name: impl Into, subscription_id: impl Into, - ) -> list_by_notification::RequestBuilder { - list_by_notification::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - notification_name: notification_name.into(), subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, } } - #[doc = "Adds the API Management User to the list of Recipients for the Notification."] + #[doc = "Gets the details of the group specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or Updates a group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - notification_name: impl Into, - user_id: impl Into, + group_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - notification_name: notification_name.into(), - user_id: user_id.into(), + group_id: group_id.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), + if_match: None, } } - #[doc = "Removes the API Management user from the list of Notification."] + #[doc = "Updates the details of the group specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + group_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + group_id: group_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific group of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - notification_name: impl Into, - user_id: impl Into, + group_id: impl Into, + if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - notification_name: notification_name.into(), - user_id: user_id.into(), + group_id: group_id.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Determine if the Notification Recipient User is subscribed to the notification."] + #[doc = "Gets the entity state (Etag) version of the group specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_entity_exists( + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - notification_name: impl Into, - user_id: impl Into, + group_id: impl Into, subscription_id: impl Into, - ) -> check_entity_exists::RequestBuilder { - check_entity_exists::RequestBuilder { + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - notification_name: notification_name.into(), - user_id: user_id.into(), + group_id: group_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list_by_notification { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecipientUserCollection = serde_json::from_slice(&bytes)?; + let body: models::GroupCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26940,56 +27484,106 @@ pub mod notification_recipient_user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod create_or_update { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecipientUserContract = serde_json::from_slice(&bytes)?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -26998,6 +27592,9 @@ pub mod notification_recipient_user { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27009,6 +27606,13 @@ pub mod notification_recipient_user { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -27028,8 +27632,7 @@ pub mod notification_recipient_user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, - pub(crate) user_id: String, + pub(crate) group_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -27041,8 +27644,15 @@ pub mod notification_recipient_user { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . user_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -27051,7 +27661,7 @@ pub mod notification_recipient_user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -27060,8 +27670,8 @@ pub mod notification_recipient_user { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -27072,224 +27682,13 @@ pub mod notification_recipient_user { } } } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) notification_name: String, - pub(crate) user_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . user_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod check_entity_exists { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) notification_name: String, - pub(crate) user_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . user_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod notification_recipient_email { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the list of the Notification Recipient Emails subscribed to a notification."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_notification( - &self, - resource_group_name: impl Into, - service_name: impl Into, - notification_name: impl Into, - subscription_id: impl Into, - ) -> list_by_notification::RequestBuilder { - list_by_notification::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - notification_name: notification_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Adds the Email address to the list of Recipients for the Notification."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `email`: Email identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - notification_name: impl Into, - email: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - notification_name: notification_name.into(), - email: email.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Removes the email from the list of Notification."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `email`: Email identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - notification_name: impl Into, - email: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - notification_name: notification_name.into(), - email: email.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Determine if Notification Recipient Email subscribed to the notification."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `notification_name`: Notification Name Identifier."] - #[doc = "* `email`: Email identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_entity_exists( - &self, - resource_group_name: impl Into, - service_name: impl Into, - notification_name: impl Into, - email: impl Into, - subscription_id: impl Into, - ) -> check_entity_exists::RequestBuilder { - check_entity_exists::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - notification_name: notification_name.into(), - email: email.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list_by_notification { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecipientEmailCollection = serde_json::from_slice(&bytes)?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27298,6 +27697,9 @@ pub mod notification_recipient_email { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27309,6 +27711,13 @@ pub mod notification_recipient_email { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -27328,10 +27737,17 @@ pub mod notification_recipient_email { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, + pub(crate) group_id: String, + pub(crate) parameters: models::GroupCreateParameters, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -27340,8 +27756,15 @@ pub mod notification_recipient_email { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -27350,8 +27773,12 @@ pub mod notification_recipient_email { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -27359,8 +27786,8 @@ pub mod notification_recipient_email { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -27371,13 +27798,13 @@ pub mod notification_recipient_email { } } } - pub mod create_or_update { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecipientEmailContract = serde_json::from_slice(&bytes)?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27386,6 +27813,9 @@ pub mod notification_recipient_email { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27397,6 +27827,13 @@ pub mod notification_recipient_email { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -27416,8 +27853,9 @@ pub mod notification_recipient_email { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, - pub(crate) email: String, + pub(crate) group_id: String, + pub(crate) parameters: models::GroupUpdateParameters, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -27429,8 +27867,15 @@ pub mod notification_recipient_email { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . email)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -27439,8 +27884,10 @@ pub mod notification_recipient_email { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -27448,8 +27895,8 @@ pub mod notification_recipient_email { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -27482,8 +27929,8 @@ pub mod notification_recipient_email { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, - pub(crate) email: String, + pub(crate) group_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -27495,7 +27942,14 @@ pub mod notification_recipient_email { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . email)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.group_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -27505,7 +27959,8 @@ pub mod notification_recipient_email { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -27514,7 +27969,7 @@ pub mod notification_recipient_email { } } } - pub mod check_entity_exists { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -27536,8 +27991,7 @@ pub mod notification_recipient_email { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) notification_name: String, - pub(crate) email: String, + pub(crate) group_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -27549,7 +28003,14 @@ pub mod notification_recipient_email { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . email)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.group_id + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -27559,7 +28020,7 @@ pub mod notification_recipient_email { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -27569,185 +28030,118 @@ pub mod notification_recipient_email { } } } -pub mod open_id_connect_provider { +pub mod group_user { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists of all the OpenId Connect Providers."] + #[doc = "Lists a collection of user entities associated with the group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( &self, resource_group_name: impl Into, service_name: impl Into, + group_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + group_id: group_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Gets specific OpenID Connect Provider without secrets."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - opid: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - opid: opid.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates or updates the OpenID Connect Provider."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - opid: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - opid: opid.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Updates the specific OpenID Connect Provider."] + #[doc = "Add existing user to existing group"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create( &self, resource_group_name: impl Into, service_name: impl Into, - opid: impl Into, - parameters: impl Into, - if_match: impl Into, + group_id: impl Into, + user_id: impl Into, subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + ) -> create::RequestBuilder { + create::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - opid: opid.into(), - parameters: parameters.into(), - if_match: if_match.into(), + group_id: group_id.into(), + user_id: user_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Deletes specific OpenID Connect Provider of the API Management service instance."] + #[doc = "Remove existing user from existing group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - opid: impl Into, - if_match: impl Into, + group_id: impl Into, + user_id: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - opid: opid.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - opid: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - opid: opid.into(), + group_id: group_id.into(), + user_id: user_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the client secret details of the OpenID Connect Provider."] + #[doc = "Checks that user entity specified by identifier is associated with the group entity."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_secrets( + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( &self, resource_group_name: impl Into, service_name: impl Into, - opid: impl Into, + group_id: impl Into, + user_id: impl Into, subscription_id: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - opid: opid.into(), + group_id: group_id.into(), + user_id: user_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list_by_service { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OpenIdConnectProviderCollection = serde_json::from_slice(&bytes)?; + let body: models::UserCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27786,13 +28180,14 @@ pub mod open_id_connect_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) group_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -27807,16 +28202,17 @@ pub mod open_id_connect_provider { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.group_id ))?; let rsp = match continuation { Some(value) => { @@ -27834,7 +28230,7 @@ pub mod open_id_connect_provider { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -27850,7 +28246,7 @@ pub mod open_id_connect_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -27879,13 +28275,13 @@ pub mod open_id_connect_provider { } } } - pub mod get { + pub mod create { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OpenidConnectProviderContract = serde_json::from_slice(&bytes)?; + let body: models::UserContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -27894,9 +28290,6 @@ pub mod open_id_connect_provider { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -27908,13 +28301,6 @@ pub mod open_id_connect_provider { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -27934,7 +28320,8 @@ pub mod open_id_connect_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) opid: String, + pub(crate) group_id: String, + pub(crate) user_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -27947,14 +28334,15 @@ pub mod open_id_connect_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.opid + &this.group_id, + &this.user_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -27963,7 +28351,7 @@ pub mod open_id_connect_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -27972,8 +28360,8 @@ pub mod open_id_connect_provider { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -27984,158 +28372,9 @@ pub mod open_id_connect_provider { } } } - pub mod create_or_update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OpenidConnectProviderContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) opid: String, - pub(crate) parameters: models::OpenidConnectProviderContract, - pub(crate) subscription_id: String, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.opid - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OpenidConnectProviderContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -28155,84 +28394,8 @@ pub mod open_id_connect_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) opid: String, - pub(crate) parameters: models::OpenidConnectProviderUpdateContract, - pub(crate) if_match: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.opid - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) opid: String, - pub(crate) if_match: String, + pub(crate) group_id: String, + pub(crate) user_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -28245,12 +28408,13 @@ pub mod open_id_connect_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.opid + &this.group_id, + &this.user_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -28261,8 +28425,7 @@ pub mod open_id_connect_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -28271,7 +28434,7 @@ pub mod open_id_connect_provider { } } } - pub mod get_entity_tag { + pub mod check_entity_exists { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -28293,7 +28456,8 @@ pub mod open_id_connect_provider { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) opid: String, + pub(crate) group_id: String, + pub(crate) user_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -28306,12 +28470,13 @@ pub mod open_id_connect_provider { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/groups/{}/users/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.opid + &this.group_id, + &this.user_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -28322,125 +28487,26 @@ pub mod open_id_connect_provider { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod list_secrets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ClientSecretContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) opid: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . opid)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod policy { +pub mod identity_provider { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all the Global Policy definitions of the Api Management service."] + #[doc = "Lists a collection of Identity Provider configured in the specified service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -28454,68 +28520,95 @@ pub mod policy { subscription_id: subscription_id.into(), } } - #[doc = "Get the Global policy definition of the Api Management service."] + #[doc = "Gets the configuration details of the identity Provider configured in specified service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - policy_id: impl Into, + identity_provider_name: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - policy_id: policy_id.into(), + identity_provider_name: identity_provider_name.into(), subscription_id: subscription_id.into(), - format: None, } } - #[doc = "Creates or updates the global policy configuration of the Api Management service."] + #[doc = "Creates or Updates the IdentityProvider configuration."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `parameters`: The policy contents to apply."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - policy_id: impl Into, - parameters: impl Into, + identity_provider_name: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - policy_id: policy_id.into(), + identity_provider_name: identity_provider_name.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Deletes the global policy configuration of the Api Management Service."] + #[doc = "Updates an existing IdentityProvider configuration."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + identity_provider_name: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + identity_provider_name: identity_provider_name.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified identity provider configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - policy_id: impl Into, + identity_provider_name: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -28523,30 +28616,52 @@ pub mod policy { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - policy_id: policy_id.into(), + identity_provider_name: identity_provider_name.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the Global policy definition in the Api Management service."] + #[doc = "Gets the entity state (Etag) version of the identityProvider specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - policy_id: impl Into, + identity_provider_name: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - policy_id: policy_id.into(), + identity_provider_name: identity_provider_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the client secret details of the Identity Provider."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `identity_provider_name`: Identity Provider Type identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + identity_provider_name: impl Into, + subscription_id: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + identity_provider_name: identity_provider_name.into(), subscription_id: subscription_id.into(), } } @@ -28555,9 +28670,9 @@ pub mod policy { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + let body: models::IdentityProviderList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28599,48 +28714,66 @@ pub mod policy { pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } @@ -28648,9 +28781,9 @@ pub mod policy { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + let body: models::IdentityProviderContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28699,16 +28832,10 @@ pub mod policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) policy_id: String, + pub(crate) identity_provider_name: String, pub(crate) subscription_id: String, - pub(crate) format: Option, } impl RequestBuilder { - #[doc = "Policy Export Format."] - pub fn format(mut self, format: impl Into) -> Self { - self.format = Some(format.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -28718,12 +28845,12 @@ pub mod policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.policy_id + &this.identity_provider_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -28734,10 +28861,7 @@ pub mod policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(format) = &this.format { - req.url_mut().query_pairs_mut().append_pair("format", format); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -28746,8 +28870,8 @@ pub mod policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -28762,9 +28886,9 @@ pub mod policy { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + let body: models::IdentityProviderContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -28789,7 +28913,7 @@ pub mod policy { } pub struct Headers<'a>(&'a azure_core::headers::Headers); impl<'a> Headers<'a> { - #[doc = "Current entity state version"] + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] pub fn e_tag(&self) -> azure_core::Result<&str> { self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) } @@ -28813,8 +28937,8 @@ pub mod policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) policy_id: String, - pub(crate) parameters: models::PolicyContract, + pub(crate) identity_provider_name: String, + pub(crate) parameters: models::IdentityProviderCreateContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -28833,12 +28957,12 @@ pub mod policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.policy_id + &this.identity_provider_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -28849,7 +28973,7 @@ pub mod policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -28862,8 +28986,117 @@ pub mod policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IdentityProviderContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) identity_provider_name: String, + pub(crate) parameters: models::IdentityProviderUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.identity_provider_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -28896,7 +29129,7 @@ pub mod policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) policy_id: String, + pub(crate) identity_provider_name: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -28910,12 +29143,12 @@ pub mod policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.policy_id + &this.identity_provider_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -28926,7 +29159,7 @@ pub mod policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -28958,7 +29191,7 @@ pub mod policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) policy_id: String, + pub(crate) identity_provider_name: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -28971,12 +29204,12 @@ pub mod policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.policy_id + &this.identity_provider_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -28987,7 +29220,7 @@ pub mod policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -28996,39 +29229,13 @@ pub mod policy { } } } -} -pub mod policy_description { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all policy descriptions."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - scope: None, - } - } - } - pub mod list_by_service { + pub mod list_secrets { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyDescriptionCollection = serde_json::from_slice(&bytes)?; + let body: models::ClientSecretContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -29037,6 +29244,9 @@ pub mod policy_description { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -29048,6 +29258,13 @@ pub mod policy_description { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -29067,15 +29284,10 @@ pub mod policy_description { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) identity_provider_name: String, pub(crate) subscription_id: String, - pub(crate) scope: Option, } impl RequestBuilder { - #[doc = "Policy scope."] - pub fn scope(mut self, scope: impl Into) -> Self { - self.scope = Some(scope.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -29084,14 +29296,8 @@ pub mod policy_description { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyDescriptions", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/identityProviders/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . identity_provider_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -29100,11 +29306,9 @@ pub mod policy_description { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(scope) = &this.scope { - req.url_mut().query_pairs_mut().append_pair("scope", scope); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -29112,8 +29316,8 @@ pub mod policy_description { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -29125,16 +29329,16 @@ pub mod policy_description { } } } -pub mod portal_revision { +pub mod issue { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of developer portal revision entities."] + #[doc = "Lists a collection of issues in the specified service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, @@ -29151,98 +29355,25 @@ pub mod portal_revision { skip: None, } } - #[doc = "Gets developer portal revision specified by its identifier."] + #[doc = "Gets API Management issue details"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `issue_id`: Issue identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - portal_revision_id: impl Into, + issue_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - portal_revision_id: portal_revision_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates a new developer portal revision."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - portal_revision_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - portal_revision_id: portal_revision_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Updates the description of specified portal revision or makes it current."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - portal_revision_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - portal_revision_id: portal_revision_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets developer portal revision specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - portal_revision_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - portal_revision_id: portal_revision_id.into(), + issue_id: issue_id.into(), subscription_id: subscription_id.into(), } } @@ -29251,9 +29382,9 @@ pub mod portal_revision { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalRevisionCollection = serde_json::from_slice(&bytes)?; + let body: models::IssueCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -29298,7 +29429,7 @@ pub mod portal_revision { pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Supported operators | Supported functions |\n|-------------|------------------------|-----------------------------------|\n\r\n|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|\n|description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|\n|isCurrent | eq, ne | |\n"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -29313,12 +29444,12 @@ pub mod portal_revision { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/issues", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -29340,7 +29471,7 @@ pub mod portal_revision { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -29356,7 +29487,7 @@ pub mod portal_revision { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -29389,9 +29520,9 @@ pub mod portal_revision { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalRevisionContract = serde_json::from_slice(&bytes)?; + let body: models::IssueContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -29440,7 +29571,7 @@ pub mod portal_revision { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) portal_revision_id: String, + pub(crate) issue_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -29453,12 +29584,12 @@ pub mod portal_revision { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/issues/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.portal_revision_id + &this.issue_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -29469,7 +29600,7 @@ pub mod portal_revision { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -29478,8 +29609,8 @@ pub mod portal_revision { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -29490,9 +29621,183 @@ pub mod portal_revision { } } } - pub mod create_or_update { +} +pub mod logger { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of loggers in the specified service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the details of the logger specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + logger_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + logger_id: logger_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or Updates a logger."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + logger_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + logger_id: logger_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates an existing logger."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + logger_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + logger_id: logger_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified logger."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + logger_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + logger_id: logger_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the logger specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `logger_id`: Logger identifier. Must be unique in the API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + logger_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + logger_id: logger_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LoggerCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -29512,50 +29817,135 @@ pub mod portal_revision { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) portal_revision_id: String, - pub(crate) parameters: models::PortalRevisionContract, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.portal_revision_id + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod update { + pub mod get { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LoggerContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -29575,13 +29965,10 @@ pub mod portal_revision { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) portal_revision_id: String, - pub(crate) parameters: models::PortalRevisionContract, - pub(crate) if_match: String, + pub(crate) logger_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -29591,14 +29978,14 @@ pub mod portal_revision { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.portal_revision_id + &this.logger_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -29607,20 +29994,63 @@ pub mod portal_revision { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_entity_tag { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LoggerContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -29640,10 +30070,17 @@ pub mod portal_revision { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) portal_revision_id: String, + pub(crate) logger_id: String, + pub(crate) parameters: models::LoggerContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -29653,14 +30090,14 @@ pub mod portal_revision { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.portal_revision_id + &this.logger_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -29669,47 +30106,38 @@ pub mod portal_revision { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - } -} -pub mod portal_settings { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists a collection of portalsettings defined within a service instance.."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_service { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalSettingsCollection = serde_json::from_slice(&bytes)?; + let body: models::LoggerContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -29718,6 +30146,9 @@ pub mod portal_settings { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -29729,6 +30160,13 @@ pub mod portal_settings { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -29748,6 +30186,9 @@ pub mod portal_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) logger_id: String, + pub(crate) parameters: models::LoggerUpdateContract, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -29760,13 +30201,14 @@ pub mod portal_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.logger_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -29775,8 +30217,10 @@ pub mod portal_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -29784,8 +30228,8 @@ pub mod portal_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -29796,66 +30240,219 @@ pub mod portal_settings { } } } -} -pub mod sign_in_settings { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get Sign In Settings for the Portal"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) logger_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, } - #[doc = "Create or Update Sign-In settings."] + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.logger_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) logger_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/loggers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.logger_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod named_value { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of named values defined within a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + is_key_vault_refresh_failed: None, + } + } + #[doc = "Gets the details of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates named value."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, + named_value_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + named_value_id: named_value_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Update Sign-In settings."] + #[doc = "Updates the specific named value."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Update Sign-In settings."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `parameters`: Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, + named_value_id: impl Into, + parameters: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { @@ -29863,38 +30460,260 @@ pub mod sign_in_settings { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + named_value_id: named_value_id.into(), parameters: parameters.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the entity state (Etag) version of the SignInSettings."] + #[doc = "Deletes specific named value from the API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + named_value_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + named_value_id: named_value_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, + named_value_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the secret of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_value( + &self, + resource_group_name: impl Into, + service_name: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> list_value::RequestBuilder { + list_value::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Refresh the secret of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn refresh_secret( + &self, + resource_group_name: impl Into, + service_name: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> refresh_secret::RequestBuilder { + refresh_secret::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + named_value_id: named_value_id.into(), subscription_id: subscription_id.into(), } } } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamedValueCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) is_key_vault_refresh_failed: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "When set to true, the response contains only named value entities which failed refresh."] + pub fn is_key_vault_refresh_failed(mut self, is_key_vault_refresh_failed: bool) -> Self { + self.is_key_vault_refresh_failed = Some(is_key_vault_refresh_failed); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(is_key_vault_refresh_failed) = &this.is_key_vault_refresh_failed { + req.url_mut() + .query_pairs_mut() + .append_pair("isKeyVaultRefreshFailed", &is_key_vault_refresh_failed.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalSigninSettings = serde_json::from_slice(&bytes)?; + let body: models::NamedValueContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -29943,6 +30762,7 @@ pub mod sign_in_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) named_value_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -29955,11 +30775,12 @@ pub mod sign_in_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.named_value_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -29970,7 +30791,7 @@ pub mod sign_in_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -29979,8 +30800,8 @@ pub mod sign_in_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -29994,29 +30815,6 @@ pub mod sign_in_settings { pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PortalSigninSettings = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -30036,7 +30834,8 @@ pub mod sign_in_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::PortalSigninSettings, + pub(crate) named_value_id: String, + pub(crate) parameters: models::NamedValueCreateContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -30046,6 +30845,7 @@ pub mod sign_in_settings { self.if_match = Some(if_match.into()); self } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -30055,11 +30855,12 @@ pub mod sign_in_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.named_value_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -30070,7 +30871,7 @@ pub mod sign_in_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { @@ -30082,18 +30883,6 @@ pub mod sign_in_settings { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } pub mod update { use super::models; @@ -30117,11 +30906,13 @@ pub mod sign_in_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::PortalSigninSettings, + pub(crate) named_value_id: String, + pub(crate) parameters: models::NamedValueUpdateParameters, pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -30131,11 +30922,12 @@ pub mod sign_in_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.named_value_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -30146,7 +30938,7 @@ pub mod sign_in_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.insert_header("if-match", &this.if_match); @@ -30157,6 +30949,68 @@ pub mod sign_in_settings { } } } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) named_value_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.named_value_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); @@ -30179,6 +31033,7 @@ pub mod sign_in_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) named_value_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -30191,11 +31046,12 @@ pub mod sign_in_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.named_value_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -30206,7 +31062,7 @@ pub mod sign_in_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -30215,105 +31071,13 @@ pub mod sign_in_settings { } } } -} -pub mod sign_up_settings { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get Sign Up Settings for the Portal"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Create or Update Sign-Up settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Update Sign-Up settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Update Sign-Up settings."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the entity state (Etag) version of the SignUpSettings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod get { + pub mod list_value { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalSignupSettings = serde_json::from_slice(&bytes)?; + let body: models::NamedValueSecretContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -30362,6 +31126,7 @@ pub mod sign_up_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) named_value_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -30374,13 +31139,14 @@ pub mod sign_up_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}/listValue", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.named_value_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -30389,8 +31155,9 @@ pub mod sign_up_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -30398,8 +31165,8 @@ pub mod sign_up_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -30410,32 +31177,9 @@ pub mod sign_up_settings { } } } - pub mod create_or_update { + pub mod refresh_secret { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PortalSignupSettings = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -30455,16 +31199,11 @@ pub mod sign_up_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::PortalSignupSettings, + pub(crate) named_value_id: String, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -30473,14 +31212,8 @@ pub mod sign_up_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/namedValues/{}/refreshSecret" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -30489,34 +31222,89 @@ pub mod sign_up_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod network_status { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + pub fn list_by_service( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + } + } + #[doc = "Gets the Connectivity Status to the external resources on which the Api Management service depends from inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `location_name`: Location in which the API Management service is deployed. This is one of the Azure Regions like West US, East US, South Central US."] + pub fn list_by_location( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + location_name: impl Into, + ) -> list_by_location::RequestBuilder { + list_by_location::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + location_name: location_name.into(), } } } - pub mod update { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result> { + let bytes = self.0.into_body().collect().await?; + let body: Vec = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -30534,11 +31322,9 @@ pub mod sign_up_settings { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::PortalSignupSettings, - pub(crate) if_match: String, - pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -30550,13 +31336,13 @@ pub mod sign_up_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/networkstatus", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -30565,20 +31351,53 @@ pub mod sign_up_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result>; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod get_entity_tag { + pub mod list_by_location { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NetworkStatusContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -30596,9 +31415,10 @@ pub mod sign_up_settings { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) subscription_id: String, + pub(crate) location_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -30610,13 +31430,14 @@ pub mod sign_up_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/locations/{}/networkstatus", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.location_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -30625,7 +31446,7 @@ pub mod sign_up_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -30633,125 +31454,98 @@ pub mod sign_up_settings { }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod delegation_settings { +pub mod notification { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get Delegation Settings for the Portal."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Create or Update Delegation settings."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Update Delegation settings."] + #[doc = "Lists a collection of properties defined within a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Update Delegation settings."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, - if_match: impl Into, subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - parameters: parameters.into(), - if_match: if_match.into(), subscription_id: subscription_id.into(), + top: None, + skip: None, } } - #[doc = "Gets the entity state (Etag) version of the DelegationSettings."] + #[doc = "Gets the details of the Notification specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, + notification_name: impl Into, subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + notification_name: notification_name.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets the secret validation key of the DelegationSettings."] + #[doc = "Create or Update API Management publisher notification."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_secrets( + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, + notification_name: impl Into, subscription_id: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + notification_name: notification_name.into(), subscription_id: subscription_id.into(), + if_match: None, } } } - pub mod get { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalDelegationSettings = serde_json::from_slice(&bytes)?; + let body: models::NotificationCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -30760,9 +31554,6 @@ pub mod delegation_settings { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -30774,13 +31565,6 @@ pub mod delegation_settings { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -30801,60 +31585,96 @@ pub mod delegation_settings { pub(crate) resource_group_name: String, pub(crate) service_name: String, pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod create_or_update { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalDelegationSettings = serde_json::from_slice(&bytes)?; + let body: models::NotificationContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -30893,16 +31713,10 @@ pub mod delegation_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::PortalDelegationSettings, + pub(crate) notification_name: String, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -30912,13 +31726,14 @@ pub mod delegation_settings { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.notification_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -30927,12 +31742,8 @@ pub mod delegation_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -30940,8 +31751,8 @@ pub mod delegation_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -30952,133 +31763,13 @@ pub mod delegation_settings { } } } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) parameters: models::PortalDelegationSettings, - pub(crate) if_match: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod list_secrets { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PortalSettingValidationKeyContract = serde_json::from_slice(&bytes)?; + let body: models::NotificationContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31117,9 +31808,16 @@ pub mod delegation_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) notification_name: String, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -31128,8 +31826,15 @@ pub mod delegation_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.notification_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -31138,9 +31843,11 @@ pub mod delegation_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -31148,8 +31855,8 @@ pub mod delegation_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -31161,189 +31868,115 @@ pub mod delegation_settings { } } } -pub mod product { +pub mod notification_recipient_user { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of products in the specified service instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - expand_groups: None, - tags: None, - } - } - #[doc = "Gets the details of the product specified by its identifier."] + #[doc = "Gets the list of the Notification Recipient User subscribed to the notification."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_notification( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, + notification_name: impl Into, subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + ) -> list_by_notification::RequestBuilder { + list_by_notification::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), + notification_name: notification_name.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or Updates a product."] + #[doc = "Adds the API Management User to the list of Recipients for the Notification."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, - parameters: impl Into, + notification_name: impl Into, + user_id: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Update existing product details."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - parameters: parameters.into(), - if_match: if_match.into(), + notification_name: notification_name.into(), + user_id: user_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Delete product."] + #[doc = "Removes the API Management user from the list of Notification."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, - if_match: impl Into, + notification_name: impl Into, + user_id: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - delete_subscriptions: None, - } - } - #[doc = "Gets the entity state (Etag) version of the product specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), + notification_name: notification_name.into(), + user_id: user_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Lists a collection of products associated with tags."] + #[doc = "Determine if the Notification Recipient User is subscribed to the notification."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_tags( + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( &self, resource_group_name: impl Into, service_name: impl Into, + notification_name: impl Into, + user_id: impl Into, subscription_id: impl Into, - ) -> list_by_tags::RequestBuilder { - list_by_tags::RequestBuilder { + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + notification_name: notification_name.into(), + user_id: user_id.into(), subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - include_not_tagged_products: None, } } } - pub mod list_by_service { + pub mod list_by_notification { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ProductCollection = serde_json::from_slice(&bytes)?; + let body: models::RecipientUserCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31382,126 +32015,56 @@ pub mod product { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) notification_name: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) expand_groups: Option, - pub(crate) tags: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "When set to true, the response contains an array of groups that have visibility to the product. The default is false."] - pub fn expand_groups(mut self, expand_groups: bool) -> Self { - self.expand_groups = Some(expand_groups); - self - } - #[doc = "Products which are part of a specific tag."] - pub fn tags(mut self, tags: impl Into) -> Self { - self.tags = Some(tags.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(expand_groups) = &this.expand_groups { - req.url_mut() - .query_pairs_mut() - .append_pair("expandGroups", &expand_groups.to_string()); - } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ProductContract = serde_json::from_slice(&bytes)?; + let body: models::RecipientUserContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31510,9 +32073,6 @@ pub mod product { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -31524,13 +32084,6 @@ pub mod product { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -31550,7 +32103,8 @@ pub mod product { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, + pub(crate) notification_name: String, + pub(crate) user_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -31562,15 +32116,8 @@ pub mod product { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.product_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -31579,7 +32126,7 @@ pub mod product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -31588,8 +32135,8 @@ pub mod product { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -31600,42 +32147,9 @@ pub mod product { } } } - pub mod create_or_update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ProductContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -31655,17 +32169,65 @@ pub mod product { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) parameters: models::ProductContract, + pub(crate) notification_name: String, + pub(crate) user_id: String, pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } + } + } + pub mod check_entity_exists { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) notification_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -31674,15 +32236,8 @@ pub mod product { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.product_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -31691,12 +32246,187 @@ pub mod product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod notification_recipient_email { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of the Notification Recipient Emails subscribed to a notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_notification( + &self, + resource_group_name: impl Into, + service_name: impl Into, + notification_name: impl Into, + subscription_id: impl Into, + ) -> list_by_notification::RequestBuilder { + list_by_notification::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + notification_name: notification_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds the Email address to the list of Recipients for the Notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `email`: Email identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + notification_name: impl Into, + email: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + notification_name: notification_name.into(), + email: email.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Removes the email from the list of Notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `email`: Email identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + notification_name: impl Into, + email: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + notification_name: notification_name.into(), + email: email.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Determine if Notification Recipient Email subscribed to the notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `email`: Email identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( + &self, + resource_group_name: impl Into, + service_name: impl Into, + notification_name: impl Into, + email: impl Into, + subscription_id: impl Into, + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + notification_name: notification_name.into(), + email: email.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_notification { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RecipientEmailCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) notification_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -31704,8 +32434,8 @@ pub mod product { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -31716,13 +32446,13 @@ pub mod product { } } } - pub mod update { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ProductContract = serde_json::from_slice(&bytes)?; + let body: models::RecipientEmailContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -31731,9 +32461,6 @@ pub mod product { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -31745,13 +32472,6 @@ pub mod product { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -31771,9 +32491,8 @@ pub mod product { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) parameters: models::ProductUpdateParameters, - pub(crate) if_match: String, + pub(crate) notification_name: String, + pub(crate) email: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -31785,15 +32504,8 @@ pub mod product { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.product_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . email)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -31802,10 +32514,8 @@ pub mod product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -31813,8 +32523,8 @@ pub mod product { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -31847,17 +32557,11 @@ pub mod product { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) if_match: String, + pub(crate) notification_name: String, + pub(crate) email: String, pub(crate) subscription_id: String, - pub(crate) delete_subscriptions: Option, } impl RequestBuilder { - #[doc = "Delete existing subscriptions associated with the product or not."] - pub fn delete_subscriptions(mut self, delete_subscriptions: bool) -> Self { - self.delete_subscriptions = Some(delete_subscriptions); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -31866,14 +32570,7 @@ pub mod product { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.product_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . email)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -31883,13 +32580,7 @@ pub mod product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("if-match", &this.if_match); - if let Some(delete_subscriptions) = &this.delete_subscriptions { - req.url_mut() - .query_pairs_mut() - .append_pair("deleteSubscriptions", &delete_subscriptions.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -31898,7 +32589,7 @@ pub mod product { } } } - pub mod get_entity_tag { + pub mod check_entity_exists { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -31920,7 +32611,8 @@ pub mod product { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, + pub(crate) notification_name: String, + pub(crate) email: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -31932,14 +32624,7 @@ pub mod product { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.product_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . notification_name , & this . email)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -31949,7 +32634,7 @@ pub mod product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -31958,13 +32643,186 @@ pub mod product { } } } - pub mod list_by_tags { +} +pub mod open_id_connect_provider { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists of all the OpenId Connect Providers."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets specific OpenID Connect Provider without secrets."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + opid: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + opid: opid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates the OpenID Connect Provider."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + opid: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + opid: opid.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the specific OpenID Connect Provider."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + opid: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + opid: opid.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific OpenID Connect Provider of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + opid: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + opid: opid.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + opid: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + opid: opid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the client secret details of the OpenID Connect Provider."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `opid`: Identifier of the OpenID Connect Provider."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + opid: impl Into, + subscription_id: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + opid: opid.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TagResourceCollection = serde_json::from_slice(&bytes)?; + let body: models::OpenIdConnectProviderCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -32007,10 +32865,9 @@ pub mod product { pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) include_not_tagged_products: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -32025,17 +32882,12 @@ pub mod product { self.skip = Some(skip); self } - #[doc = "Include not tagged Products."] - pub fn include_not_tagged_products(mut self, include_not_tagged_products: bool) -> Self { - self.include_not_tagged_products = Some(include_not_tagged_products); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/productsByTags", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -32057,7 +32909,7 @@ pub mod product { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -32073,7 +32925,7 @@ pub mod product { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -32083,11 +32935,6 @@ pub mod product { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } - if let Some(include_not_tagged_products) = &this.include_not_tagged_products { - req.url_mut() - .query_pairs_mut() - .append_pair("includeNotTaggedProducts", &include_not_tagged_products.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -32107,119 +32954,118 @@ pub mod product { } } } -} -pub mod product_api { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists a collection of the APIs associated with a product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_product( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - subscription_id: impl Into, - ) -> list_by_product::RequestBuilder { - list_by_product::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OpenidConnectProviderContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) } } - #[doc = "Adds an API to the specified product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Deletes the specified API from the specified product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Checks that API entity specified by identifier is associated with the Product entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_entity_exists( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - api_id: impl Into, - subscription_id: impl Into, - ) -> check_entity_exists::RequestBuilder { - check_entity_exists::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - api_id: api_id.into(), - subscription_id: subscription_id.into(), + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) opid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.opid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_product { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiCollection = serde_json::from_slice(&bytes)?; + let body: models::OpenidConnectProviderContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -32228,6 +33074,9 @@ pub mod product_api { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -32239,6 +33088,13 @@ pub mod product_api { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -32258,108 +33114,74 @@ pub mod product_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, + pub(crate) opid: String, + pub(crate) parameters: models::OpenidConnectProviderContract, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id + &this.opid ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod create_or_update { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiContract = serde_json::from_slice(&bytes)?; + let body: models::OpenidConnectProviderContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -32368,6 +33190,9 @@ pub mod product_api { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -32379,6 +33204,13 @@ pub mod product_api { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -32398,8 +33230,9 @@ pub mod product_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) api_id: String, + pub(crate) opid: String, + pub(crate) parameters: models::OpenidConnectProviderUpdateContract, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -32412,15 +33245,14 @@ pub mod product_api { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.api_id + &this.opid ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -32429,8 +33261,10 @@ pub mod product_api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -32438,8 +33272,8 @@ pub mod product_api { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -32472,8 +33306,8 @@ pub mod product_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) api_id: String, + pub(crate) opid: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -32486,13 +33320,12 @@ pub mod product_api { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.api_id + &this.opid ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -32503,7 +33336,8 @@ pub mod product_api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -32512,7 +33346,7 @@ pub mod product_api { } } } - pub mod check_entity_exists { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -32534,8 +33368,7 @@ pub mod product_api { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) api_id: String, + pub(crate) opid: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -32548,13 +33381,12 @@ pub mod product_api { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.api_id + &this.opid ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -32565,7 +33397,7 @@ pub mod product_api { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -32574,119 +33406,13 @@ pub mod product_api { } } } -} -pub mod product_group { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the collection of developer groups associated with the specified product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_product( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - subscription_id: impl Into, - ) -> list_by_product::RequestBuilder { - list_by_product::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - } - } - #[doc = "Adds the association between the specified developer group with the specified product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - group_id: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - group_id: group_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes the association between the specified group and product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - group_id: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - group_id: group_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Checks that Group entity specified by identifier is associated with the Product entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_entity_exists( - &self, - resource_group_name: impl Into, - service_name: impl Into, - product_id: impl Into, - group_id: impl Into, - subscription_id: impl Into, - ) -> check_entity_exists::RequestBuilder { - check_entity_exists::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - product_id: product_id.into(), - group_id: group_id.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list_by_product { + pub mod list_secrets { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GroupCollection = serde_json::from_slice(&bytes)?; + let body: models::ClientSecretContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -32695,6 +33421,9 @@ pub mod product_group { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -32706,6 +33435,13 @@ pub mod product_group { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -32725,39 +33461,341 @@ pub mod product_group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, + pub(crate) opid: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne | |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups", + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/openidConnectProviders/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . opid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod outbound_network_dependencies_endpoints { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the network endpoints of all outbound dependencies of a ApiManagement service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + pub fn list_by_service( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OutboundEnvironmentEndpointList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/outboundNetworkDependenciesEndpoints" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the Global Policy definitions of the Api Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the Global policy definition of the Api Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + format: None, + } + } + #[doc = "Creates or updates the global policy configuration of the Api Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + policy_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + policy_id: policy_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes the global policy configuration of the Api Management Service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + policy_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Global policy definition in the Api Management service."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.product_id + &this.service_name ))?; let rsp = match continuation { Some(value) => { @@ -32775,7 +33813,7 @@ pub mod product_group { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -32791,16 +33829,7 @@ pub mod product_group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -32820,13 +33849,127 @@ pub mod product_group { } } } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + pub(crate) format: Option, + } + impl RequestBuilder { + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GroupContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -32835,6 +33978,9 @@ pub mod product_group { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -32846,6 +33992,13 @@ pub mod product_group { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version"] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -32865,11 +34018,17 @@ pub mod product_group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) group_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -32879,13 +34038,12 @@ pub mod product_group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.group_id + &this.policy_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -32896,8 +34054,12 @@ pub mod product_group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -32905,8 +34067,8 @@ pub mod product_group { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -32939,8 +34101,8 @@ pub mod product_group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) group_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -32953,13 +34115,12 @@ pub mod product_group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.group_id + &this.policy_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -32970,7 +34131,8 @@ pub mod product_group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -32979,7 +34141,7 @@ pub mod product_group { } } } - pub mod check_entity_exists { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -33001,8 +34163,7 @@ pub mod product_group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) group_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -33015,13 +34176,12 @@ pub mod product_group { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policies/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.group_id + &this.policy_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -33032,7 +34192,7 @@ pub mod product_group { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -33042,43 +34202,38 @@ pub mod product_group { } } } -pub mod product_subscriptions { +pub mod policy_description { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists the collection of subscriptions to the specified product."] + #[doc = "Lists all policy descriptions."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, + scope: None, } } } - pub mod list { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyDescriptionCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -33117,198 +34272,153 @@ pub mod product_subscriptions { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, + pub(crate) scope: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | | |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); + #[doc = "Policy scope."] + pub fn scope(mut self, scope: impl Into) -> Self { + self.scope = Some(scope.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/subscriptions", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyDescriptions", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.product_id + &this.service_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(scope) = &this.scope { + req.url_mut().query_pairs_mut().append_pair("scope", scope); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } } -pub mod product_policy { +pub mod policy_fragment { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the policy configuration at the Product level."] + #[doc = "Gets all policy fragments."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_product( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, subscription_id: impl Into, - ) -> list_by_product::RequestBuilder { - list_by_product::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), subscription_id: subscription_id.into(), + filter: None, + orderby: None, + top: None, + skip: None, } } - #[doc = "Get the policy configuration at the Product level."] + #[doc = "Gets a policy fragment."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, - policy_id: impl Into, + id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), - policy_id: policy_id.into(), + id: id.into(), subscription_id: subscription_id.into(), format: None, } } - #[doc = "Creates or updates policy configuration for the Product."] + #[doc = "Creates or updates a policy fragment."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `parameters`: The policy contents to apply."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `parameters`: The policy fragment contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, - policy_id: impl Into, - parameters: impl Into, + id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), - policy_id: policy_id.into(), + id: id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), if_match: None, } } - #[doc = "Deletes the policy configuration at the Product."] + #[doc = "Deletes a policy fragment."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `id`: A resource identifier."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, - policy_id: impl Into, + id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -33316,45 +34426,65 @@ pub mod product_policy { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), - policy_id: policy_id.into(), + id: id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), } } - #[doc = "Get the ETag of the policy configuration at the Product level."] + #[doc = "Gets the entity state (Etag) version of a policy fragment."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] - #[doc = "* `policy_id`: The identifier of the Policy."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - product_id: impl Into, - policy_id: impl Into, + id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - product_id: product_id.into(), - policy_id: policy_id.into(), + id: id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists policy resources that reference the policy fragment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_references( + &self, + resource_group_name: impl Into, + service_name: impl Into, + id: impl Into, + subscription_id: impl Into, + ) -> list_references::RequestBuilder { + list_references::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + id: id.into(), subscription_id: subscription_id.into(), + top: None, + skip: None, } } } - pub mod list_by_product { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyFragmentCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -33393,53 +34523,105 @@ pub mod product_policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyFragments", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.product_id + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } @@ -33447,9 +34629,9 @@ pub mod product_policy { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyFragmentContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -33498,13 +34680,12 @@ pub mod product_policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) policy_id: String, + pub(crate) id: String, pub(crate) subscription_id: String, pub(crate) format: Option, } impl RequestBuilder { - #[doc = "Policy Export Format."] + #[doc = "Policy fragment content format."] pub fn format(mut self, format: impl Into) -> Self { self.format = Some(format.into()); self @@ -33518,13 +34699,12 @@ pub mod product_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyFragments/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.policy_id + &this.id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -33535,7 +34715,7 @@ pub mod product_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(format) = &this.format { req.url_mut().query_pairs_mut().append_pair("format", format); } @@ -33547,8 +34727,8 @@ pub mod product_policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -33563,9 +34743,9 @@ pub mod product_policy { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyFragmentContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -33594,6 +34774,9 @@ pub mod product_policy { pub fn e_tag(&self) -> azure_core::Result<&str> { self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) } + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] @@ -33614,9 +34797,8 @@ pub mod product_policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) policy_id: String, - pub(crate) parameters: models::PolicyContract, + pub(crate) id: String, + pub(crate) parameters: models::PolicyFragmentContract, pub(crate) subscription_id: String, pub(crate) if_match: Option, } @@ -33626,6 +34808,7 @@ pub mod product_policy { self.if_match = Some(if_match.into()); self } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -33635,13 +34818,12 @@ pub mod product_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyFragments/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.policy_id + &this.id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -33652,12 +34834,12 @@ pub mod product_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; if let Some(if_match) = &this.if_match { req.insert_header("if-match", if_match); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -33665,8 +34847,8 @@ pub mod product_policy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -33699,8 +34881,7 @@ pub mod product_policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) policy_id: String, + pub(crate) id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, } @@ -33714,13 +34895,12 @@ pub mod product_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyFragments/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.policy_id + &this.id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -33731,7 +34911,7 @@ pub mod product_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -33763,8 +34943,7 @@ pub mod product_policy { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) product_id: String, - pub(crate) policy_id: String, + pub(crate) id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -33777,13 +34956,12 @@ pub mod product_policy { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyFragments/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.product_id, - &this.policy_id + &this.id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -33794,65 +34972,244 @@ pub mod product_policy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_references { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) id: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/policyFragments/{}/listReferences" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod quota_by_counter_keys { +pub mod portal_config { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified service instance. The api does not support paging yet."] + #[doc = "Lists the developer portal configurations."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - quota_counter_key: impl Into, subscription_id: impl Into, ) -> list_by_service::RequestBuilder { list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - quota_counter_key: quota_counter_key.into(), subscription_id: subscription_id.into(), } } - #[doc = "Updates all the quota counter values specified with the existing quota counter key to a value in the specified service instance. This should be used for reset of the quota counter values."] + #[doc = "Get the developer portal configuration."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] - #[doc = "* `parameters`: The value of the quota counter to be applied to all quota counter periods."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( + #[doc = "* `portal_config_id`: Portal configuration identifier."] + pub fn get( &self, + subscription_id: impl Into, resource_group_name: impl Into, service_name: impl Into, - quota_counter_key: impl Into, - parameters: impl Into, + portal_config_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + portal_config_id: portal_config_id.into(), + } + } + #[doc = "Create or update the developer portal configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `portal_config_id`: Portal configuration identifier."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `parameters`: Update the developer portal configuration."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + portal_config_id: impl Into, + if_match: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + portal_config_id: portal_config_id.into(), + if_match: if_match.into(), + parameters: parameters.into(), + } + } + #[doc = "Update the developer portal configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `portal_config_id`: Portal configuration identifier."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `parameters`: Update the developer portal configuration."] + pub fn update( + &self, subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + portal_config_id: impl Into, + if_match: impl Into, + parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), + subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - quota_counter_key: quota_counter_key.into(), + portal_config_id: portal_config_id.into(), + if_match: if_match.into(), parameters: parameters.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the developer portal configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `portal_config_id`: Portal configuration identifier."] + pub fn get_entity_tag( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + portal_config_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + portal_config_id: portal_config_id.into(), } } } @@ -33860,9 +35217,9 @@ pub mod quota_by_counter_keys { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QuotaCounterCollection = serde_json::from_slice(&bytes)?; + let body: models::PortalConfigCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -33901,63 +35258,79 @@ pub mod quota_by_counter_keys { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) quota_counter_key: String, pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalconfigs", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name, - &this.quota_counter_key + &this.service_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod update { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QuotaCounterCollection = serde_json::from_slice(&bytes)?; + let body: models::PortalConfigContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -33966,6 +35339,9 @@ pub mod quota_by_counter_keys { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -33977,6 +35353,13 @@ pub mod quota_by_counter_keys { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -33994,11 +35377,10 @@ pub mod quota_by_counter_keys { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) quota_counter_key: String, - pub(crate) parameters: models::QuotaCounterValueUpdateContract, - pub(crate) subscription_id: String, + pub(crate) portal_config_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -34010,14 +35392,14 @@ pub mod quota_by_counter_keys { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalconfigs/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.quota_counter_key + &this.portal_config_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -34026,9 +35408,8 @@ pub mod quota_by_counter_keys { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -34036,8 +35417,8 @@ pub mod quota_by_counter_keys { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -34048,72 +35429,13 @@ pub mod quota_by_counter_keys { } } } -} -pub mod quota_by_period_keys { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] - #[doc = "* `quota_period_key`: Quota period key identifier."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - service_name: impl Into, - quota_counter_key: impl Into, - quota_period_key: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - quota_counter_key: quota_counter_key.into(), - quota_period_key: quota_period_key.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Updates an existing quota counter value in the specified service instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] - #[doc = "* `quota_period_key`: Quota period key identifier."] - #[doc = "* `parameters`: The value of the Quota counter to be applied on the specified period."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - quota_counter_key: impl Into, - quota_period_key: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - quota_counter_key: quota_counter_key.into(), - quota_period_key: quota_period_key.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QuotaCounterContract = serde_json::from_slice(&bytes)?; + let body: models::PortalConfigContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -34150,11 +35472,12 @@ pub mod quota_by_period_keys { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) quota_counter_key: String, - pub(crate) quota_period_key: String, - pub(crate) subscription_id: String, + pub(crate) portal_config_id: String, + pub(crate) if_match: String, + pub(crate) parameters: models::PortalConfigContract, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -34166,15 +35489,14 @@ pub mod quota_by_period_keys { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}/periods/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalconfigs/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.quota_counter_key, - &this.quota_period_key + &this.portal_config_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -34183,8 +35505,10 @@ pub mod quota_by_period_keys { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -34192,8 +35516,8 @@ pub mod quota_by_period_keys { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -34208,9 +35532,9 @@ pub mod quota_by_period_keys { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QuotaCounterContract = serde_json::from_slice(&bytes)?; + let body: models::PortalConfigContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -34247,12 +35571,12 @@ pub mod quota_by_period_keys { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) quota_counter_key: String, - pub(crate) quota_period_key: String, - pub(crate) parameters: models::QuotaCounterValueUpdateContract, - pub(crate) subscription_id: String, + pub(crate) portal_config_id: String, + pub(crate) if_match: String, + pub(crate) parameters: models::PortalConfigContract, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -34264,13 +35588,12 @@ pub mod quota_by_period_keys { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}/periods/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalconfigs/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.quota_counter_key, - &this.quota_period_key + &this.portal_config_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -34281,7 +35604,8 @@ pub mod quota_by_period_keys { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -34291,8 +35615,8 @@ pub mod quota_by_period_keys { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -34303,57 +35627,9 @@ pub mod quota_by_period_keys { } } } -} -pub mod region { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all azure regions in which the service exists."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list_by_service { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RegionListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -34371,288 +35647,176 @@ pub mod region { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) subscription_id: String, + pub(crate) portal_config_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/regions", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalconfigs/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.portal_config_id ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } } -pub mod reports { +pub mod portal_revision { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists report records by API."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: The filter to apply on the operation."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_api( - &self, - resource_group_name: impl Into, - service_name: impl Into, - filter: impl Into, - subscription_id: impl Into, - ) -> list_by_api::RequestBuilder { - list_by_api::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - filter: filter.into(), - subscription_id: subscription_id.into(), - top: None, - skip: None, - orderby: None, - } - } - #[doc = "Lists report records by User."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_user( - &self, - resource_group_name: impl Into, - service_name: impl Into, - filter: impl Into, - subscription_id: impl Into, - ) -> list_by_user::RequestBuilder { - list_by_user::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - filter: filter.into(), - subscription_id: subscription_id.into(), - top: None, - skip: None, - orderby: None, - } - } - #[doc = "Lists report records by API Operations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_operation( - &self, - resource_group_name: impl Into, - service_name: impl Into, - filter: impl Into, - subscription_id: impl Into, - ) -> list_by_operation::RequestBuilder { - list_by_operation::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - filter: filter.into(), - subscription_id: subscription_id.into(), - top: None, - skip: None, - orderby: None, - } - } - #[doc = "Lists report records by Product."] + #[doc = "Lists developer portal's revisions."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_product( + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, - filter: impl Into, subscription_id: impl Into, - ) -> list_by_product::RequestBuilder { - list_by_product::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - filter: filter.into(), subscription_id: subscription_id.into(), + filter: None, top: None, skip: None, - orderby: None, } } - #[doc = "Lists report records by geography."] + #[doc = "Gets the developer portal's revision specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| country | select | | |
| region | select | | |
| zip | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_geo( + #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - filter: impl Into, + portal_revision_id: impl Into, subscription_id: impl Into, - ) -> list_by_geo::RequestBuilder { - list_by_geo::RequestBuilder { + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - filter: filter.into(), + portal_revision_id: portal_revision_id.into(), subscription_id: subscription_id.into(), - top: None, - skip: None, } } - #[doc = "Lists report records by subscription."] + #[doc = "Creates a new developer portal's revision by running the portal's publishing. The `isCurrent` property indicates if the revision is publicly accessible."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_subscription( + #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - filter: impl Into, + portal_revision_id: impl Into, + parameters: impl Into, subscription_id: impl Into, - ) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - filter: filter.into(), + portal_revision_id: portal_revision_id.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), - top: None, - skip: None, - orderby: None, } } - #[doc = "Lists report records by Time."] + #[doc = "Updates the description of specified portal revision or makes it current."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter, select | ge, le | |
| interval | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] - #[doc = "* `interval`: By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds))."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_time( + #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - filter: impl Into, - interval: impl Into, + portal_revision_id: impl Into, + parameters: impl Into, + if_match: impl Into, subscription_id: impl Into, - ) -> list_by_time::RequestBuilder { - list_by_time::RequestBuilder { + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - filter: filter.into(), - interval: interval.into(), + portal_revision_id: portal_revision_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), - top: None, - skip: None, - orderby: None, } } - #[doc = "Lists report records by Request."] + #[doc = "Gets the developer portal revision specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq | |
"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_request( + #[doc = "* `portal_revision_id`: Portal revision identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - filter: impl Into, + portal_revision_id: impl Into, subscription_id: impl Into, - ) -> list_by_request::RequestBuilder { - list_by_request::RequestBuilder { + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - filter: filter.into(), + portal_revision_id: portal_revision_id.into(), subscription_id: subscription_id.into(), - top: None, - skip: None, } } } - pub mod list_by_api { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PortalRevisionCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -34691,13 +35855,17 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, pub(crate) subscription_id: String, + pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) orderby: Option, } impl RequestBuilder { + #[doc = "| Field | Supported operators | Supported functions |\n|-------------|------------------------|-----------------------------------|\n\r\n|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|\n|description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|\n|isCurrent | eq, ne | |\n"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } #[doc = "Number of records to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -34708,17 +35876,12 @@ pub mod reports { self.skip = Some(skip); self } - #[doc = "OData order by query option."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byApi", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, @@ -34740,7 +35903,7 @@ pub mod reports { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -34756,18 +35919,16 @@ pub mod reports { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -34787,13 +35948,13 @@ pub mod reports { } } } - pub mod list_by_user { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PortalRevisionContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -34802,6 +35963,9 @@ pub mod reports { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -34813,10 +35977,26306 @@ pub mod reports { self.as_raw_response() } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) portal_revision_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.portal_revision_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) portal_revision_id: String, + pub(crate) parameters: models::PortalRevisionContract, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.portal_revision_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) portal_revision_id: String, + pub(crate) parameters: models::PortalRevisionContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.portal_revision_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) portal_revision_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalRevisions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.portal_revision_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod portal_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of portalsettings defined within a service instance.."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalSettingsCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sign_in_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Sign In Settings for the Portal"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Create or Update Sign-In settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Update Sign-In settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Update Sign-In settings."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the SignInSettings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalSigninSettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalSigninSettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::PortalSigninSettings, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::PortalSigninSettings, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signin", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod sign_up_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Sign Up Settings for the Portal"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Create or Update Sign-Up settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Update Sign-Up settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Update Sign-Up settings."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the SignUpSettings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalSignupSettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalSignupSettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::PortalSignupSettings, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::PortalSignupSettings, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/signup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod delegation_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Delegation Settings for the Portal."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Create or Update Delegation settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Update Delegation settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Update Delegation settings."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the DelegationSettings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the secret validation key of the DelegationSettings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalDelegationSettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalDelegationSettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::PortalDelegationSettings, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::PortalDelegationSettings, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_secrets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PortalSettingValidationKeyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/portalsettings/delegation/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod private_endpoint_connection { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all private endpoint connections of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + pub fn list_by_service( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + service_name: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + } + } + #[doc = "Gets the details of the Private Endpoint Connection specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `private_endpoint_connection_name`: Name of the private endpoint connection."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_by_name( + &self, + resource_group_name: impl Into, + service_name: impl Into, + private_endpoint_connection_name: impl Into, + subscription_id: impl Into, + ) -> get_by_name::RequestBuilder { + get_by_name::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new Private Endpoint Connection or updates an existing one."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `private_endpoint_connection_name`: Name of the private endpoint connection."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + private_endpoint_connection_name: impl Into, + subscription_id: impl Into, + private_endpoint_connection_request: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + subscription_id: subscription_id.into(), + private_endpoint_connection_request: private_endpoint_connection_request.into(), + } + } + #[doc = "Deletes the specified Private Endpoint Connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `private_endpoint_connection_name`: Name of the private endpoint connection."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + private_endpoint_connection_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the private link resources"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `service_name`: The name of the API Management service."] + pub fn list_private_link_resources( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + service_name: impl Into, + ) -> list_private_link_resources::RequestBuilder { + list_private_link_resources::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + service_name: service_name.into(), + } + } + #[doc = "Gets the private link resources"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `private_link_sub_resource_name`: Name of the private link resource."] + pub fn get_private_link_resource( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + service_name: impl Into, + private_link_sub_resource_name: impl Into, + ) -> get_private_link_resource::RequestBuilder { + get_private_link_resource::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + service_name: service_name.into(), + private_link_sub_resource_name: private_link_sub_resource_name.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/privateEndpointConnections", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_by_name { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . private_endpoint_connection_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) subscription_id: String, + pub(crate) private_endpoint_connection_request: models::PrivateEndpointConnectionRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . private_endpoint_connection_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.private_endpoint_connection_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . private_endpoint_connection_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_private_link_resources { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResourceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) service_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/privateLinkResources", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_private_link_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) service_name: String, + pub(crate) private_link_sub_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/privateLinkResources/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.private_link_sub_resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod product { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of products in the specified service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + expand_groups: None, + tags: None, + } + } + #[doc = "Gets the details of the product specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or Updates a product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Update existing product details."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Delete product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + delete_subscriptions: None, + } + } + #[doc = "Gets the entity state (Etag) version of the product specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists a collection of products associated with tags."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_tags( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_tags::RequestBuilder { + list_by_tags::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + include_not_tagged_products: None, + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) expand_groups: Option, + pub(crate) tags: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "When set to true, the response contains an array of groups that have visibility to the product. The default is false."] + pub fn expand_groups(mut self, expand_groups: bool) -> Self { + self.expand_groups = Some(expand_groups); + self + } + #[doc = "Products which are part of a specific tag."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(expand_groups) = &this.expand_groups { + req.url_mut() + .query_pairs_mut() + .append_pair("expandGroups", &expand_groups.to_string()); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) parameters: models::ProductContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) parameters: models::ProductUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + pub(crate) delete_subscriptions: Option, + } + impl RequestBuilder { + #[doc = "Delete existing subscriptions associated with the product or not."] + pub fn delete_subscriptions(mut self, delete_subscriptions: bool) -> Self { + self.delete_subscriptions = Some(delete_subscriptions); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + if let Some(delete_subscriptions) = &this.delete_subscriptions { + req.url_mut() + .query_pairs_mut() + .append_pair("deleteSubscriptions", &delete_subscriptions.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_tags { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagResourceCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) include_not_tagged_products: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Include not tagged Products."] + pub fn include_not_tagged_products(mut self, include_not_tagged_products: bool) -> Self { + self.include_not_tagged_products = Some(include_not_tagged_products); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/productsByTags", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(include_not_tagged_products) = &this.include_not_tagged_products { + req.url_mut() + .query_pairs_mut() + .append_pair("includeNotTaggedProducts", &include_not_tagged_products.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod product_api { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the APIs associated with a product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Adds an API to the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified API from the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Checks that API entity specified by identifier is associated with the Product entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod check_entity_exists { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod product_group { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the collection of developer groups associated with the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Adds the association between the specified developer group with the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the association between the specified group and product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Checks that Group entity specified by identifier is associated with the Product entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) group_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) group_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod check_entity_exists { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) group_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod product_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the collection of subscriptions to the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/subscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod product_policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the policy configuration at the Product level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the policy configuration at the Product level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + format: None, + } + } + #[doc = "Creates or updates policy configuration for the Product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + policy_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes the policy configuration at the Product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + policy_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the ETag of the policy configuration at the Product level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + pub(crate) format: Option, + } + impl RequestBuilder { + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod product_wiki { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the details of the Wiki for a Product specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new Wiki for a Product or updates an existing one."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the Wiki for a Product specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Wiki Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified Wiki from a Product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Wiki for a Product specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/wikis/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) parameters: models::WikiContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/wikis/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) parameters: models::WikiUpdateContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/wikis/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/wikis/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/wikis/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod product_wikis { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the details of the Wiki for a Product specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WikiCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | eq | contains |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/wikis", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod product_api_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the API links associated with a product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the API link for the product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Product-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds an API to the specified product via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Product-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified API from the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Product-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductApiLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apiLinks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductApiLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) api_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apiLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.api_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductApiLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) api_link_id: String, + pub(crate) subscription_id: String, + pub(crate) parameters: models::ProductApiLinkContract, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apiLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.api_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) api_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/apiLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.api_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod product_group_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the group links associated with a product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the group link for the product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_link_id`: Product-Group link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + group_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + group_link_id: group_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds a group to the specified product via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_link_id`: Product-Group link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + group_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + group_link_id: group_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified group from the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_link_id`: Product-Group link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + product_id: impl Into, + group_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + product_id: product_id.into(), + group_link_id: group_link_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductGroupLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groupLinks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductGroupLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) group_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groupLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.group_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductGroupLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) group_link_id: String, + pub(crate) subscription_id: String, + pub(crate) parameters: models::ProductGroupLinkContract, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groupLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.group_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) product_id: String, + pub(crate) group_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/products/{}/groupLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.product_id, + &this.group_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod quota_by_counter_keys { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of current quota counter periods associated with the counter-key configured in the policy on the specified service instance. The api does not support paging yet."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + quota_counter_key: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + quota_counter_key: quota_counter_key.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Updates all the quota counter values specified with the existing quota counter key to a value in the specified service instance. This should be used for reset of the quota counter values."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] + #[doc = "* `parameters`: The value of the quota counter to be applied to all quota counter periods."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + quota_counter_key: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + quota_counter_key: quota_counter_key.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::QuotaCounterCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) quota_counter_key: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.quota_counter_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::QuotaCounterCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) quota_counter_key: String, + pub(crate) parameters: models::QuotaCounterValueUpdateContract, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.quota_counter_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod quota_by_period_keys { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] + #[doc = "* `quota_period_key`: Quota period key identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + quota_counter_key: impl Into, + quota_period_key: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + quota_counter_key: quota_counter_key.into(), + quota_period_key: quota_period_key.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Updates an existing quota counter value in the specified service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `quota_counter_key`: Quota counter key identifier.This is the result of expression defined in counter-key attribute of the quota-by-key policy.For Example, if you specify counter-key=\"boo\" in the policy, then it’s accessible by \"boo\" counter key. But if it’s defined as counter-key=\"@(\"b\"+\"a\")\" then it will be accessible by \"ba\" key"] + #[doc = "* `quota_period_key`: Quota period key identifier."] + #[doc = "* `parameters`: The value of the Quota counter to be applied on the specified period."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + quota_counter_key: impl Into, + quota_period_key: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + quota_counter_key: quota_counter_key.into(), + quota_period_key: quota_period_key.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::QuotaCounterContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) quota_counter_key: String, + pub(crate) quota_period_key: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}/periods/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.quota_counter_key, + &this.quota_period_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::QuotaCounterContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) quota_counter_key: String, + pub(crate) quota_period_key: String, + pub(crate) parameters: models::QuotaCounterValueUpdateContract, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/quotas/{}/periods/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.quota_counter_key, + &this.quota_period_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod region { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all azure regions in which the service exists."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/regions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod reports { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists report records by API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: The filter to apply on the operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + orderby: None, + } + } + #[doc = "Lists report records by User."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_user( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_user::RequestBuilder { + list_by_user::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + orderby: None, + } + } + #[doc = "Lists report records by API Operations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_operation( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_operation::RequestBuilder { + list_by_operation::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + orderby: None, + } + } + #[doc = "Lists report records by Product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + orderby: None, + } + } + #[doc = "Lists report records by geography."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| country | select | | |
| region | select | | |
| zip | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_geo( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_geo::RequestBuilder { + list_by_geo::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + } + } + #[doc = "Lists report records by subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + orderby: None, + } + } + #[doc = "Lists report records by Time."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter, select | ge, le | |
| interval | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
"] + #[doc = "* `interval`: By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds))."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_time( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + interval: impl Into, + subscription_id: impl Into, + ) -> list_by_time::RequestBuilder { + list_by_time::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + interval: interval.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + orderby: None, + } + } + #[doc = "Lists report records by Request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `filter`: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq | |
"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_request( + &self, + resource_group_name: impl Into, + service_name: impl Into, + filter: impl Into, + subscription_id: impl Into, + ) -> list_by_request::RequestBuilder { + list_by_request::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + filter: filter.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + } + } + } + pub mod list_by_api { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byApi", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_user { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byUser", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_operation { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byOperation", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byProduct", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_geo { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byGeo", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/bySubscription", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_time { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) interval: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) orderby: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byTime", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + let interval = &this.interval; + req.url_mut().query_pairs_mut().append_pair("interval", interval); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_request { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RequestReportCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) filter: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byRequest", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let filter = &this.filter; + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod global_schema { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of schemas registered with service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the details of the Schema specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + schema_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + schema_id: schema_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates new or updates existing specified Schema of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + schema_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + schema_id: schema_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes specific Schema."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + schema_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + schema_id: schema_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Schema specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + schema_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + schema_id: schema_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalSchemaCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/schemas", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalSchemaContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) schema_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalSchemaContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + #[doc = "Location header"] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) schema_id: String, + pub(crate) parameters: models::GlobalSchemaContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) schema_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) schema_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod tenant_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Public settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Get tenant settings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `settings_type`: The identifier of the settings."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + settings_type: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + settings_type: settings_type.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TenantSettingsCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "Not used"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/settings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TenantSettingsContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) settings_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.settings_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod api_management_skus { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of Microsoft.ApiManagement SKUs available for your Subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiManagementSkusResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ApiManagement/skus", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod subscription { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all subscriptions of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the specified Subscription entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates the subscription of specified user to the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + notify: None, + if_match: None, + app_type: None, + } + } + #[doc = "Updates the details of a subscription specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + notify: None, + app_type: None, + } + } + #[doc = "Deletes the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Regenerates primary key of existing subscription of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn regenerate_primary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> regenerate_primary_key::RequestBuilder { + regenerate_primary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Regenerates secondary key of existing subscription of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn regenerate_secondary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> regenerate_secondary_key::RequestBuilder { + regenerate_secondary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the specified Subscription keys."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.sid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) parameters: models::SubscriptionCreateParameters, + pub(crate) subscription_id: String, + pub(crate) notify: Option, + pub(crate) if_match: Option, + pub(crate) app_type: Option, + } + impl RequestBuilder { + #[doc = "Notify change in Subscription State. \n - If false, do not send any email notification for change of state of subscription \n - If true, send email notification of change of state of subscription "] + pub fn notify(mut self, notify: bool) -> Self { + self.notify = Some(notify); + self + } + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] + pub fn app_type(mut self, app_type: impl Into) -> Self { + self.app_type = Some(app_type.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.sid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(notify) = &this.notify { + req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); + } + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + if let Some(app_type) = &this.app_type { + req.url_mut().query_pairs_mut().append_pair("appType", app_type); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) parameters: models::SubscriptionUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + pub(crate) notify: Option, + pub(crate) app_type: Option, + } + impl RequestBuilder { + #[doc = "Notify change in Subscription State. \n - If false, do not send any email notification for change of state of subscription \n - If true, send email notification of change of state of subscription "] + pub fn notify(mut self, notify: bool) -> Self { + self.notify = Some(notify); + self + } + #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] + pub fn app_type(mut self, app_type: impl Into) -> Self { + self.app_type = Some(app_type.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.sid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(notify) = &this.notify { + req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); + } + req.insert_header("if-match", &this.if_match); + if let Some(app_type) = &this.app_type { + req.url_mut().query_pairs_mut().append_pair("appType", app_type); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.sid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.sid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_primary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_secondary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_secrets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionKeysContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod tag_resource { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of resources associated with tags."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagResourceCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| isCurrent | filter | eq | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tagResources", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod tag_api_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the API links associated with a tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the API link for the tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Tag-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds an API to the specified tag via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Tag-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified API from the specified tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Tag-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagApiLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/apiLinks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagApiLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) api_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/apiLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.api_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagApiLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) api_link_id: String, + pub(crate) subscription_id: String, + pub(crate) parameters: models::TagApiLinkContract, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/apiLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.api_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) api_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/apiLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.api_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod tag_operation_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the operation links associated with a tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the operation link for the tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `operation_link_id`: Tag-operation link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + operation_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + operation_link_id: operation_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds an operation to the specified tag via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `operation_link_id`: Tag-operation link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + operation_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + operation_link_id: operation_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified operation from the specified tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `operation_link_id`: Tag-operation link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + operation_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + operation_link_id: operation_link_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagOperationLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/operationLinks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagOperationLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) operation_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/operationLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.operation_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagOperationLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) operation_link_id: String, + pub(crate) subscription_id: String, + pub(crate) parameters: models::TagOperationLinkContract, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/operationLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.operation_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) operation_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/operationLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.operation_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod tag_product_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the product links associated with a tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the product link for the tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_link_id`: Tag-product link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + product_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + product_link_id: product_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds a product to the specified tag via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_link_id`: Tag-product link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + product_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + product_link_id: product_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified product from the specified tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_link_id`: Tag-product link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + tag_id: impl Into, + product_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + tag_id: tag_id.into(), + product_link_id: product_link_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagProductLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/productLinks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagProductLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) product_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/productLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.product_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagProductLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) product_link_id: String, + pub(crate) subscription_id: String, + pub(crate) parameters: models::TagProductLinkContract, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/productLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.product_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) tag_id: String, + pub(crate) product_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tags/{}/productLinks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.tag_id, + &this.product_link_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod tenant_access { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns list of access infos - for Git and Management endpoints."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Get tenant access information details without secrets."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + #[doc = "Update tenant access information details."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Parameters supplied to retrieve the Tenant Access Information."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + access_name: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + access_name: access_name.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Update tenant access information details."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Parameters supplied to retrieve the Tenant Access Information."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + access_name: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + access_name: access_name.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Tenant access metadata"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + #[doc = "Regenerate primary access key"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn regenerate_primary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> regenerate_primary_key::RequestBuilder { + regenerate_primary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + #[doc = "Regenerate secondary access key"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn regenerate_secondary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> regenerate_secondary_key::RequestBuilder { + regenerate_secondary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + #[doc = "Get tenant access information details."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessInformationCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "Not used"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessInformationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.access_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessInformationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::AccessInformationCreateParameters, + pub(crate) access_name: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.access_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessInformationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::AccessInformationUpdateParameters, + pub(crate) access_name: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.access_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.access_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_primary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_secondary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_secrets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessInformationSecretsContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/listSecrets", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.access_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod tenant_access_git { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Regenerate primary access key for GIT."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn regenerate_primary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> regenerate_primary_key::RequestBuilder { + regenerate_primary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + #[doc = "Regenerate secondary access key for GIT."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `access_name`: The identifier of the Access configuration."] + pub fn regenerate_secondary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + access_name: impl Into, + ) -> regenerate_secondary_key::RequestBuilder { + regenerate_secondary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + access_name: access_name.into(), + } + } + } + pub mod regenerate_primary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/git/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_secondary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) access_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/git/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod tenant_configuration { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Deploy Configuration parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] + pub fn deploy( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + configuration_name: impl Into, + ) -> deploy::RequestBuilder { + deploy::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + configuration_name: configuration_name.into(), + } + } + #[doc = "This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Save Configuration parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] + pub fn save( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + configuration_name: impl Into, + ) -> save::RequestBuilder { + save::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + configuration_name: configuration_name.into(), + } + } + #[doc = "This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `parameters`: Validate Configuration parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] + pub fn validate( + &self, + resource_group_name: impl Into, + service_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + configuration_name: impl Into, + ) -> validate::RequestBuilder { + validate::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + configuration_name: configuration_name.into(), + } + } + #[doc = "Gets the status of the most recent synchronization between the configuration database and the Git repository."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] + pub fn get_sync_state( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + configuration_name: impl Into, + ) -> get_sync_state::RequestBuilder { + get_sync_state::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + configuration_name: configuration_name.into(), + } + } + } + pub mod deploy { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::DeployConfigurationParameters, + pub(crate) subscription_id: String, + pub(crate) configuration_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/deploy", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.configuration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod save { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::SaveConfigurationParameter, + pub(crate) subscription_id: String, + pub(crate) configuration_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/save", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.configuration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod validate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) parameters: models::DeployConfigurationParameters, + pub(crate) subscription_id: String, + pub(crate) configuration_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/validate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.configuration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_sync_state { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TenantConfigurationSyncStateContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) configuration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/syncState", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.configuration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod user { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of registered users in the specified service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + expand_groups: None, + } + } + #[doc = "Gets the details of the user specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or Updates a user."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + notify: None, + if_match: None, + } + } + #[doc = "Updates the details of the user specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific user."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + delete_subscriptions: None, + notify: None, + app_type: None, + } + } + #[doc = "Gets the entity state (Etag) version of the user specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn generate_sso_url( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> generate_sso_url::RequestBuilder { + generate_sso_url::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the Shared Access Authorization Token for the User."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create Authorization Token parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_shared_access_token( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> get_shared_access_token::RequestBuilder { + get_shared_access_token::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) expand_groups: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| groups | expand | | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Detailed Group in response."] + pub fn expand_groups(mut self, expand_groups: bool) -> Self { + self.expand_groups = Some(expand_groups); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(expand_groups) = &this.expand_groups { + req.url_mut() + .query_pairs_mut() + .append_pair("expandGroups", &expand_groups.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) parameters: models::UserCreateParameters, + pub(crate) subscription_id: String, + pub(crate) notify: Option, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "Send an Email notification to the User."] + pub fn notify(mut self, notify: bool) -> Self { + self.notify = Some(notify); + self + } + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(notify) = &this.notify { + req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); + } + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) parameters: models::UserUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + pub(crate) delete_subscriptions: Option, + pub(crate) notify: Option, + pub(crate) app_type: Option, + } + impl RequestBuilder { + #[doc = "Whether to delete user's subscription or not."] + pub fn delete_subscriptions(mut self, delete_subscriptions: bool) -> Self { + self.delete_subscriptions = Some(delete_subscriptions); + self + } + #[doc = "Send an Account Closed Email notification to the User."] + pub fn notify(mut self, notify: bool) -> Self { + self.notify = Some(notify); + self + } + #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] + pub fn app_type(mut self, app_type: impl Into) -> Self { + self.app_type = Some(app_type.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(delete_subscriptions) = &this.delete_subscriptions { + req.url_mut() + .query_pairs_mut() + .append_pair("deleteSubscriptions", &delete_subscriptions.to_string()); + } + if let Some(notify) = &this.notify { + req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); + } + req.insert_header("if-match", &this.if_match); + if let Some(app_type) = &this.app_type { + req.url_mut().query_pairs_mut().append_pair("appType", app_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod generate_sso_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GenerateSsoUrlResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/generateSsoUrl", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_shared_access_token { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserTokenResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) parameters: models::UserTokenParameters, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/token", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod user_group { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all user groups."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/groups", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod user_subscription { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the collection of subscriptions of the specified user."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the specified Subscription entity associated with a particular user."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
|name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/subscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/subscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id, + &this.sid + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod user_identities { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of all user identities."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserIdentityCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/identities", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.user_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod user_confirmation_password { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Sends confirmation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn send( + &self, + resource_group_name: impl Into, + service_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> send::RequestBuilder { + send::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + app_type: None, + } + } + } + pub mod send { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + pub(crate) app_type: Option, + } + impl RequestBuilder { + #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] + pub fn app_type(mut self, app_type: impl Into) -> Self { + self.app_type = Some(app_type.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/confirmations/password/send" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(app_type) = &this.app_type { + req.url_mut().query_pairs_mut().append_pair("appType", app_type); + } + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_api_export { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `format`: Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + format: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + format: format.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiExportResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) format: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}?export=true" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let format = &this.format; + req.url_mut().query_pairs_mut().append_pair("format", format); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all workspaces of the API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the details of the workspace specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new workspace or updates an existing one."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the workspace specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Workspace Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the workspace specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |

| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) parameters: models::WorkspaceContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) parameters: models::WorkspaceContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the policy configuration at the workspace level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the policy configuration at the API level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + format: None, + } + } + #[doc = "Creates or updates policy configuration for the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + policy_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + policy_id: policy_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes the policy configuration at the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + policy_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the workspace policy specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_api { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + pub(crate) format: Option, + } + impl RequestBuilder { + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.policy_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_named_value { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of named values defined within a workspace in a service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + is_key_vault_refresh_failed: None, + } + } + #[doc = "Gets the details of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates named value."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the specific named value."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific named value from the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the secret of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_value( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> list_value::RequestBuilder { + list_value::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Refresh the secret of the named value specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `named_value_id`: Identifier of the NamedValue."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn refresh_secret( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + named_value_id: impl Into, + subscription_id: impl Into, + ) -> refresh_secret::RequestBuilder { + refresh_secret::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + named_value_id: named_value_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamedValueCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) is_key_vault_refresh_failed: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Query parameter to fetch named value entities based on refresh status."] + pub fn is_key_vault_refresh_failed(mut self, is_key_vault_refresh_failed: impl Into) -> Self { + self.is_key_vault_refresh_failed = Some(is_key_vault_refresh_failed.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(is_key_vault_refresh_failed) = &this.is_key_vault_refresh_failed { + req.url_mut() + .query_pairs_mut() + .append_pair("isKeyVaultRefreshFailed", is_key_vault_refresh_failed); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamedValueContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) parameters: models::NamedValueCreateContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) parameters: models::NamedValueUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_value { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamedValueSecretContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}/listValue" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod refresh_secret { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) named_value_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/namedValues/{}/refreshSecret" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . named_value_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_global_schema { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of schemas registered with workspace in a service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the details of the Schema specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + schema_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + schema_id: schema_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates new or updates existing specified Schema of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + schema_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + schema_id: schema_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes specific Schema."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + schema_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + schema_id: schema_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Schema specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + schema_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + schema_id: schema_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalSchemaCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/schemas", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalSchemaContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) schema_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GlobalSchemaContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + #[doc = "Location header"] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) schema_id: String, + pub(crate) parameters: models::GlobalSchemaContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) schema_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) schema_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/schemas/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.schema_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_notification { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of properties defined within a service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + } + } + #[doc = "Gets the details of the Notification specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Create or Update API Management publisher notification for the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotificationCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotificationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NotificationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_notification_recipient_user { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of the Notification Recipient User subscribed to the notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_notification( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + subscription_id: impl Into, + ) -> list_by_notification::RequestBuilder { + list_by_notification::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds the API Management User to the list of Recipients for the Notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Removes the API Management user from the list of Notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Determine if the Notification Recipient User is subscribed to the notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_notification { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RecipientUserCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientUsers" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RecipientUserContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod check_entity_exists { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientUsers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_notification_recipient_email { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of the Notification Recipient Emails subscribed to a notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_notification( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + subscription_id: impl Into, + ) -> list_by_notification::RequestBuilder { + list_by_notification::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds the Email address to the list of Recipients for the Notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `email`: Email identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + email: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + email: email.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Removes the email from the list of Notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `email`: Email identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + email: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + email: email.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Determine if Notification Recipient Email subscribed to the notification."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `notification_name`: Notification Name Identifier."] + #[doc = "* `email`: Email identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + notification_name: impl Into, + email: impl Into, + subscription_id: impl Into, + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + notification_name: notification_name.into(), + email: email.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_notification { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RecipientEmailCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientEmails" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RecipientEmailContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) email: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name , & this . email)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) email: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name , & this . email)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod check_entity_exists { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) notification_name: String, + pub(crate) email: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/notifications/{}/recipientEmails/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . notification_name , & this . email)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_policy_fragment { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all policy fragments defined within a workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + orderby: None, + top: None, + skip: None, + } + } + #[doc = "Gets a policy fragment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + id: id.into(), + subscription_id: subscription_id.into(), + format: None, + } + } + #[doc = "Creates or updates a policy fragment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `parameters`: The policy fragment contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + id: id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes a policy fragment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + id: id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of a policy fragment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + id: id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists policy resources that reference the policy fragment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `id`: A resource identifier."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_references( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + id: impl Into, + subscription_id: impl Into, + ) -> list_references::RequestBuilder { + list_references::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + id: id.into(), + subscription_id: subscription_id.into(), + top: None, + skip: None, + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyFragmentCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData order by query option."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policyFragments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyFragmentContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) id: String, + pub(crate) subscription_id: String, + pub(crate) format: Option, + } + impl RequestBuilder { + #[doc = "Policy fragment content format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policyFragments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyFragmentContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + #[doc = "Location header"] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) id: String, + pub(crate) parameters: models::PolicyFragmentContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policyFragments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policyFragments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policyFragments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_references { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) id: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/policyFragments/{}/listReferences" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_group { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of groups defined within a workspace in a service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the details of the group specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or Updates a group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the group specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific group of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the group specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| externalId | filter | eq | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) parameters: models::GroupCreateParameters, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GroupContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) parameters: models::GroupUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.group_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_group_user { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of user entities associated with the group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Add existing user to existing group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Remove existing user from existing group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Checks that user entity specified by identifier is associated with the group entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_id`: Group identifier. Must be unique in the current API Management service instance."] + #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_entity_exists( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + group_id: impl Into, + user_id: impl Into, + subscription_id: impl Into, + ) -> check_entity_exists::RequestBuilder { + check_entity_exists::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + group_id: group_id.into(), + user_id: user_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}/users" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . group_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UserContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}/users/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . group_id , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}/users/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . group_id , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod check_entity_exists { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) group_id: String, + pub(crate) user_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/groups/{}/users/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . group_id , & this . user_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_subscription { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all subscriptions of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the specified Subscription entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates the subscription of specified user to the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + notify: None, + if_match: None, + app_type: None, + } + } + #[doc = "Updates the details of a subscription specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + notify: None, + app_type: None, + } + } + #[doc = "Deletes the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Regenerates primary key of existing subscription of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn regenerate_primary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> regenerate_primary_key::RequestBuilder { + regenerate_primary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Regenerates secondary key of existing subscription of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn regenerate_secondary_key( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> regenerate_secondary_key::RequestBuilder { + regenerate_secondary_key::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the specified Subscription keys."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_secrets( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + sid: impl Into, + subscription_id: impl Into, + ) -> list_secrets::RequestBuilder { + list_secrets::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + sid: sid.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) parameters: models::SubscriptionCreateParameters, + pub(crate) subscription_id: String, + pub(crate) notify: Option, + pub(crate) if_match: Option, + pub(crate) app_type: Option, + } + impl RequestBuilder { + #[doc = "Notify change in Subscription State. \n - If false, do not send any email notification for change of state of subscription \n - If true, send email notification of change of state of subscription "] + pub fn notify(mut self, notify: bool) -> Self { + self.notify = Some(notify); + self + } + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] + pub fn app_type(mut self, app_type: impl Into) -> Self { + self.app_type = Some(app_type.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(notify) = &this.notify { + req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); + } + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + if let Some(app_type) = &this.app_type { + req.url_mut().query_pairs_mut().append_pair("appType", app_type); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) parameters: models::SubscriptionUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + pub(crate) notify: Option, + pub(crate) app_type: Option, + } + impl RequestBuilder { + #[doc = "Notify change in Subscription State. \n - If false, do not send any email notification for change of state of subscription \n - If true, send email notification of change of state of subscription "] + pub fn notify(mut self, notify: bool) -> Self { + self.notify = Some(notify); + self + } + #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] + pub fn app_type(mut self, app_type: impl Into) -> Self { + self.app_type = Some(app_type.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(notify) = &this.notify { + req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); + } + req.insert_header("if-match", &this.if_match); + if let Some(app_type) = &this.app_type { + req.url_mut().query_pairs_mut().append_pair("appType", app_type); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_primary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod regenerate_secondary_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_secrets { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionKeysContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) sid: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/subscriptions/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . sid)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_api_version_set { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of API Version Sets in the specified workspace with a service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the details of the Api Version Set specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + version_set_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + version_set_id: version_set_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or Updates a Api Version Set."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + version_set_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + version_set_id: version_set_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the Api VersionSet specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + version_set_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + version_set_id: version_set_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes specific Api Version Set."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + version_set_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + version_set_id: version_set_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the Api Version Set specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `version_set_id`: Api Version Set identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + version_set_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + version_set_id: version_set_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiVersionSetCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apiVersionSets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) version_set_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apiVersionSets/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . version_set_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) version_set_id: String, + pub(crate) parameters: models::ApiVersionSetContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apiVersionSets/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . version_set_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiVersionSetContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) version_set_id: String, + pub(crate) parameters: models::ApiVersionSetUpdateParameters, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apiVersionSets/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . version_set_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) version_set_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apiVersionSets/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . version_set_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) version_set_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apiVersionSets/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . version_set_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_api { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all APIs of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + tags: None, + expand_api_version_set: None, + } + } + #[doc = "Gets the details of the API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates new or updates existing specified API of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the specified API of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `parameters`: API Update Contract parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified API of the workspace in an API Management service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + delete_revisions: None, + } + } + #[doc = "Gets the entity state (Etag) version of the API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) tags: Option, + pub(crate) expand_api_version_set: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| isCurrent | filter | eq, ne | |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Include tags in the response."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + #[doc = "Include full ApiVersionSet resource in response"] + pub fn expand_api_version_set(mut self, expand_api_version_set: bool) -> Self { + self.expand_api_version_set = Some(expand_api_version_set); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(expand_api_version_set) = &this.expand_api_version_set { + req.url_mut() + .query_pairs_mut() + .append_pair("expandApiVersionSet", &expand_api_version_set.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) parameters: models::ApiCreateOrUpdateParameter, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) parameters: models::ApiUpdateContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + pub(crate) delete_revisions: Option, + } + impl RequestBuilder { + #[doc = "Delete all revisions of the Api."] + pub fn delete_revisions(mut self, delete_revisions: bool) -> Self { + self.delete_revisions = Some(delete_revisions); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(delete_revisions) = &this.delete_revisions { + req.url_mut() + .query_pairs_mut() + .append_pair("deleteRevisions", &delete_revisions.to_string()); + } + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.api_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_api_revision { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all revisions of an API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiRevisionCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/revisions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod workspace_api_release { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all releases of an API. An API release is created when making an API Revision current. Releases are also used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Returns the details of an API release."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + release_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + release_id: release_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new Release for the API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + release_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + release_id: release_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the release of the API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: API Release Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + release_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + release_id: release_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified release in the API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + release_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + release_id: release_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Returns the etag of an API release."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API identifier. Must be unique in the current API Management service instance."] + #[doc = "* `release_id`: Release identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + release_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + release_id: release_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_service { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiReleaseCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/releases" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiReleaseContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) release_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/releases/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . release_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiReleaseContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) release_id: String, + pub(crate) parameters: models::ApiReleaseContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/releases/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . release_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApiReleaseContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) release_id: String, + pub(crate) parameters: models::ApiReleaseContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/releases/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . release_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) release_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/releases/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . release_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) release_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/releases/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . release_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_api_operation { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the operations for the specified API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + tags: None, + } + } + #[doc = "Gets the details of the API Operation specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new operation in the API or updates an existing one."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Updates the details of the operation in the API specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: API Operation Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the specified operation in the API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the API operation specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_api { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) tags: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Include tags in the response."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) parameters: models::OperationContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) parameters: models::OperationUpdateContract, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_api_operation_policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the list of policy configuration at the API Operation level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_operation( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + subscription_id: impl Into, + ) -> list_by_operation::RequestBuilder { + list_by_operation::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the policy configuration at the API Operation level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + format: None, + } + } + #[doc = "Creates or updates policy configuration for the API Operation level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + policy_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + policy_id: policy_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes the policy configuration at the Api Operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + policy_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the entity state (Etag) version of the API operation policy specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `operation_id`: Operation identifier within an API. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + operation_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + operation_id: operation_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_operation { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] #[doc = r" parameters can be chained."] #[doc = r""] #[doc = r" The building of a request is typically finalized by invoking `.await` on"] @@ -34832,39 +62292,17 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) orderby: Option, } impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "OData order by query option."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byUser", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}/policies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -34881,7 +62319,7 @@ pub mod reports { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -34897,18 +62335,7 @@ pub mod reports { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -34928,13 +62355,13 @@ pub mod reports { } } } - pub mod list_by_operation { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -34943,6 +62370,9 @@ pub mod reports { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -34954,6 +62384,13 @@ pub mod reports { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -34973,109 +62410,68 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) orderby: Option, + pub(crate) format: Option, } impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "OData order by query option."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byOperation", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_product { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -35084,139 +62480,375 @@ pub mod reports { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) operation_id: String, + pub(crate) policy_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/operations/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . operation_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_api_policy { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the policy configuration at the API level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + subscription_id: impl Into, + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the policy configuration at the API level."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), + format: None, + } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Creates or updates policy configuration for the API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + policy_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Deletes the policy configuration at the Api."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + policy_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) filter: String, - pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) orderby: Option, - } - impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "OData order by query option."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byProduct", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) + #[doc = "Gets the entity state (Etag) version of the API policy specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + policy_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + policy_id: policy_id.into(), + subscription_id: subscription_id.into(), } } } - pub mod list_by_geo { + pub mod list_by_api { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -35255,33 +62887,16 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byGeo", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/policies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -35298,7 +62913,7 @@ pub mod reports { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -35314,15 +62929,7 @@ pub mod reports { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -35342,13 +62949,13 @@ pub mod reports { } } } - pub mod list_by_subscription { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -35357,6 +62964,9 @@ pub mod reports { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -35368,6 +62978,13 @@ pub mod reports { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -35387,109 +63004,67 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) orderby: Option, + pub(crate) format: Option, } impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "OData order by query option."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/bySubscription", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_time { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ReportCollection = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -35498,6 +63073,9 @@ pub mod reports { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -35509,6 +63087,13 @@ pub mod reports { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -35528,131 +63113,122 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, - pub(crate) interval: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, - pub(crate) orderby: Option, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "OData order by query option."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byTime", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - let interval = &this.interval; - req.url_mut().query_pairs_mut().append_pair("interval", interval); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_request { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RequestReportCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -35672,23 +63248,12 @@ pub mod reports { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) filter: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -35697,14 +63262,8 @@ pub mod reports { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/reports/byRequest", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -35713,15 +63272,7 @@ pub mod reports { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let filter = &this.filter; - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -35731,60 +63282,166 @@ pub mod reports { } } } -pub mod tenant_settings { +pub mod workspace_api_schema { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Public settings."] + #[doc = "Get the schema configuration at the API level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_api( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_api::RequestBuilder { + list_by_api::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), subscription_id: subscription_id.into(), filter: None, + top: None, + skip: None, } } - #[doc = "Get tenant settings."] + #[doc = "Get the schema configuration at the API level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `settings_type`: The identifier of the settings."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + schema_id: impl Into, subscription_id: impl Into, - settings_type: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + schema_id: schema_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates schema configuration for the API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: The schema contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + schema_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + schema_id: schema_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Deletes the schema configuration at the Api."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + schema_id: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + schema_id: schema_id.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), + force: None, + } + } + #[doc = "Gets the entity state (Etag) version of the schema specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_id`: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number."] + #[doc = "* `schema_id`: Schema id identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + api_id: impl Into, + schema_id: impl Into, + subscription_id: impl Into, + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + api_id: api_id.into(), + schema_id: schema_id.into(), subscription_id: subscription_id.into(), - settings_type: settings_type.into(), } } } - pub mod list_by_service { + pub mod list_by_api { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TenantSettingsCollection = serde_json::from_slice(&bytes)?; + let body: models::SchemaCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -35823,26 +63480,34 @@ pub mod tenant_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Not used"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/settings", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/schemas" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -35859,7 +63524,7 @@ pub mod tenant_settings { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -35875,10 +63540,16 @@ pub mod tenant_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -35902,9 +63573,9 @@ pub mod tenant_settings { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TenantSettingsContract = serde_json::from_slice(&bytes)?; + let body: models::SchemaContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -35953,8 +63624,10 @@ pub mod tenant_settings { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) schema_id: String, pub(crate) subscription_id: String, - pub(crate) settings_type: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -35965,14 +63638,7 @@ pub mod tenant_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/settings/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.settings_type - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/schemas/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . schema_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -35982,7 +63648,7 @@ pub mod tenant_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -35991,8 +63657,8 @@ pub mod tenant_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -36003,48 +63669,142 @@ pub mod tenant_settings { } } } -} -pub mod api_management_skus { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the list of Microsoft.ApiManagement SKUs available for your Subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) schema_id: String, + pub(crate) parameters: models::SchemaContract, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/schemas/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . schema_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } } - pub mod list { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ApiManagementSkusResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) schema_id: String, + pub(crate) if_match: String, + pub(crate) subscription_id: String, + pub(crate) force: Option, } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + impl RequestBuilder { + #[doc = "If true removes all references to the schema before deleting it."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/schemas/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . schema_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } + } + pub mod get_entity_tag { + use super::models; + pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -36062,162 +63822,144 @@ pub mod api_management_skus { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) api_id: String, + pub(crate) schema_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.ApiManagement/skus", - this.client.endpoint(), - &this.subscription_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/apis/{}/schemas/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . api_id , & this . schema_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } } -pub mod subscription { +pub mod workspace_product { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all subscriptions of the API Management service instance."] + #[doc = "Lists a collection of products in the specified workspace in a service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, + expand_groups: None, + tags: None, } } - #[doc = "Gets the specified Subscription entity."] + #[doc = "Gets the details of the product specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - sid: impl Into, + workspace_id: impl Into, + product_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - sid: sid.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates the subscription of specified user to the specified product."] + #[doc = "Creates or Updates a product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `parameters`: Create parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create or update parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - sid: impl Into, - parameters: impl Into, + workspace_id: impl Into, + product_id: impl Into, + parameters: impl Into, subscription_id: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - sid: sid.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), parameters: parameters.into(), subscription_id: subscription_id.into(), - notify: None, if_match: None, - app_type: None, } } - #[doc = "Updates the details of a subscription specified by its identifier."] + #[doc = "Update existing product details."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] #[doc = "* `parameters`: Update parameters."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, resource_group_name: impl Into, service_name: impl Into, - sid: impl Into, - parameters: impl Into, + workspace_id: impl Into, + product_id: impl Into, + parameters: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> update::RequestBuilder { @@ -36225,27 +63967,28 @@ pub mod subscription { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - sid: sid.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), parameters: parameters.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), - notify: None, - app_type: None, } } - #[doc = "Deletes the specified subscription."] + #[doc = "Delete product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - sid: impl Into, + workspace_id: impl Into, + product_id: impl Into, if_match: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { @@ -36253,107 +63996,46 @@ pub mod subscription { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - sid: sid.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), if_match: if_match.into(), subscription_id: subscription_id.into(), + delete_subscriptions: None, } } - #[doc = "Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier."] + #[doc = "Gets the entity state (Etag) version of the product specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, - sid: impl Into, + workspace_id: impl Into, + product_id: impl Into, subscription_id: impl Into, ) -> get_entity_tag::RequestBuilder { get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - sid: sid.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Regenerates primary key of existing subscription of the API Management service instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn regenerate_primary_key( - &self, - resource_group_name: impl Into, - service_name: impl Into, - sid: impl Into, - subscription_id: impl Into, - ) -> regenerate_primary_key::RequestBuilder { - regenerate_primary_key::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - sid: sid.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Regenerates secondary key of existing subscription of the API Management service instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn regenerate_secondary_key( - &self, - resource_group_name: impl Into, - service_name: impl Into, - sid: impl Into, - subscription_id: impl Into, - ) -> regenerate_secondary_key::RequestBuilder { - regenerate_secondary_key::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - sid: sid.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the specified Subscription keys."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_secrets( - &self, - resource_group_name: impl Into, - service_name: impl Into, - sid: impl Into, - subscription_id: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - sid: sid.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + let body: models::ProductCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -36392,13 +64074,16 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, + pub(crate) expand_groups: Option, + pub(crate) tags: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| user | expand | | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| groups | expand | | |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -36413,16 +64098,27 @@ pub mod subscription { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "When set to true, the response contains an array of groups that have visibility to the product. The default is false."] + pub fn expand_groups(mut self, expand_groups: bool) -> Self { + self.expand_groups = Some(expand_groups); + self + } + #[doc = "Products which are part of a specific tag."] + pub fn tags(mut self, tags: impl Into) -> Self { + self.tags = Some(tags.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.service_name + &this.service_name, + &this.workspace_id ))?; let rsp = match continuation { Some(value) => { @@ -36440,7 +64136,7 @@ pub mod subscription { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -36456,7 +64152,7 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -36466,6 +64162,14 @@ pub mod subscription { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } + if let Some(expand_groups) = &this.expand_groups { + req.url_mut() + .query_pairs_mut() + .append_pair("expandGroups", &expand_groups.to_string()); + } + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -36489,9 +64193,9 @@ pub mod subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + let body: models::ProductContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -36540,7 +64244,8 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -36553,12 +64258,13 @@ pub mod subscription { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.sid + &this.workspace_id, + &this.product_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -36569,7 +64275,7 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -36578,8 +64284,8 @@ pub mod subscription { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -36594,9 +64300,9 @@ pub mod subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + let body: models::ProductContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -36645,29 +64351,18 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, - pub(crate) parameters: models::SubscriptionCreateParameters, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) parameters: models::ProductContract, pub(crate) subscription_id: String, - pub(crate) notify: Option, pub(crate) if_match: Option, - pub(crate) app_type: Option, } impl RequestBuilder { - #[doc = "Notify change in Subscription State. \n - If false, do not send any email notification for change of state of subscription \n - If true, send email notification of change of state of subscription "] - pub fn notify(mut self, notify: bool) -> Self { - self.notify = Some(notify); - self - } #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] pub fn if_match(mut self, if_match: impl Into) -> Self { self.if_match = Some(if_match.into()); self } - #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] - pub fn app_type(mut self, app_type: impl Into) -> Self { - self.app_type = Some(app_type.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -36677,12 +64372,13 @@ pub mod subscription { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.sid + &this.workspace_id, + &this.product_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -36693,18 +64389,12 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - if let Some(notify) = &this.notify { - req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); - } if let Some(if_match) = &this.if_match { req.insert_header("if-match", if_match); } - if let Some(app_type) = &this.app_type { - req.url_mut().query_pairs_mut().append_pair("appType", app_type); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -36712,8 +64402,8 @@ pub mod subscription { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -36728,9 +64418,9 @@ pub mod subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + let body: models::ProductContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -36779,24 +64469,13 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, - pub(crate) parameters: models::SubscriptionUpdateParameters, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) parameters: models::ProductUpdateParameters, pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) notify: Option, - pub(crate) app_type: Option, } impl RequestBuilder { - #[doc = "Notify change in Subscription State. \n - If false, do not send any email notification for change of state of subscription \n - If true, send email notification of change of state of subscription "] - pub fn notify(mut self, notify: bool) -> Self { - self.notify = Some(notify); - self - } - #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] - pub fn app_type(mut self, app_type: impl Into) -> Self { - self.app_type = Some(app_type.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -36806,12 +64485,13 @@ pub mod subscription { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.sid + &this.workspace_id, + &this.product_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -36822,16 +64502,10 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - if let Some(notify) = &this.notify { - req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); - } req.insert_header("if-match", &this.if_match); - if let Some(app_type) = &this.app_type { - req.url_mut().query_pairs_mut().append_pair("appType", app_type); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -36839,8 +64513,8 @@ pub mod subscription { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -36873,11 +64547,18 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, pub(crate) if_match: String, pub(crate) subscription_id: String, + pub(crate) delete_subscriptions: Option, } impl RequestBuilder { + #[doc = "Delete existing subscriptions associated with the product or not."] + pub fn delete_subscriptions(mut self, delete_subscriptions: bool) -> Self { + self.delete_subscriptions = Some(delete_subscriptions); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -36887,12 +64568,13 @@ pub mod subscription { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.sid + &this.workspace_id, + &this.product_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -36903,8 +64585,13 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("if-match", &this.if_match); + if let Some(delete_subscriptions) = &this.delete_subscriptions { + req.url_mut() + .query_pairs_mut() + .append_pair("deleteSubscriptions", &delete_subscriptions.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -36935,7 +64622,8 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -36948,12 +64636,13 @@ pub mod subscription { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.sid + &this.workspace_id, + &this.product_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); @@ -36964,7 +64653,7 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -36973,9 +64662,153 @@ pub mod subscription { } } } - pub mod regenerate_primary_key { +} +pub mod workspace_product_api_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the API links associated with a product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the API link for the product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Product-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds an API to the specified product via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Product-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified API from the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Product-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + api_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + api_link_id: api_link_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list_by_product { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductApiLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -36995,7 +64828,153 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/apiLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductApiLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) api_link_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -37007,8 +64986,8 @@ pub mod subscription { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . sid)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/apiLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . api_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -37017,19 +64996,53 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - } - pub mod regenerate_secondary_key { - use super::models; - pub struct Response(azure_core::Response); + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductApiLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -37049,8 +65062,11 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) api_link_id: String, pub(crate) subscription_id: String, + pub(crate) parameters: models::ProductApiLinkContract, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -37061,8 +65077,8 @@ pub mod subscription { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . sid)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/apiLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . api_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -37071,52 +65087,31 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod list_secrets { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionKeysContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -37136,7 +65131,9 @@ pub mod subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) api_link_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -37148,8 +65145,8 @@ pub mod subscription { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/subscriptions/{}/listSecrets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . sid)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/apiLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . api_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -37158,63 +65155,143 @@ pub mod subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod tag_resource { +pub mod workspace_product_group_link { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of resources associated with tags."] + #[doc = "Lists a collection of the group links associated with a product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } + #[doc = "Gets the group link for the product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_link_id`: Product-Group link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + group_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + group_link_id: group_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds a group to the specified product via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_link_id`: Product-Group link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + group_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + group_link_id: group_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified group from the specified product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `group_link_id`: Product-Group link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + group_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + group_link_id: group_link_id.into(), + subscription_id: subscription_id.into(), + } + } } - pub mod list_by_service { + pub mod list_by_product { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TagResourceCollection = serde_json::from_slice(&bytes)?; + let body: models::ProductGroupLinkCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -37253,13 +65330,15 @@ pub mod tag_resource { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| isCurrent | filter | eq | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| groupId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -37274,17 +65353,11 @@ pub mod tag_resource { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tagResources", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/groupLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -37301,7 +65374,7 @@ pub mod tag_resource { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -37317,7 +65390,7 @@ pub mod tag_resource { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -37346,325 +65419,411 @@ pub mod tag_resource { } } } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductGroupLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) group_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/groupLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . group_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ProductGroupLinkContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) group_link_id: String, + pub(crate) subscription_id: String, + pub(crate) parameters: models::ProductGroupLinkContract, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/groupLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . group_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) group_link_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/groupLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . group_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } -pub mod tenant_access { +pub mod workspace_product_policy { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Returns list of access infos - for Git and Management endpoints."] + #[doc = "Get the policy configuration at the Product level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), subscription_id: subscription_id.into(), - filter: None, } } - #[doc = "Get tenant access information details without secrets."] + #[doc = "Get the policy configuration at the Product level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + policy_id: impl Into, subscription_id: impl Into, - access_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), subscription_id: subscription_id.into(), - access_name: access_name.into(), - } - } - #[doc = "Update tenant access information details."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Parameters supplied to retrieve the Tenant Access Information."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - access_name: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - access_name: access_name.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), + format: None, } } - #[doc = "Update tenant access information details."] + #[doc = "Creates or updates policy configuration for the Product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Parameters supplied to retrieve the Tenant Access Information."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `parameters`: The policy contents to apply."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - parameters: impl Into, - access_name: impl Into, - if_match: impl Into, + workspace_id: impl Into, + product_id: impl Into, + policy_id: impl Into, + parameters: impl Into, subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), parameters: parameters.into(), - access_name: access_name.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Tenant access metadata"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - access_name: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - access_name: access_name.into(), - } - } - #[doc = "Regenerate primary access key"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - pub fn regenerate_primary_key( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - access_name: impl Into, - ) -> regenerate_primary_key::RequestBuilder { - regenerate_primary_key::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), subscription_id: subscription_id.into(), - access_name: access_name.into(), + if_match: None, } } - #[doc = "Regenerate secondary access key"] + #[doc = "Deletes the policy configuration at the Product."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - pub fn regenerate_secondary_key( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + policy_id: impl Into, + if_match: impl Into, subscription_id: impl Into, - access_name: impl Into, - ) -> regenerate_secondary_key::RequestBuilder { - regenerate_secondary_key::RequestBuilder { + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), - access_name: access_name.into(), } } - #[doc = "Get tenant access information details."] + #[doc = "Get the ETag of the policy configuration at the Product level."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - pub fn list_secrets( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_id`: Product identifier. Must be unique in the current API Management service instance."] + #[doc = "* `policy_id`: The identifier of the Policy."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_tag( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + product_id: impl Into, + policy_id: impl Into, subscription_id: impl Into, - access_name: impl Into, - ) -> list_secrets::RequestBuilder { - list_secrets::RequestBuilder { + ) -> get_entity_tag::RequestBuilder { + get_entity_tag::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + product_id: product_id.into(), + policy_id: policy_id.into(), subscription_id: subscription_id.into(), - access_name: access_name.into(), - } - } - } - pub mod list_by_service { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessInformationCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) subscription_id: String, - pub(crate) filter: Option, - } - impl RequestBuilder { - #[doc = "Not used"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) } } } - pub mod get { + pub mod list_by_product { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AccessInformationContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -37673,9 +65832,6 @@ pub mod tenant_access { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -37687,13 +65843,6 @@ pub mod tenant_access { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -37713,8 +65862,9 @@ pub mod tenant_access { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, pub(crate) subscription_id: String, - pub(crate) access_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -37725,14 +65875,7 @@ pub mod tenant_access { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.access_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/policies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -37742,7 +65885,7 @@ pub mod tenant_access { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -37751,8 +65894,8 @@ pub mod tenant_access { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -37763,13 +65906,13 @@ pub mod tenant_access { } } } - pub mod create { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AccessInformationContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -37818,12 +65961,18 @@ pub mod tenant_access { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::AccessInformationCreateParameters, - pub(crate) access_name: String, - pub(crate) if_match: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, + pub(crate) format: Option, } impl RequestBuilder { + #[doc = "Policy Export Format."] + pub fn format(mut self, format: impl Into) -> Self { + self.format = Some(format.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -37832,15 +65981,8 @@ pub mod tenant_access { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.access_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -37849,10 +65991,11 @@ pub mod tenant_access { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(format) = &this.format { + req.url_mut().query_pairs_mut().append_pair("format", format); + } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -37860,8 +66003,8 @@ pub mod tenant_access { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -37872,13 +66015,13 @@ pub mod tenant_access { } } } - pub mod update { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AccessInformationContract = serde_json::from_slice(&bytes)?; + let body: models::PolicyContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -37927,12 +66070,19 @@ pub mod tenant_access { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::AccessInformationUpdateParameters, - pub(crate) access_name: String, - pub(crate) if_match: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, + pub(crate) parameters: models::PolicyContract, pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -37941,15 +66091,8 @@ pub mod tenant_access { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.access_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -37958,10 +66101,12 @@ pub mod tenant_access { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -37969,8 +66114,8 @@ pub mod tenant_access { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -37981,67 +66126,7 @@ pub mod tenant_access { } } } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) subscription_id: String, - pub(crate) access_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.access_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod regenerate_primary_key { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -38063,8 +66148,11 @@ pub mod tenant_access { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) access_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -38075,8 +66163,8 @@ pub mod tenant_access { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38085,9 +66173,9 @@ pub mod tenant_access { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -38095,7 +66183,7 @@ pub mod tenant_access { } } } - pub mod regenerate_secondary_key { + pub mod get_entity_tag { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -38117,8 +66205,10 @@ pub mod tenant_access { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) product_id: String, + pub(crate) policy_id: String, pub(crate) subscription_id: String, - pub(crate) access_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -38129,8 +66219,8 @@ pub mod tenant_access { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/products/{}/policies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . product_id , & this . policy_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38139,9 +66229,8 @@ pub mod tenant_access { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -38149,165 +66238,202 @@ pub mod tenant_access { } } } - pub mod list_secrets { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AccessInformationSecretsContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() +} +pub mod workspace_tag { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of tags defined within a workspace in a service instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_service( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + subscription_id: impl Into, + ) -> list_by_service::RequestBuilder { + list_by_service::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + scope: None, } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + #[doc = "Gets the details of the tag specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + subscription_id: subscription_id.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) subscription_id: String, - pub(crate) access_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/listSecrets", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.access_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + #[doc = "Creates a tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Create parameters."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + #[doc = "Updates the details of the tag specified by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `parameters`: Update parameters."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + parameters: impl Into, + if_match: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + parameters: parameters.into(), + if_match: if_match.into(), + subscription_id: subscription_id.into(), } } - } -} -pub mod tenant_access_git { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Regenerate primary access key for GIT."] + #[doc = "Deletes specific tag of the workspace in an API Management service instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - pub fn regenerate_primary_key( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + if_match: impl Into, subscription_id: impl Into, - access_name: impl Into, - ) -> regenerate_primary_key::RequestBuilder { - regenerate_primary_key::RequestBuilder { + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + if_match: if_match.into(), subscription_id: subscription_id.into(), - access_name: access_name.into(), } } - #[doc = "Regenerate secondary access key for GIT."] + #[doc = "Gets the entity state version of the tag specified by its identifier."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `access_name`: The identifier of the Access configuration."] - pub fn regenerate_secondary_key( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get_entity_state( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, subscription_id: impl Into, - access_name: impl Into, - ) -> regenerate_secondary_key::RequestBuilder { - regenerate_secondary_key::RequestBuilder { + ) -> get_entity_state::RequestBuilder { + get_entity_state::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), subscription_id: subscription_id.into(), - access_name: access_name.into(), } } } - pub mod regenerate_primary_key { + pub mod list_by_service { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -38327,41 +66453,146 @@ pub mod tenant_access_git { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, pub(crate) subscription_id: String, - pub(crate) access_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + pub(crate) scope: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + #[doc = "Scope like 'apis', 'products' or 'apis/{apiId}"] + pub fn scope(mut self, scope: impl Into) -> Self { + self.scope = Some(scope.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/git/regeneratePrimaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + if let Some(scope) = &this.scope { + req.url_mut().query_pairs_mut().append_pair("scope", scope); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod regenerate_secondary_key { + pub mod get { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -38381,8 +66612,9 @@ pub mod tenant_access_git { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, pub(crate) subscription_id: String, - pub(crate) access_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -38393,8 +66625,16 @@ pub mod tenant_access_git { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/git/regenerateSecondaryKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . access_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.service_name, + &this.workspace_id, + &this.tag_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38403,122 +66643,63 @@ pub mod tenant_access_git { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } -} -pub mod tenant_configuration { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Deploy Configuration parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] - pub fn deploy( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - configuration_name: impl Into, - ) -> deploy::RequestBuilder { - deploy::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - configuration_name: configuration_name.into(), + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) } } - #[doc = "This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Save Configuration parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] - pub fn save( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - configuration_name: impl Into, - ) -> save::RequestBuilder { - save::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - configuration_name: configuration_name.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `parameters`: Validate Configuration parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] - pub fn validate( - &self, - resource_group_name: impl Into, - service_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - configuration_name: impl Into, - ) -> validate::RequestBuilder { - validate::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - configuration_name: configuration_name.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Gets the status of the most recent synchronization between the configuration database and the Git repository."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `configuration_name`: The identifier of the Git Configuration Operation."] - pub fn get_sync_state( - &self, - resource_group_name: impl Into, - service_name: impl Into, - subscription_id: impl Into, - configuration_name: impl Into, - ) -> get_sync_state::RequestBuilder { - get_sync_state::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - subscription_id: subscription_id.into(), - configuration_name: configuration_name.into(), + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) } } - } - pub mod deploy { - use super::models; - pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -38538,12 +66719,18 @@ pub mod tenant_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::DeployConfigurationParameters, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) parameters: models::TagCreateUpdateParameters, pub(crate) subscription_id: String, - pub(crate) configuration_name: String, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -38553,14 +66740,15 @@ pub mod tenant_configuration { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/deploy", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.configuration_name + &this.workspace_id, + &this.tag_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38569,19 +66757,67 @@ pub mod tenant_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod save { + pub mod update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagContract = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -38601,12 +66837,13 @@ pub mod tenant_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::SaveConfigurationParameter, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) parameters: models::TagCreateUpdateParameters, + pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) configuration_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -38616,14 +66853,15 @@ pub mod tenant_configuration { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/save", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.configuration_name + &this.workspace_id, + &this.tag_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38632,17 +66870,30 @@ pub mod tenant_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; + req.insert_header("if-match", &this.if_match); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod validate { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -38664,12 +66915,12 @@ pub mod tenant_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) parameters: models::DeployConfigurationParameters, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) if_match: String, pub(crate) subscription_id: String, - pub(crate) configuration_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -38679,14 +66930,15 @@ pub mod tenant_configuration { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/validate", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.configuration_name + &this.workspace_id, + &this.tag_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38695,9 +66947,9 @@ pub mod tenant_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("if-match", &this.if_match); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -38705,32 +66957,9 @@ pub mod tenant_configuration { } } } - pub mod get_sync_state { + pub mod get_entity_state { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TenantConfigurationSyncStateContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -38750,8 +66979,9 @@ pub mod tenant_configuration { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, pub(crate) subscription_id: String, - pub(crate) configuration_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -38763,14 +66993,15 @@ pub mod tenant_configuration { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/tenant/{}/syncState", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, &this.service_name, - &this.configuration_name + &this.workspace_id, + &this.tag_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Head); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -38779,237 +67010,143 @@ pub mod tenant_configuration { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }) } } } } -pub mod user { +pub mod workspace_tag_api_link { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists a collection of registered users in the specified service instance."] + #[doc = "Lists a collection of the API links associated with a tag."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_service( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( &self, resource_group_name: impl Into, service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, subscription_id: impl Into, - ) -> list_by_service::RequestBuilder { - list_by_service::RequestBuilder { + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, - expand_groups: None, } } - #[doc = "Gets the details of the user specified by its identifier."] + #[doc = "Gets the API link for the tag."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Tag-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - user_id: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + api_link_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - user_id: user_id.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + api_link_id: api_link_id.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or Updates a user."] + #[doc = "Adds an API to the specified tag via link."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Tag-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `parameters`: Create or update parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] pub fn create_or_update( &self, resource_group_name: impl Into, service_name: impl Into, - user_id: impl Into, - parameters: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + api_link_id: impl Into, subscription_id: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - user_id: user_id.into(), - parameters: parameters.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + api_link_id: api_link_id.into(), subscription_id: subscription_id.into(), - notify: None, - if_match: None, - } - } - #[doc = "Updates the details of the user specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Update parameters."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn update( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - parameters: impl Into, - if_match: impl Into, - subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), parameters: parameters.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), } } - #[doc = "Deletes specific user."] + #[doc = "Deletes the specified API from the specified tag."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `if_match`: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `api_link_id`: Tag-API link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, resource_group_name: impl Into, service_name: impl Into, - user_id: impl Into, - if_match: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + api_link_id: impl Into, subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - user_id: user_id.into(), - if_match: if_match.into(), - subscription_id: subscription_id.into(), - delete_subscriptions: None, - notify: None, - app_type: None, - } - } - #[doc = "Gets the entity state (Etag) version of the user specified by its identifier."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_entity_tag( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - subscription_id: impl Into, - ) -> get_entity_tag::RequestBuilder { - get_entity_tag::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn generate_sso_url( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - subscription_id: impl Into, - ) -> generate_sso_url::RequestBuilder { - generate_sso_url::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the Shared Access Authorization Token for the User."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `parameters`: Create Authorization Token parameters."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get_shared_access_token( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> get_shared_access_token::RequestBuilder { - get_shared_access_token::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), - parameters: parameters.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + api_link_id: api_link_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list_by_service { + pub mod list_by_product { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserCollection = serde_json::from_slice(&bytes)?; + let body: models::TagApiLinkCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -39048,14 +67185,15 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, - pub(crate) expand_groups: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| groups | expand | | |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -39070,22 +67208,11 @@ pub mod user { self.skip = Some(skip); self } - #[doc = "Detailed Group in response."] - pub fn expand_groups(mut self, expand_groups: bool) -> Self { - self.expand_groups = Some(expand_groups); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/apiLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -39102,7 +67229,7 @@ pub mod user { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -39118,7 +67245,7 @@ pub mod user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -39128,11 +67255,6 @@ pub mod user { if let Some(skip) = &this.skip { req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); } - if let Some(expand_groups) = &this.expand_groups { - req.url_mut() - .query_pairs_mut() - .append_pair("expandGroups", &expand_groups.to_string()); - } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -39156,9 +67278,9 @@ pub mod user { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserContract = serde_json::from_slice(&bytes)?; + let body: models::TagApiLinkContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -39207,7 +67329,9 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) api_link_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -39219,14 +67343,7 @@ pub mod user { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/apiLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . api_link_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -39236,7 +67353,7 @@ pub mod user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -39245,8 +67362,8 @@ pub mod user { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -39261,9 +67378,9 @@ pub mod user { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserContract = serde_json::from_slice(&bytes)?; + let body: models::TagApiLinkContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -39272,9 +67389,6 @@ pub mod user { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -39286,13 +67400,6 @@ pub mod user { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -39312,23 +67419,13 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, - pub(crate) parameters: models::UserCreateParameters, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) api_link_id: String, pub(crate) subscription_id: String, - pub(crate) notify: Option, - pub(crate) if_match: Option, + pub(crate) parameters: models::TagApiLinkContract, } impl RequestBuilder { - #[doc = "Send an Email notification to the User."] - pub fn notify(mut self, notify: bool) -> Self { - self.notify = Some(notify); - self - } - #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -39337,14 +67434,7 @@ pub mod user { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/apiLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . api_link_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -39354,15 +67444,9 @@ pub mod user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; - if let Some(notify) = &this.notify { - req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); - } - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -39370,8 +67454,8 @@ pub mod user { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -39382,42 +67466,9 @@ pub mod user { } } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::UserContract = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] - pub fn e_tag(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -39437,9 +67488,9 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, - pub(crate) parameters: models::UserUpdateParameters, - pub(crate) if_match: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) api_link_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -39451,15 +67502,8 @@ pub mod user { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/apiLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . api_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -39468,32 +67512,162 @@ pub mod user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.insert_header("if-match", &this.if_match); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod workspace_tag_operation_link { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists a collection of the operation links associated with a tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + subscription_id: impl Into, + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + skip: None, + } + } + #[doc = "Gets the operation link for the tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `operation_link_id`: Tag-operation link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + operation_link_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + operation_link_id: operation_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds an operation to the specified tag via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `operation_link_id`: Tag-operation link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + operation_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + operation_link_id: operation_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified operation from the specified tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `operation_link_id`: Tag-operation link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + operation_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + operation_link_id: operation_link_id.into(), + subscription_id: subscription_id.into(), } } } - pub mod delete { + pub mod list_by_product { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TagOperationLinkCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -39513,142 +67687,102 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, - pub(crate) if_match: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, pub(crate) subscription_id: String, - pub(crate) delete_subscriptions: Option, - pub(crate) notify: Option, - pub(crate) app_type: Option, + pub(crate) filter: Option, + pub(crate) top: Option, + pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "Whether to delete user's subscription or not."] - pub fn delete_subscriptions(mut self, delete_subscriptions: bool) -> Self { - self.delete_subscriptions = Some(delete_subscriptions); + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| operationId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); self } - #[doc = "Send an Account Closed Email notification to the User."] - pub fn notify(mut self, notify: bool) -> Self { - self.notify = Some(notify); + #[doc = "Number of records to return."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self } - #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] - pub fn app_type(mut self, app_type: impl Into) -> Self { - self.app_type = Some(app_type.into()); + #[doc = "Number of records to skip."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(delete_subscriptions) = &this.delete_subscriptions { - req.url_mut() - .query_pairs_mut() - .append_pair("deleteSubscriptions", &delete_subscriptions.to_string()); - } - if let Some(notify) = &this.notify { - req.url_mut().query_pairs_mut().append_pair("notify", ¬ify.to_string()); - } - req.insert_header("if-match", &this.if_match); - if let Some(app_type) = &this.app_type { - req.url_mut().query_pairs_mut().append_pair("appType", app_type); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod get_entity_tag { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) user_id: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Head); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/operationLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod generate_sso_url { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::GenerateSsoUrlResult = serde_json::from_slice(&bytes)?; + let body: models::TagOperationLinkContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -39657,6 +67791,9 @@ pub mod user { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -39668,6 +67805,13 @@ pub mod user { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests."] + pub fn e_tag(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("etag")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -39687,7 +67831,9 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) operation_link_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -39699,15 +67845,8 @@ pub mod user { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/generateSsoUrl", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/operationLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . operation_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -39716,9 +67855,8 @@ pub mod user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -39726,8 +67864,8 @@ pub mod user { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -39738,13 +67876,13 @@ pub mod user { } } } - pub mod get_shared_access_token { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserTokenResult = serde_json::from_slice(&bytes)?; + let body: models::TagOperationLinkContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -39783,9 +67921,11 @@ pub mod user { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, - pub(crate) parameters: models::UserTokenParameters, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) operation_link_id: String, pub(crate) subscription_id: String, + pub(crate) parameters: models::TagOperationLinkContract, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -39796,15 +67936,8 @@ pub mod user { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/token", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/operationLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . operation_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -39813,7 +67946,7 @@ pub mod user { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -39823,8 +67956,8 @@ pub mod user { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -39835,63 +67968,9 @@ pub mod user { } } } -} -pub mod user_group { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all user groups."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), - subscription_id: subscription_id.into(), - filter: None, - top: None, - skip: None, - } - } - } - pub mod list { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GroupCollection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -39911,164 +67990,167 @@ pub mod user_group { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) operation_link_id: String, pub(crate) subscription_id: String, - pub(crate) filter: Option, - pub(crate) top: Option, - pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Number of records to return."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Number of records to skip."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/groups", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/operationLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . operation_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } } -pub mod user_subscription { +pub mod workspace_tag_product_link { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists the collection of subscriptions of the specified user."] + #[doc = "Lists a collection of the product links associated with a tag."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list( + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_product( &self, resource_group_name: impl Into, service_name: impl Into, - user_id: impl Into, + workspace_id: impl Into, + tag_id: impl Into, subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + ) -> list_by_product::RequestBuilder { + list_by_product::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - user_id: user_id.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), subscription_id: subscription_id.into(), filter: None, top: None, skip: None, } } - #[doc = "Gets the specified Subscription entity associated with a particular user."] + #[doc = "Gets the product link for the tag."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `sid`: Subscription entity Identifier. The entity represents the association between a user and a product in API Management."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_link_id`: Tag-product link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, resource_group_name: impl Into, service_name: impl Into, - user_id: impl Into, - sid: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + product_link_id: impl Into, subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), service_name: service_name.into(), - user_id: user_id.into(), - sid: sid.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + product_link_id: product_link_id.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds a product to the specified tag via link."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_link_id`: Tag-product link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Create or update parameters."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + product_link_id: impl Into, + subscription_id: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + product_link_id: product_link_id.into(), + subscription_id: subscription_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified product from the specified tag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `service_name`: The name of the API Management service."] + #[doc = "* `workspace_id`: Workspace identifier. Must be unique in the current API Management service instance."] + #[doc = "* `tag_id`: Tag identifier. Must be unique in the current API Management service instance."] + #[doc = "* `product_link_id`: Tag-product link identifier. Must be unique in the current API Management service instance."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + service_name: impl Into, + workspace_id: impl Into, + tag_id: impl Into, + product_link_id: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + service_name: service_name.into(), + workspace_id: workspace_id.into(), + tag_id: tag_id.into(), + product_link_id: product_link_id.into(), subscription_id: subscription_id.into(), } } } - pub mod list { + pub mod list_by_product { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionCollection = serde_json::from_slice(&bytes)?; + let body: models::TagProductLinkCollection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -40107,14 +68189,15 @@ pub mod user_subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, pub(crate) subscription_id: String, pub(crate) filter: Option, pub(crate) top: Option, pub(crate) skip: Option, } impl RequestBuilder { - #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|------------------------|-----------------------------------|
|name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
|productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] + #[doc = "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
"] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self @@ -40129,18 +68212,11 @@ pub mod user_subscription { self.skip = Some(skip); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/subscriptions", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/productLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -40157,7 +68233,7 @@ pub mod user_subscription { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -40173,7 +68249,7 @@ pub mod user_subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -40206,9 +68282,9 @@ pub mod user_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SubscriptionContract = serde_json::from_slice(&bytes)?; + let body: models::TagProductLinkContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -40257,8 +68333,9 @@ pub mod user_subscription { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, - pub(crate) sid: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) product_link_id: String, pub(crate) subscription_id: String, } impl RequestBuilder { @@ -40270,15 +68347,7 @@ pub mod user_subscription { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/subscriptions/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id, - &this.sid - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/productLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . product_link_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -40288,7 +68357,7 @@ pub mod user_subscription { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -40297,8 +68366,8 @@ pub mod user_subscription { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -40309,41 +68378,13 @@ pub mod user_subscription { } } } -} -pub mod user_identities { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List of all user identities."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod list { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UserIdentityCollection = serde_json::from_slice(&bytes)?; + let body: models::TagProductLinkContract = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -40382,104 +68423,54 @@ pub mod user_identities { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) product_link_id: String, pub(crate) subscription_id: String, + pub(crate) parameters: models::TagProductLinkContract, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/identities", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.service_name, - &this.user_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/productLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . product_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } - } -} -pub mod user_confirmation_password { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Sends confirmation"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `user_id`: User identifier. Must be unique in the current API Management service instance."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn send( - &self, - resource_group_name: impl Into, - service_name: impl Into, - user_id: impl Into, - subscription_id: impl Into, - ) -> send::RequestBuilder { - send::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - user_id: user_id.into(), - subscription_id: subscription_id.into(), - app_type: None, + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod send { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -40501,16 +68492,12 @@ pub mod user_confirmation_password { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) service_name: String, - pub(crate) user_id: String, + pub(crate) workspace_id: String, + pub(crate) tag_id: String, + pub(crate) product_link_id: String, pub(crate) subscription_id: String, - pub(crate) app_type: Option, } impl RequestBuilder { - #[doc = "Determines the type of application which send the create user request. Default is legacy publisher portal."] - pub fn app_type(mut self, app_type: impl Into) -> Self { - self.app_type = Some(app_type.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -40519,8 +68506,8 @@ pub mod user_confirmation_password { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/users/{}/confirmations/password/send" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . user_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/workspaces/{}/tags/{}/productLinks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . workspace_id , & this . tag_id , & this . product_link_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -40529,12 +68516,8 @@ pub mod user_confirmation_password { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01-preview"); - if let Some(app_type) = &this.app_type { - req.url_mut().query_pairs_mut().append_pair("appType", app_type); - } + .append_pair(azure_core::query_param::API_VERSION, "2022-09-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } diff --git a/services/mgmt/apimanagement/src/package_preview_2020_06/models.rs b/services/mgmt/apimanagement/src/package_preview_2022_09/models.rs similarity index 71% rename from services/mgmt/apimanagement/src/package_preview_2020_06/models.rs rename to services/mgmt/apimanagement/src/package_preview_2022_09/models.rs index b490f36dec..815617b1b7 100644 --- a/services/mgmt/apimanagement/src/package_preview_2020_06/models.rs +++ b/services/mgmt/apimanagement/src/package_preview_2022_09/models.rs @@ -35,7 +35,7 @@ impl AccessInformationCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessInformationContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Tenant access information contract of the API Management service."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -48,6 +48,9 @@ impl AccessInformationContract { #[doc = "Tenant access information contract of the API Management service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AccessInformationContractProperties { + #[doc = "Access Information type ('access' or 'gitAccess')"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, #[doc = "Principal (User) Identifier."] #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] pub principal_id: Option, @@ -171,15 +174,32 @@ pub struct AdditionalLocation { skip_serializing_if = "Vec::is_empty" )] pub private_ip_addresses: Vec, + #[doc = "Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported only for Premium SKU being deployed in Virtual Network."] + #[serde(rename = "publicIpAddressId", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address_id: Option, #[doc = "Configuration of a virtual network to which API Management service is deployed."] #[serde(rename = "virtualNetworkConfiguration", default, skip_serializing_if = "Option::is_none")] pub virtual_network_configuration: Option, #[doc = "Gateway URL of the API Management service in the Region."] #[serde(rename = "gatewayRegionalUrl", default, skip_serializing_if = "Option::is_none")] pub gateway_regional_url: Option, + #[doc = "Property can be used to enable NAT Gateway for this API Management service."] + #[serde(rename = "natGatewayState", default, skip_serializing_if = "Option::is_none")] + pub nat_gateway_state: Option, + #[doc = "Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on stv2 platform."] + #[serde( + rename = "outboundPublicIPAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub outbound_public_ip_addresses: Vec, #[doc = "Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location."] #[serde(rename = "disableGateway", default, skip_serializing_if = "Option::is_none")] pub disable_gateway: Option, + #[doc = "Compute Platform Version running the service."] + #[serde(rename = "platformVersion", default, skip_serializing_if = "Option::is_none")] + pub platform_version: Option, } impl AdditionalLocation { pub fn new(location: String, sku: ApiManagementServiceSkuProperties) -> Self { @@ -189,13 +209,110 @@ impl AdditionalLocation { zones: Vec::new(), public_ip_addresses: Vec::new(), private_ip_addresses: Vec::new(), + public_ip_address_id: None, virtual_network_configuration: None, gateway_regional_url: None, + nat_gateway_state: None, + outbound_public_ip_addresses: Vec::new(), disable_gateway: None, + platform_version: None, + } + } +} +pub mod additional_location { + use super::*; + #[doc = "Property can be used to enable NAT Gateway for this API Management service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "NatGatewayState")] + pub enum NatGatewayState { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for NatGatewayState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for NatGatewayState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for NatGatewayState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("NatGatewayState", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("NatGatewayState", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for NatGatewayState { + fn default() -> Self { + Self::Disabled + } + } + #[doc = "Compute Platform Version running the service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PlatformVersion")] + pub enum PlatformVersion { + #[serde(rename = "undetermined")] + Undetermined, + #[serde(rename = "stv1")] + Stv1, + #[serde(rename = "stv2")] + Stv2, + #[serde(rename = "mtv1")] + Mtv1, + #[serde(rename = "stv2.1")] + Stv21, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PlatformVersion { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PlatformVersion { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PlatformVersion { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Undetermined => serializer.serialize_unit_variant("PlatformVersion", 0u32, "undetermined"), + Self::Stv1 => serializer.serialize_unit_variant("PlatformVersion", 1u32, "stv1"), + Self::Stv2 => serializer.serialize_unit_variant("PlatformVersion", 2u32, "stv2"), + Self::Mtv1 => serializer.serialize_unit_variant("PlatformVersion", 3u32, "mtv1"), + Self::Stv21 => serializer.serialize_unit_variant("PlatformVersion", 4u32, "stv2.1"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } } -#[doc = "Paged Api list representation."] +#[doc = "Paged API list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiCollection { #[doc = "Page values."] @@ -223,12 +340,30 @@ impl ApiCollection { Self::default() } } -#[doc = "Api details."] +#[doc = "API contact information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApiContactInformation { + #[doc = "The identifying name of the contact person/organization"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The URL pointing to the contact information. MUST be in the format of a URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, + #[doc = "The email address of the contact person/organization. MUST be in the format of an email address"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, +} +impl ApiContactInformation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "API details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiContract { #[serde(flatten)] - pub resource: Resource, - #[doc = "Api Entity Properties"] + pub proxy_resource: ProxyResource, + #[doc = "API Entity Properties"] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -237,7 +372,7 @@ impl ApiContract { Self::default() } } -#[doc = "Api Entity Properties"] +#[doc = "API Entity Properties"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiContractProperties { #[serde(flatten)] @@ -307,7 +442,7 @@ impl ApiContractUpdateProperties { #[doc = "API Create or Update Parameters."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiCreateOrUpdateParameter { - #[doc = "Api Create or Update Properties."] + #[doc = "API Create or Update Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -316,7 +451,7 @@ impl ApiCreateOrUpdateParameter { Self::default() } } -#[doc = "Api Create or Update Properties."] +#[doc = "API Create or Update Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiCreateOrUpdateProperties { #[serde(flatten)] @@ -330,9 +465,12 @@ pub struct ApiCreateOrUpdateProperties { #[doc = "Criteria to limit import of WSDL to a subset of the document."] #[serde(rename = "wsdlSelector", default, skip_serializing_if = "Option::is_none")] pub wsdl_selector: Option, - #[doc = "Type of Api to create. \n * `http` creates a SOAP to REST API \n * `soap` creates a SOAP pass-through API ."] + #[doc = "Type of API to create. \n * `http` creates a REST API \n * `soap` creates a SOAP pass-through API \n * `websocket` creates websocket API \n * `graphql` creates GraphQL API."] #[serde(rename = "apiType", default, skip_serializing_if = "Option::is_none")] pub api_type: Option, + #[doc = "Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: 'template', 'query'"] + #[serde(rename = "translateRequiredQueryParameters", default, skip_serializing_if = "Option::is_none")] + pub translate_required_query_parameters: Option, } impl ApiCreateOrUpdateProperties { pub fn new(api_contract_properties: ApiContractProperties) -> Self { @@ -342,6 +480,7 @@ impl ApiCreateOrUpdateProperties { format: None, wsdl_selector: None, api_type: None, + translate_required_query_parameters: None, } } } @@ -371,6 +510,8 @@ pub mod api_create_or_update_properties { OpenapiLink, #[serde(rename = "openapi+json-link")] OpenapiJsonLink, + #[serde(rename = "graphql-link")] + GraphqlLink, #[serde(skip_deserializing)] UnknownValue(String), } @@ -406,6 +547,7 @@ pub mod api_create_or_update_properties { Self::OpenapiJson => serializer.serialize_unit_variant("Format", 7u32, "openapi+json"), Self::OpenapiLink => serializer.serialize_unit_variant("Format", 8u32, "openapi-link"), Self::OpenapiJsonLink => serializer.serialize_unit_variant("Format", 9u32, "openapi+json-link"), + Self::GraphqlLink => serializer.serialize_unit_variant("Format", 10u32, "graphql-link"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -425,7 +567,7 @@ pub mod api_create_or_update_properties { Self::default() } } - #[doc = "Type of Api to create. \n * `http` creates a SOAP to REST API \n * `soap` creates a SOAP pass-through API ."] + #[doc = "Type of API to create. \n * `http` creates a REST API \n * `soap` creates a SOAP pass-through API \n * `websocket` creates websocket API \n * `graphql` creates GraphQL API."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ApiType")] pub enum ApiType { @@ -433,6 +575,10 @@ pub mod api_create_or_update_properties { Http, #[serde(rename = "soap")] Soap, + #[serde(rename = "websocket")] + Websocket, + #[serde(rename = "graphql")] + Graphql, #[serde(skip_deserializing)] UnknownValue(String), } @@ -460,6 +606,47 @@ pub mod api_create_or_update_properties { match self { Self::Http => serializer.serialize_unit_variant("ApiType", 0u32, "http"), Self::Soap => serializer.serialize_unit_variant("ApiType", 1u32, "soap"), + Self::Websocket => serializer.serialize_unit_variant("ApiType", 2u32, "websocket"), + Self::Graphql => serializer.serialize_unit_variant("ApiType", 3u32, "graphql"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: 'template', 'query'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "TranslateRequiredQueryParameters")] + pub enum TranslateRequiredQueryParameters { + #[serde(rename = "template")] + Template, + #[serde(rename = "query")] + Query, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for TranslateRequiredQueryParameters { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for TranslateRequiredQueryParameters { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for TranslateRequiredQueryParameters { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Template => serializer.serialize_unit_variant("TranslateRequiredQueryParameters", 0u32, "template"), + Self::Query => serializer.serialize_unit_variant("TranslateRequiredQueryParameters", 1u32, "query"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -480,10 +667,10 @@ pub struct ApiEntityBaseContract { #[doc = "Type of API."] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, - #[doc = "Describes the Revision of the Api. If no value is provided, default revision 1 is created"] + #[doc = "Describes the revision of the API. If no value is provided, default revision 1 is created"] #[serde(rename = "apiRevision", default, skip_serializing_if = "Option::is_none")] pub api_revision: Option, - #[doc = "Indicates the Version identifier of the API if the API is versioned"] + #[doc = "Indicates the version identifier of the API if the API is versioned"] #[serde(rename = "apiVersion", default, skip_serializing_if = "Option::is_none")] pub api_version: Option, #[doc = "Indicates if API revision is current api revision."] @@ -492,10 +679,10 @@ pub struct ApiEntityBaseContract { #[doc = "Indicates if API revision is accessible via the gateway."] #[serde(rename = "isOnline", default, skip_serializing_if = "Option::is_none")] pub is_online: Option, - #[doc = "Description of the Api Revision."] + #[doc = "Description of the API Revision."] #[serde(rename = "apiRevisionDescription", default, skip_serializing_if = "Option::is_none")] pub api_revision_description: Option, - #[doc = "Description of the Api Version."] + #[doc = "Description of the API Version."] #[serde(rename = "apiVersionDescription", default, skip_serializing_if = "Option::is_none")] pub api_version_description: Option, #[doc = "A resource identifier for the related ApiVersionSet."] @@ -504,6 +691,15 @@ pub struct ApiEntityBaseContract { #[doc = "Specifies whether an API or Product subscription is required for accessing the API."] #[serde(rename = "subscriptionRequired", default, skip_serializing_if = "Option::is_none")] pub subscription_required: Option, + #[doc = " A URL to the Terms of Service for the API. MUST be in the format of a URL."] + #[serde(rename = "termsOfServiceUrl", default, skip_serializing_if = "Option::is_none")] + pub terms_of_service_url: Option, + #[doc = "API contact information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contact: Option, + #[doc = "API license information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub license: Option, } impl ApiEntityBaseContract { pub fn new() -> Self { @@ -520,6 +716,10 @@ pub mod api_entity_base_contract { Http, #[serde(rename = "soap")] Soap, + #[serde(rename = "websocket")] + Websocket, + #[serde(rename = "graphql")] + Graphql, #[serde(skip_deserializing)] UnknownValue(String), } @@ -547,6 +747,8 @@ pub mod api_entity_base_contract { match self { Self::Http => serializer.serialize_unit_variant("Type", 0u32, "http"), Self::Soap => serializer.serialize_unit_variant("Type", 1u32, "soap"), + Self::Websocket => serializer.serialize_unit_variant("Type", 2u32, "websocket"), + Self::Graphql => serializer.serialize_unit_variant("Type", 3u32, "graphql"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -558,10 +760,10 @@ pub struct ApiExportResult { #[doc = "ResourceId of the API which was exported."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, - #[doc = "Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes."] + #[doc = "Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes."] #[serde(default, skip_serializing_if = "Option::is_none")] pub format: Option, - #[doc = "The object defining the schema of the exported Api Detail"] + #[doc = "The object defining the schema of the exported API Detail"] #[serde(default, skip_serializing_if = "Option::is_none")] pub value: Option, } @@ -572,7 +774,7 @@ impl ApiExportResult { } pub mod api_export_result { use super::*; - #[doc = "Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes."] + #[doc = "Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "Format")] pub enum Format { @@ -617,7 +819,7 @@ pub mod api_export_result { } } } - #[doc = "The object defining the schema of the exported Api Detail"] + #[doc = "The object defining the schema of the exported API Detail"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Value { #[doc = "Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes."] @@ -630,6 +832,21 @@ pub mod api_export_result { } } } +#[doc = "API license information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApiLicenseInformation { + #[doc = "The license name used for the API"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "A URL to the license used for the API. MUST be in the format of a URL"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, +} +impl ApiLicenseInformation { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Parameter supplied to the Apply Network configuration operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiManagementServiceApplyNetworkConfigurationParameters { @@ -645,26 +862,83 @@ impl ApiManagementServiceApplyNetworkConfigurationParameters { #[doc = "Parameters supplied to the Backup/Restore of an API Management service operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiManagementServiceBackupRestoreParameters { - #[doc = "Azure Cloud Storage account (used to place/retrieve the backup) name."] + #[doc = "The name of the Azure storage account (used to place/retrieve the backup)."] #[serde(rename = "storageAccount")] pub storage_account: String, - #[doc = "Azure Cloud Storage account (used to place/retrieve the backup) access key."] - #[serde(rename = "accessKey")] - pub access_key: String, - #[doc = "Azure Cloud Storage blob container name used to place/retrieve the backup."] + #[doc = "The name of the blob container (used to place/retrieve the backup)."] #[serde(rename = "containerName")] pub container_name: String, - #[doc = "The name of the backup file to create."] + #[doc = "The name of the backup file to create/retrieve."] #[serde(rename = "backupName")] pub backup_name: String, + #[doc = "The type of access to be used for the storage account."] + #[serde(rename = "accessType", default, skip_serializing_if = "Option::is_none")] + pub access_type: Option, + #[doc = "Storage account access key. Required only if `accessType` is set to `AccessKey`."] + #[serde(rename = "accessKey", default, skip_serializing_if = "Option::is_none")] + pub access_key: Option, + #[doc = "The Client ID of user assigned managed identity. Required only if `accessType` is set to `UserAssignedManagedIdentity`."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, } impl ApiManagementServiceBackupRestoreParameters { - pub fn new(storage_account: String, access_key: String, container_name: String, backup_name: String) -> Self { + pub fn new(storage_account: String, container_name: String, backup_name: String) -> Self { Self { storage_account, - access_key, container_name, backup_name, + access_type: None, + access_key: None, + client_id: None, + } + } +} +pub mod api_management_service_backup_restore_parameters { + use super::*; + #[doc = "The type of access to be used for the storage account."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AccessType")] + pub enum AccessType { + AccessKey, + SystemAssignedManagedIdentity, + UserAssignedManagedIdentity, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AccessType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AccessType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AccessType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AccessKey => serializer.serialize_unit_variant("AccessType", 0u32, "AccessKey"), + Self::SystemAssignedManagedIdentity => { + serializer.serialize_unit_variant("AccessType", 1u32, "SystemAssignedManagedIdentity") + } + Self::UserAssignedManagedIdentity => serializer.serialize_unit_variant("AccessType", 2u32, "UserAssignedManagedIdentity"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for AccessType { + fn default() -> Self { + Self::AccessKey } } } @@ -725,6 +999,12 @@ pub struct ApiManagementServiceBaseProperties { skip_serializing_if = "Vec::is_empty" )] pub private_ip_addresses: Vec, + #[doc = "Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network."] + #[serde(rename = "publicIpAddressId", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address_id: Option, + #[doc = "Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'"] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, #[doc = "Configuration of a virtual network to which API Management service is deployed."] #[serde(rename = "virtualNetworkConfiguration", default, skip_serializing_if = "Option::is_none")] pub virtual_network_configuration: Option, @@ -736,7 +1016,7 @@ pub struct ApiManagementServiceBaseProperties { skip_serializing_if = "Vec::is_empty" )] pub additional_locations: Vec, - #[doc = "Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384"] + #[doc = "Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of the following ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.
Note: The following ciphers can't be disabled since they are required by internal platform components: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"] #[serde(rename = "customProperties", default, skip_serializing_if = "Option::is_none")] pub custom_properties: Option, #[doc = "List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10."] @@ -749,6 +1029,17 @@ pub struct ApiManagementServiceBaseProperties { #[doc = "Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway."] #[serde(rename = "enableClientCertificate", default, skip_serializing_if = "Option::is_none")] pub enable_client_certificate: Option, + #[doc = "Property can be used to enable NAT Gateway for this API Management service."] + #[serde(rename = "natGatewayState", default, skip_serializing_if = "Option::is_none")] + pub nat_gateway_state: Option, + #[doc = "Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium SKU on stv2 platform."] + #[serde( + rename = "outboundPublicIPAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub outbound_public_ip_addresses: Vec, #[doc = "Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region."] #[serde(rename = "disableGateway", default, skip_serializing_if = "Option::is_none")] pub disable_gateway: Option, @@ -761,6 +1052,17 @@ pub struct ApiManagementServiceBaseProperties { #[doc = "Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored."] #[serde(default, skip_serializing_if = "Option::is_none")] pub restore: Option, + #[doc = "List of Private Endpoint Connections of this service."] + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "Compute Platform Version running the service in this location."] + #[serde(rename = "platformVersion", default, skip_serializing_if = "Option::is_none")] + pub platform_version: Option, } impl ApiManagementServiceBaseProperties { pub fn new() -> Self { @@ -769,6 +1071,85 @@ impl ApiManagementServiceBaseProperties { } pub mod api_management_service_base_properties { use super::*; + #[doc = "Whether or not public endpoint access is allowed for this API Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Property can be used to enable NAT Gateway for this API Management service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "NatGatewayState")] + pub enum NatGatewayState { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for NatGatewayState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for NatGatewayState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for NatGatewayState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("NatGatewayState", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("NatGatewayState", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for NatGatewayState { + fn default() -> Self { + Self::Disabled + } + } #[doc = "The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "VirtualNetworkType")] @@ -813,6 +1194,54 @@ pub mod api_management_service_base_properties { Self::None } } + #[doc = "Compute Platform Version running the service in this location."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PlatformVersion")] + pub enum PlatformVersion { + #[serde(rename = "undetermined")] + Undetermined, + #[serde(rename = "stv1")] + Stv1, + #[serde(rename = "stv2")] + Stv2, + #[serde(rename = "mtv1")] + Mtv1, + #[serde(rename = "stv2.1")] + Stv21, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PlatformVersion { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PlatformVersion { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PlatformVersion { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Undetermined => serializer.serialize_unit_variant("PlatformVersion", 0u32, "undetermined"), + Self::Stv1 => serializer.serialize_unit_variant("PlatformVersion", 1u32, "stv1"), + Self::Stv2 => serializer.serialize_unit_variant("PlatformVersion", 2u32, "stv2"), + Self::Mtv1 => serializer.serialize_unit_variant("PlatformVersion", 3u32, "mtv1"), + Self::Stv21 => serializer.serialize_unit_variant("PlatformVersion", 4u32, "stv2.1"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } } #[doc = "Parameters supplied to the CheckNameAvailability operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -1001,6 +1430,9 @@ pub struct ApiManagementServiceResource { #[doc = "Identity properties of the Api Management service resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub identity: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, #[doc = "Resource location."] pub location: String, #[doc = "ETag of the resource."] @@ -1021,6 +1453,7 @@ impl ApiManagementServiceResource { properties, sku, identity: None, + system_data: None, location, etag: None, zones: Vec::new(), @@ -1105,12 +1538,19 @@ pub struct ApiManagementServiceUpdateParameters { #[doc = "ETag of the resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub etag: Option, -} -impl ApiManagementServiceUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} + #[doc = "A list of availability zones denoting where the resource needs to come from."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zones: Vec, +} +impl ApiManagementServiceUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Properties of an API Management service resource description."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiManagementServiceUpdateProperties { @@ -1428,7 +1868,7 @@ impl ApiReleaseCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiReleaseContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "API Release details"] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -1459,7 +1899,7 @@ impl ApiReleaseContractProperties { Self::default() } } -#[doc = "Paged Api Revision list representation."] +#[doc = "Paged API Revision list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiRevisionCollection { #[doc = "Page values."] @@ -1595,7 +2035,7 @@ impl ApiVersionConstraint { Self::default() } } -#[doc = "Paged Api Version Set list representation."] +#[doc = "Paged API Version Set list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiVersionSetCollection { #[doc = "Page values."] @@ -1623,11 +2063,11 @@ impl ApiVersionSetCollection { Self::default() } } -#[doc = "Api Version Set Contract details."] +#[doc = "API Version Set Contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiVersionSetContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Properties of an API Version Set."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -1668,10 +2108,42 @@ pub mod api_version_set_contract_details { use super::*; #[doc = "An value that determines where the API Version identifier will be located in a HTTP request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "VersioningScheme")] pub enum VersioningScheme { Segment, Query, Header, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for VersioningScheme { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for VersioningScheme { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for VersioningScheme { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Segment => serializer.serialize_unit_variant("VersioningScheme", 0u32, "Segment"), + Self::Query => serializer.serialize_unit_variant("VersioningScheme", 1u32, "Query"), + Self::Header => serializer.serialize_unit_variant("VersioningScheme", 2u32, "Header"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } } } #[doc = "Properties of an API Version Set."] @@ -1737,7 +2209,7 @@ pub mod api_version_set_contract_properties { } } } -#[doc = "Api Version set base parameters"] +#[doc = "API Version set base parameters"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiVersionSetEntityBase { #[doc = "Description of API Version Set."] @@ -1755,7 +2227,7 @@ impl ApiVersionSetEntityBase { Self::default() } } -#[doc = "Parameters to update or create an Api Version Set Contract."] +#[doc = "Parameters to update or create an API Version Set Contract."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ApiVersionSetUpdateParameters { #[doc = "Properties used to create or update an API Version Set."] @@ -1847,11 +2319,22 @@ impl ApimResource { Self::default() } } +#[doc = "A wrapper for an ARM resource id"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ArmIdWrapper { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ArmIdWrapper { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Association entity details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AssociationContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Association entity contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -1894,22 +2377,38 @@ pub struct AuthenticationSettingsContract { #[doc = "API OAuth2 Authentication settings details."] #[serde(default, skip_serializing_if = "Option::is_none")] pub openid: Option, + #[doc = "Collection of OAuth2 authentication settings included into this API."] + #[serde( + rename = "oAuth2AuthenticationSettings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub o_auth2_authentication_settings: Vec, + #[doc = "Collection of Open ID Connect authentication settings included into this API."] + #[serde( + rename = "openidAuthenticationSettings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub openid_authentication_settings: Vec, } impl AuthenticationSettingsContract { pub fn new() -> Self { Self::default() } } -#[doc = "Paged OAuth2 Authorization Servers list representation."] +#[doc = "Paged Authorization Access Policy list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AuthorizationServerCollection { +pub struct AuthorizationAccessPolicyCollection { #[doc = "Page values."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Total record count number across all pages."] #[serde(default, skip_serializing_if = "Option::is_none")] pub count: Option, @@ -1917,222 +2416,572 @@ pub struct AuthorizationServerCollection { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, } -impl azure_core::Continuable for AuthorizationServerCollection { +impl azure_core::Continuable for AuthorizationAccessPolicyCollection { type Continuation = String; fn continuation(&self) -> Option { self.next_link.clone() } } -impl AuthorizationServerCollection { +impl AuthorizationAccessPolicyCollection { pub fn new() -> Self { Self::default() } } -#[doc = "External OAuth authorization server settings."] +#[doc = "Authorization access policy contract."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AuthorizationServerContract { +pub struct AuthorizationAccessPolicyContract { #[serde(flatten)] - pub resource: Resource, - #[doc = "External OAuth authorization server settings Properties."] + pub proxy_resource: ProxyResource, + #[doc = "Authorization Access Policy details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } -impl AuthorizationServerContract { +impl AuthorizationAccessPolicyContract { pub fn new() -> Self { Self::default() } } -#[doc = "External OAuth authorization server Update settings contract."] +#[doc = "Authorization Access Policy details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AuthorizationServerContractBaseProperties { - #[doc = "Description of the authorization server. Can contain HTML formatting tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional."] - #[serde( - rename = "authorizationMethods", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub authorization_methods: Vec, - #[doc = "Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format."] - #[serde( - rename = "clientAuthenticationMethod", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub client_authentication_method: Vec, - #[doc = "Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {\"name\" : \"name value\", \"value\": \"a value\"}."] - #[serde( - rename = "tokenBodyParameters", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub token_body_parameters: Vec, - #[doc = "OAuth token endpoint. Contains absolute URI to entity being referenced."] - #[serde(rename = "tokenEndpoint", default, skip_serializing_if = "Option::is_none")] - pub token_endpoint: Option, - #[doc = "If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security."] - #[serde(rename = "supportState", default, skip_serializing_if = "Option::is_none")] - pub support_state: Option, - #[doc = "Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values."] - #[serde(rename = "defaultScope", default, skip_serializing_if = "Option::is_none")] - pub default_scope: Option, - #[doc = "Specifies the mechanism by which access token is passed to the API. "] +pub struct AuthorizationAccessPolicyContractProperties { + #[doc = "The Tenant Id"] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The Object Id"] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option, +} +impl AuthorizationAccessPolicyContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paged Authorization list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationCollection { + #[doc = "Page values."] #[serde( - rename = "bearerTokenSendingMethods", default, deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub bearer_token_sending_methods: Vec, - #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username."] - #[serde(rename = "resourceOwnerUsername", default, skip_serializing_if = "Option::is_none")] - pub resource_owner_username: Option, - #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password."] - #[serde(rename = "resourceOwnerPassword", default, skip_serializing_if = "Option::is_none")] - pub resource_owner_password: Option, + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl AuthorizationServerContractBaseProperties { - pub fn new() -> Self { - Self::default() +impl azure_core::Continuable for AuthorizationCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() } } -#[doc = "External OAuth authorization server settings Properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthorizationServerContractProperties { - #[serde(flatten)] - pub authorization_server_contract_base_properties: AuthorizationServerContractBaseProperties, - #[doc = "User-friendly authorization server name."] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced."] - #[serde(rename = "clientRegistrationEndpoint")] - pub client_registration_endpoint: String, - #[doc = "OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2."] - #[serde(rename = "authorizationEndpoint")] - pub authorization_endpoint: String, - #[doc = "Form of an authorization grant, which the client uses to request the access token."] - #[serde(rename = "grantTypes")] - pub grant_types: Vec, - #[doc = "Client or app id registered with this authorization server."] - #[serde(rename = "clientId")] - pub client_id: String, - #[doc = "Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value."] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, -} -impl AuthorizationServerContractProperties { - pub fn new( - display_name: String, - client_registration_endpoint: String, - authorization_endpoint: String, - grant_types: Vec, - client_id: String, - ) -> Self { - Self { - authorization_server_contract_base_properties: AuthorizationServerContractBaseProperties::default(), - display_name, - client_registration_endpoint, - authorization_endpoint, - grant_types, - client_id, - client_secret: None, - } +impl AuthorizationCollection { + pub fn new() -> Self { + Self::default() } } -#[doc = "OAuth Server Secrets Contract."] +#[doc = "Authorization confirm consent code request contract."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AuthorizationServerSecretsContract { - #[doc = "oAuth Authorization Server Secrets."] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username."] - #[serde(rename = "resourceOwnerUsername", default, skip_serializing_if = "Option::is_none")] - pub resource_owner_username: Option, - #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password."] - #[serde(rename = "resourceOwnerPassword", default, skip_serializing_if = "Option::is_none")] - pub resource_owner_password: Option, +pub struct AuthorizationConfirmConsentCodeRequestContract { + #[doc = "The consent code from the authorization server after authorizing and consenting."] + #[serde(rename = "consentCode", default, skip_serializing_if = "Option::is_none")] + pub consent_code: Option, } -impl AuthorizationServerSecretsContract { +impl AuthorizationConfirmConsentCodeRequestContract { pub fn new() -> Self { Self::default() } } -#[doc = "External OAuth authorization server settings."] +#[doc = "Authorization contract."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AuthorizationServerUpdateContract { +pub struct AuthorizationContract { #[serde(flatten)] - pub resource: Resource, - #[doc = "External OAuth authorization server Update settings contract."] + pub proxy_resource: ProxyResource, + #[doc = "Authorization details."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } -impl AuthorizationServerUpdateContract { +impl AuthorizationContract { pub fn new() -> Self { Self::default() } } -#[doc = "External OAuth authorization server Update settings contract."] +#[doc = "Authorization details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AuthorizationServerUpdateContractProperties { - #[serde(flatten)] - pub authorization_server_contract_base_properties: AuthorizationServerContractBaseProperties, - #[doc = "User-friendly authorization server name."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced."] - #[serde(rename = "clientRegistrationEndpoint", default, skip_serializing_if = "Option::is_none")] - pub client_registration_endpoint: Option, - #[doc = "OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2."] - #[serde(rename = "authorizationEndpoint", default, skip_serializing_if = "Option::is_none")] - pub authorization_endpoint: Option, - #[doc = "Form of an authorization grant, which the client uses to request the access token."] - #[serde( - rename = "grantTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub grant_types: Vec, - #[doc = "Client or app id registered with this authorization server."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value."] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, +pub struct AuthorizationContractProperties { + #[doc = "Authorization type options"] + #[serde(rename = "authorizationType", default, skip_serializing_if = "Option::is_none")] + pub authorization_type: Option, + #[doc = "OAuth2 grant type options"] + #[serde(rename = "oauth2grantType", default, skip_serializing_if = "Option::is_none")] + pub oauth2grant_type: Option, + #[doc = "Authorization parameters"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option, + #[doc = "Authorization error details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + #[doc = "Status of the Authorization"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, } -impl AuthorizationServerUpdateContractProperties { +impl AuthorizationContractProperties { pub fn new() -> Self { Self::default() } } -#[doc = "Authorization header information."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BackendAuthorizationHeaderCredentials { - #[doc = "Authentication Scheme name."] - pub scheme: String, - #[doc = "Authentication Parameter value."] - pub parameter: String, -} -impl BackendAuthorizationHeaderCredentials { - pub fn new(scheme: String, parameter: String) -> Self { - Self { scheme, parameter } +pub mod authorization_contract_properties { + use super::*; + #[doc = "Authorization type options"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthorizationType")] + pub enum AuthorizationType { + OAuth2, + #[serde(skip_deserializing)] + UnknownValue(String), } -} -#[doc = "Backend entity base Parameter set."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BackendBaseParameters { + impl FromStr for AuthorizationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthorizationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthorizationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OAuth2 => serializer.serialize_unit_variant("AuthorizationType", 0u32, "OAuth2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "OAuth2 grant type options"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Oauth2grantType")] + pub enum Oauth2grantType { + AuthorizationCode, + ClientCredentials, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Oauth2grantType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Oauth2grantType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Oauth2grantType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AuthorizationCode => serializer.serialize_unit_variant("Oauth2grantType", 0u32, "AuthorizationCode"), + Self::ClientCredentials => serializer.serialize_unit_variant("Oauth2grantType", 1u32, "ClientCredentials"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Authorization error details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationError { + #[doc = "Error code"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Error message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl AuthorizationError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Authorization login request contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationLoginRequestContract { + #[doc = "The redirect URL after login has completed."] + #[serde(rename = "postLoginRedirectUrl", default, skip_serializing_if = "Option::is_none")] + pub post_login_redirect_url: Option, +} +impl AuthorizationLoginRequestContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Authorization login response contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationLoginResponseContract { + #[doc = "The login link"] + #[serde(rename = "loginLink", default, skip_serializing_if = "Option::is_none")] + pub login_link: Option, +} +impl AuthorizationLoginResponseContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paged Authorization Provider list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationProviderCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AuthorizationProviderCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AuthorizationProviderCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Authorization Provider contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationProviderContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Authorization Provider details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AuthorizationProviderContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Authorization Provider details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationProviderContractProperties { + #[doc = "Authorization Provider name. Must be 1 to 300 characters long."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Identity provider name. Must be 1 to 300 characters long."] + #[serde(rename = "identityProvider", default, skip_serializing_if = "Option::is_none")] + pub identity_provider: Option, + #[doc = "OAuth2 settings details"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub oauth2: Option, +} +impl AuthorizationProviderContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Authorization Provider oauth2 grant types settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationProviderOAuth2GrantTypes { + #[doc = "OAuth2 authorization code grant parameters"] + #[serde(rename = "authorizationCode", default, skip_serializing_if = "Option::is_none")] + pub authorization_code: Option, + #[doc = "OAuth2 client credential grant parameters"] + #[serde(rename = "clientCredentials", default, skip_serializing_if = "Option::is_none")] + pub client_credentials: Option, +} +impl AuthorizationProviderOAuth2GrantTypes { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "OAuth2 settings details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationProviderOAuth2Settings { + #[doc = "Redirect URL to be set in the OAuth application."] + #[serde(rename = "redirectUrl", default, skip_serializing_if = "Option::is_none")] + pub redirect_url: Option, + #[doc = "Authorization Provider oauth2 grant types settings"] + #[serde(rename = "grantTypes", default, skip_serializing_if = "Option::is_none")] + pub grant_types: Option, +} +impl AuthorizationProviderOAuth2Settings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paged OAuth2 Authorization Servers list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationServerCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AuthorizationServerCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AuthorizationServerCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "External OAuth authorization server settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationServerContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "External OAuth authorization server settings Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AuthorizationServerContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "External OAuth authorization server Update settings contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationServerContractBaseProperties { + #[doc = "Description of the authorization server. Can contain HTML formatting tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional."] + #[serde( + rename = "authorizationMethods", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub authorization_methods: Vec, + #[doc = "Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format."] + #[serde( + rename = "clientAuthenticationMethod", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub client_authentication_method: Vec, + #[doc = "Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {\"name\" : \"name value\", \"value\": \"a value\"}."] + #[serde( + rename = "tokenBodyParameters", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub token_body_parameters: Vec, + #[doc = "OAuth token endpoint. Contains absolute URI to entity being referenced."] + #[serde(rename = "tokenEndpoint", default, skip_serializing_if = "Option::is_none")] + pub token_endpoint: Option, + #[doc = "If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security."] + #[serde(rename = "supportState", default, skip_serializing_if = "Option::is_none")] + pub support_state: Option, + #[doc = "Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values."] + #[serde(rename = "defaultScope", default, skip_serializing_if = "Option::is_none")] + pub default_scope: Option, + #[doc = "Specifies the mechanism by which access token is passed to the API. "] + #[serde( + rename = "bearerTokenSendingMethods", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub bearer_token_sending_methods: Vec, + #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username."] + #[serde(rename = "resourceOwnerUsername", default, skip_serializing_if = "Option::is_none")] + pub resource_owner_username: Option, + #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password."] + #[serde(rename = "resourceOwnerPassword", default, skip_serializing_if = "Option::is_none")] + pub resource_owner_password: Option, +} +impl AuthorizationServerContractBaseProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "External OAuth authorization server settings Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthorizationServerContractProperties { + #[serde(flatten)] + pub authorization_server_contract_base_properties: AuthorizationServerContractBaseProperties, + #[doc = "User-friendly authorization server name."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "If true, the authorization server may be used in the developer portal test console. True by default if no value is provided."] + #[serde(rename = "useInTestConsole", default, skip_serializing_if = "Option::is_none")] + pub use_in_test_console: Option, + #[doc = "If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided."] + #[serde(rename = "useInApiDocumentation", default, skip_serializing_if = "Option::is_none")] + pub use_in_api_documentation: Option, + #[doc = "Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced."] + #[serde(rename = "clientRegistrationEndpoint")] + pub client_registration_endpoint: String, + #[doc = "OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2."] + #[serde(rename = "authorizationEndpoint")] + pub authorization_endpoint: String, + #[doc = "Form of an authorization grant, which the client uses to request the access token."] + #[serde(rename = "grantTypes")] + pub grant_types: Vec, + #[doc = "Client or app id registered with this authorization server."] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value."] + #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] + pub client_secret: Option, +} +impl AuthorizationServerContractProperties { + pub fn new( + display_name: String, + client_registration_endpoint: String, + authorization_endpoint: String, + grant_types: Vec, + client_id: String, + ) -> Self { + Self { + authorization_server_contract_base_properties: AuthorizationServerContractBaseProperties::default(), + display_name, + use_in_test_console: None, + use_in_api_documentation: None, + client_registration_endpoint, + authorization_endpoint, + grant_types, + client_id, + client_secret: None, + } + } +} +#[doc = "OAuth Server Secrets Contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationServerSecretsContract { + #[doc = "oAuth Authorization Server Secrets."] + #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username."] + #[serde(rename = "resourceOwnerUsername", default, skip_serializing_if = "Option::is_none")] + pub resource_owner_username: Option, + #[doc = "Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password."] + #[serde(rename = "resourceOwnerPassword", default, skip_serializing_if = "Option::is_none")] + pub resource_owner_password: Option, +} +impl AuthorizationServerSecretsContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "External OAuth authorization server settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationServerUpdateContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "External OAuth authorization server Update settings contract."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AuthorizationServerUpdateContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "External OAuth authorization server Update settings contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthorizationServerUpdateContractProperties { + #[serde(flatten)] + pub authorization_server_contract_base_properties: AuthorizationServerContractBaseProperties, + #[doc = "User-friendly authorization server name."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "If true, the authorization server may be used in the developer portal test console. True by default if no value is provided."] + #[serde(rename = "useInTestConsole", default, skip_serializing_if = "Option::is_none")] + pub use_in_test_console: Option, + #[doc = "If true, the authorization server will be used in the API documentation in the developer portal. False by default if no value is provided."] + #[serde(rename = "useInApiDocumentation", default, skip_serializing_if = "Option::is_none")] + pub use_in_api_documentation: Option, + #[doc = "Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced."] + #[serde(rename = "clientRegistrationEndpoint", default, skip_serializing_if = "Option::is_none")] + pub client_registration_endpoint: Option, + #[doc = "OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2."] + #[serde(rename = "authorizationEndpoint", default, skip_serializing_if = "Option::is_none")] + pub authorization_endpoint: Option, + #[doc = "Form of an authorization grant, which the client uses to request the access token."] + #[serde( + rename = "grantTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub grant_types: Vec, + #[doc = "Client or app id registered with this authorization server."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[doc = "Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value."] + #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] + pub client_secret: Option, +} +impl AuthorizationServerUpdateContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Authorization header information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BackendAuthorizationHeaderCredentials { + #[doc = "Authentication Scheme name."] + pub scheme: String, + #[doc = "Authentication Parameter value."] + pub parameter: String, +} +impl BackendAuthorizationHeaderCredentials { + pub fn new(scheme: String, parameter: String) -> Self { + Self { scheme, parameter } + } +} +#[doc = "Backend entity base Parameter set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BackendBaseParameters { #[doc = "Backend Title."] #[serde(default, skip_serializing_if = "Option::is_none")] pub title: Option, #[doc = "Backend Description."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, - #[doc = "Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps."] + #[doc = "Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or API Apps."] #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] pub resource_id: Option, #[doc = "Properties specific to the Backend Type."] @@ -2147,12 +2996,31 @@ pub struct BackendBaseParameters { #[doc = "Properties controlling TLS Certificate Validation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tls: Option, + #[doc = "The configuration of the backend circuit breaker"] + #[serde(rename = "circuitBreaker", default, skip_serializing_if = "Option::is_none")] + pub circuit_breaker: Option, } impl BackendBaseParameters { pub fn new() -> Self { Self::default() } } +#[doc = "The configuration of the backend circuit breaker"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BackendCircuitBreaker { + #[doc = "The rules for tripping the backend."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, +} +impl BackendCircuitBreaker { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Paged Backend list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackendCollection { @@ -2185,7 +3053,7 @@ impl BackendCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackendContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Parameters supplied to the Create Backend operation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -2326,7 +3194,7 @@ impl BackendProxyContract { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackendReconnectContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Properties to control reconnect requests."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -2563,7 +3431,7 @@ impl CacheCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CacheContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Properties of the Cache contract."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -2699,7 +3567,7 @@ pub mod certificate_configuration { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CertificateContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Properties of the Certificate contract."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -2709,90 +3577,630 @@ impl CertificateContract { Self::default() } } -#[doc = "Properties of the Certificate contract."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateContractProperties { - #[doc = "Subject attribute of the certificate."] - pub subject: String, - #[doc = "Thumbprint of the certificate."] - pub thumbprint: String, - #[doc = "Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"] - #[serde(rename = "expirationDate", with = "azure_core::date::rfc3339")] - pub expiration_date: time::OffsetDateTime, - #[doc = "KeyVault contract details."] - #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] - pub key_vault: Option, -} -impl CertificateContractProperties { - pub fn new(subject: String, thumbprint: String, expiration_date: time::OffsetDateTime) -> Self { - Self { - subject, - thumbprint, - expiration_date, - key_vault: None, +#[doc = "Properties of the Certificate contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertificateContractProperties { + #[doc = "Subject attribute of the certificate."] + pub subject: String, + #[doc = "Thumbprint of the certificate."] + pub thumbprint: String, + #[doc = "Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"] + #[serde(rename = "expirationDate", with = "azure_core::date::rfc3339")] + pub expiration_date: time::OffsetDateTime, + #[doc = "KeyVault contract details."] + #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] + pub key_vault: Option, +} +impl CertificateContractProperties { + pub fn new(subject: String, thumbprint: String, expiration_date: time::OffsetDateTime) -> Self { + Self { + subject, + thumbprint, + expiration_date, + key_vault: None, + } + } +} +#[doc = "Certificate create or update details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CertificateCreateOrUpdateParameters { + #[doc = "Parameters supplied to the CreateOrUpdate certificate operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CertificateCreateOrUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Parameters supplied to the CreateOrUpdate certificate operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CertificateCreateOrUpdateProperties { + #[doc = "Base 64 encoded certificate using the application/x-pkcs12 representation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option, + #[doc = "Password for the Certificate"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, + #[doc = "Create keyVault contract details."] + #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] + pub key_vault: Option, +} +impl CertificateCreateOrUpdateProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "SSL certificate information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertificateInformation { + #[doc = "Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard."] + #[serde(with = "azure_core::date::rfc3339")] + pub expiry: time::OffsetDateTime, + #[doc = "Thumbprint of the certificate."] + pub thumbprint: String, + #[doc = "Subject of the certificate."] + pub subject: String, +} +impl CertificateInformation { + pub fn new(expiry: time::OffsetDateTime, thumbprint: String, subject: String) -> Self { + Self { + expiry, + thumbprint, + subject, + } + } +} +#[doc = "The trip conditions of the circuit breaker"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CircuitBreakerFailureCondition { + #[doc = "The threshold for opening the circuit."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The threshold for opening the circuit."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, + #[doc = "The interval during which the failures are counted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub interval: Option, + #[doc = "The status code ranges which are considered as failure."] + #[serde( + rename = "statusCodeRanges", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub status_code_ranges: Vec, + #[doc = "The error reasons which are considered as failure."] + #[serde( + rename = "errorReasons", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub error_reasons: Vec, +} +impl CircuitBreakerFailureCondition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule configuration to trip the backend."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CircuitBreakerRule { + #[doc = "The rule name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The trip conditions of the circuit breaker"] + #[serde(rename = "failureCondition", default, skip_serializing_if = "Option::is_none")] + pub failure_condition: Option, + #[doc = "The duration for which the circuit will be tripped."] + #[serde(rename = "tripDuration", default, skip_serializing_if = "Option::is_none")] + pub trip_duration: Option, +} +impl CircuitBreakerRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Client or app secret used in IdentityProviders, Aad, OpenID or OAuth."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientSecretContract { + #[doc = "Client or app secret used in IdentityProviders, Aad, OpenID or OAuth."] + #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] + pub client_secret: Option, +} +impl ClientSecretContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A request to perform the connectivity check operation on a API Management service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectivityCheckRequest { + #[doc = "Definitions about the connectivity check origin."] + pub source: connectivity_check_request::Source, + #[doc = "The connectivity check operation destination."] + pub destination: connectivity_check_request::Destination, + #[doc = "The IP version to be used. Only IPv4 is supported for now."] + #[serde(rename = "preferredIPVersion", default, skip_serializing_if = "Option::is_none")] + pub preferred_ip_version: Option, + #[doc = "The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination address must be coherent with this value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub protocol: Option, + #[doc = "Protocol-specific configuration."] + #[serde(rename = "protocolConfiguration", default, skip_serializing_if = "Option::is_none")] + pub protocol_configuration: Option, +} +impl ConnectivityCheckRequest { + pub fn new(source: connectivity_check_request::Source, destination: connectivity_check_request::Destination) -> Self { + Self { + source, + destination, + preferred_ip_version: None, + protocol: None, + protocol_configuration: None, + } + } +} +pub mod connectivity_check_request { + use super::*; + #[doc = "Definitions about the connectivity check origin."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub struct Source { + #[doc = "The API Management service region from where to start the connectivity check operation."] + pub region: String, + #[doc = "The particular VMSS instance from which to fire the request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instance: Option, + } + impl Source { + pub fn new(region: String) -> Self { + Self { region, instance: None } + } + } + #[doc = "The connectivity check operation destination."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub struct Destination { + #[doc = "Destination address. Can either be an IP address or a FQDN."] + pub address: String, + #[doc = "Destination port."] + pub port: i64, + } + impl Destination { + pub fn new(address: String, port: i64) -> Self { + Self { address, port } + } + } + #[doc = "The IP version to be used. Only IPv4 is supported for now."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PreferredIpVersion")] + pub enum PreferredIpVersion { + IPv4, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PreferredIpVersion { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PreferredIpVersion { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PreferredIpVersion { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IPv4 => serializer.serialize_unit_variant("PreferredIpVersion", 0u32, "IPv4"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination address must be coherent with this value."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Protocol")] + pub enum Protocol { + #[serde(rename = "TCP")] + Tcp, + #[serde(rename = "HTTP")] + Http, + #[serde(rename = "HTTPS")] + Https, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Protocol { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Protocol { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Protocol { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "TCP"), + Self::Http => serializer.serialize_unit_variant("Protocol", 1u32, "HTTP"), + Self::Https => serializer.serialize_unit_variant("Protocol", 2u32, "HTTPS"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Protocol-specific configuration."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ProtocolConfiguration { + #[doc = "Configuration for HTTP or HTTPS requests."] + #[serde(rename = "HTTPConfiguration", default, skip_serializing_if = "Option::is_none")] + pub http_configuration: Option, + } + impl ProtocolConfiguration { + pub fn new() -> Self { + Self::default() + } + } + pub mod protocol_configuration { + use super::*; + #[doc = "Configuration for HTTP or HTTPS requests."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct HttpConfiguration { + #[doc = "The HTTP method to be used."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub method: Option, + #[doc = "List of HTTP status codes considered valid for the request response."] + #[serde( + rename = "validStatusCodes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub valid_status_codes: Vec, + #[doc = "List of headers to be included in the request."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub headers: Vec, + } + impl HttpConfiguration { + pub fn new() -> Self { + Self::default() + } + } + pub mod http_configuration { + use super::*; + #[doc = "The HTTP method to be used."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Method")] + pub enum Method { + #[serde(rename = "GET")] + Get, + #[serde(rename = "POST")] + Post, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Method { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Method { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Method { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Get => serializer.serialize_unit_variant("Method", 0u32, "GET"), + Self::Post => serializer.serialize_unit_variant("Method", 1u32, "POST"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "Information on the connectivity status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectivityCheckResponse { + #[doc = "List of hops between the source and the destination."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub hops: Vec, + #[doc = "The connection status."] + #[serde(rename = "connectionStatus", default, skip_serializing_if = "Option::is_none")] + pub connection_status: Option, + #[doc = "Average latency in milliseconds."] + #[serde(rename = "avgLatencyInMs", default, skip_serializing_if = "Option::is_none")] + pub avg_latency_in_ms: Option, + #[doc = "Minimum latency in milliseconds."] + #[serde(rename = "minLatencyInMs", default, skip_serializing_if = "Option::is_none")] + pub min_latency_in_ms: Option, + #[doc = "Maximum latency in milliseconds."] + #[serde(rename = "maxLatencyInMs", default, skip_serializing_if = "Option::is_none")] + pub max_latency_in_ms: Option, + #[doc = "Total number of probes sent."] + #[serde(rename = "probesSent", default, skip_serializing_if = "Option::is_none")] + pub probes_sent: Option, + #[doc = "Number of failed probes."] + #[serde(rename = "probesFailed", default, skip_serializing_if = "Option::is_none")] + pub probes_failed: Option, +} +impl ConnectivityCheckResponse { + pub fn new() -> Self { + Self::default() + } +} +pub mod connectivity_check_response { + use super::*; + #[doc = "The connection status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ConnectionStatus")] + pub enum ConnectionStatus { + Unknown, + Connected, + Disconnected, + Degraded, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ConnectionStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ConnectionStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ConnectionStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("ConnectionStatus", 0u32, "Unknown"), + Self::Connected => serializer.serialize_unit_variant("ConnectionStatus", 1u32, "Connected"), + Self::Disconnected => serializer.serialize_unit_variant("ConnectionStatus", 2u32, "Disconnected"), + Self::Degraded => serializer.serialize_unit_variant("ConnectionStatus", 3u32, "Degraded"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } } -#[doc = "Certificate create or update details."] +#[doc = "Information about a hop between the source and the destination."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CertificateCreateOrUpdateParameters { - #[doc = "Parameters supplied to the CreateOrUpdate certificate operation."] +pub struct ConnectivityHop { + #[doc = "The type of the hop."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The ID of the hop."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub id: Option, + #[doc = "The IP address of the hop."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "The ID of the resource corresponding to this hop."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "List of next hop identifiers."] + #[serde( + rename = "nextHopIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub next_hop_ids: Vec, + #[doc = "List of issues."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub issues: Vec, } -impl CertificateCreateOrUpdateParameters { +impl ConnectivityHop { pub fn new() -> Self { Self::default() } } -#[doc = "Parameters supplied to the CreateOrUpdate certificate operation."] +#[doc = "Information about an issue encountered in the process of checking for connectivity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CertificateCreateOrUpdateProperties { - #[doc = "Base 64 encoded certificate using the application/x-pkcs12 representation."] +pub struct ConnectivityIssue { + #[doc = "The origin of the issue."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option, - #[doc = "Password for the Certificate"] + pub origin: Option, + #[doc = "The severity of the issue."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, - #[doc = "Create keyVault contract details."] - #[serde(rename = "keyVault", default, skip_serializing_if = "Option::is_none")] - pub key_vault: Option, + pub severity: Option, + #[doc = "The type of issue."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Provides additional context on the issue."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub context: Vec, } -impl CertificateCreateOrUpdateProperties { +impl ConnectivityIssue { pub fn new() -> Self { Self::default() } } -#[doc = "SSL certificate information."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateInformation { - #[doc = "Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard."] - #[serde(with = "azure_core::date::rfc3339")] - pub expiry: time::OffsetDateTime, - #[doc = "Thumbprint of the certificate."] - pub thumbprint: String, - #[doc = "Subject of the certificate."] - pub subject: String, -} -impl CertificateInformation { - pub fn new(expiry: time::OffsetDateTime, thumbprint: String, subject: String) -> Self { - Self { - expiry, - thumbprint, - subject, +pub mod connectivity_issue { + use super::*; + #[doc = "The origin of the issue."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + Local, + Inbound, + Outbound, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) } } -} -#[doc = "Client or app secret used in IdentityProviders, Aad, OpenID or OAuth."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ClientSecretContract { - #[doc = "Client or app secret used in IdentityProviders, Aad, OpenID or OAuth."] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, -} -impl ClientSecretContract { - pub fn new() -> Self { - Self::default() + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Local => serializer.serialize_unit_variant("Origin", 0u32, "Local"), + Self::Inbound => serializer.serialize_unit_variant("Origin", 1u32, "Inbound"), + Self::Outbound => serializer.serialize_unit_variant("Origin", 2u32, "Outbound"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity of the issue."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + Error, + Warning, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Error => serializer.serialize_unit_variant("Severity", 0u32, "Error"), + Self::Warning => serializer.serialize_unit_variant("Severity", 1u32, "Warning"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of issue."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Unknown, + AgentStopped, + GuestFirewall, + DnsResolution, + SocketBind, + NetworkSecurityRule, + UserDefinedRoute, + PortThrottled, + Platform, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("Type", 0u32, "Unknown"), + Self::AgentStopped => serializer.serialize_unit_variant("Type", 1u32, "AgentStopped"), + Self::GuestFirewall => serializer.serialize_unit_variant("Type", 2u32, "GuestFirewall"), + Self::DnsResolution => serializer.serialize_unit_variant("Type", 3u32, "DnsResolution"), + Self::SocketBind => serializer.serialize_unit_variant("Type", 4u32, "SocketBind"), + Self::NetworkSecurityRule => serializer.serialize_unit_variant("Type", 5u32, "NetworkSecurityRule"), + Self::UserDefinedRoute => serializer.serialize_unit_variant("Type", 6u32, "UserDefinedRoute"), + Self::PortThrottled => serializer.serialize_unit_variant("Type", 7u32, "PortThrottled"), + Self::Platform => serializer.serialize_unit_variant("Type", 8u32, "Platform"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } } } #[doc = "Details about connectivity to a resource."] @@ -2912,7 +4320,7 @@ impl ContentItemCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContentItemContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -2957,7 +4365,7 @@ impl ContentTypeCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ContentTypeContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -3066,14 +4474,14 @@ pub mod data_masking_entity { } } } -#[doc = "Deleted Api Management Service information."] +#[doc = "Deleted API Management Service information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeletedServiceContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, - #[doc = "Api Management Service Master Location."] + #[doc = "API Management Service Master Location."] #[serde(default, skip_serializing_if = "Option::is_none")] pub location: Option, } @@ -3099,7 +4507,7 @@ impl DeletedServiceContractProperties { Self::default() } } -#[doc = "Paged deleted Api Management Services List Representation."] +#[doc = "Paged deleted API Management Services List Representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DeletedServicesCollection { #[doc = "Page values."] @@ -3182,7 +4590,7 @@ impl DiagnosticCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DiagnosticContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Diagnostic Entity Properties"] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -3377,27 +4785,93 @@ pub mod diagnostic_contract_properties { Self::deserialize(s.into_deserializer()) } } - impl<'de> Deserialize<'de> for OperationNameFormat { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } + impl<'de> Deserialize<'de> for OperationNameFormat { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperationNameFormat { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Name => serializer.serialize_unit_variant("OperationNameFormat", 0u32, "Name"), + Self::Url => serializer.serialize_unit_variant("OperationNameFormat", 1u32, "Url"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Paged Documentation list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DocumentationCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DocumentationCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DocumentationCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Markdown documentation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DocumentationContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Markdown documentation details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DocumentationContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Markdown documentation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DocumentationContractProperties { + #[doc = "documentation title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Markdown documentation content."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content: Option, +} +impl DocumentationContractProperties { + pub fn new() -> Self { + Self::default() } - impl Serialize for OperationNameFormat { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Name => serializer.serialize_unit_variant("OperationNameFormat", 0u32, "Name"), - Self::Url => serializer.serialize_unit_variant("OperationNameFormat", 1u32, "Url"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } +} +#[doc = "Documentation update contract details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DocumentationUpdateContract { + #[doc = "Markdown documentation details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DocumentationUpdateContract { + pub fn new() -> Self { + Self::default() } } #[doc = "Paged email template list representation."] @@ -3432,7 +4906,7 @@ impl EmailTemplateCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EmailTemplateContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Email Template Contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -3455,7 +4929,7 @@ pub struct EmailTemplateContractProperties { #[doc = "Description of the Email Template."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, - #[doc = "Whether the template is the default template provided by Api Management or has been edited."] + #[doc = "Whether the template is the default template provided by API Management or has been edited."] #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] pub is_default: Option, #[doc = "Email Template Parameter values."] @@ -3536,6 +5010,41 @@ impl EmailTemplateUpdateParameters { Self::default() } } +#[doc = "A domain name that a service is reached at."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EndpointDependency { + #[doc = "The domain name of the dependency."] + #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] + pub domain_name: Option, + #[doc = "The Ports used when connecting to DomainName."] + #[serde( + rename = "endpointDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoint_details: Vec, +} +impl EndpointDependency { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Current TCP connectivity information from the Api Management Service to a single endpoint."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EndpointDetail { + #[doc = "The port an endpoint is connected to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "The region of the dependency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, +} +impl EndpointDetail { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Error Field contract."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorFieldContract { @@ -3594,6 +5103,21 @@ impl ErrorResponseBody { Self::default() } } +#[doc = "The failure http status code range"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FailureStatusCodeRange { + #[doc = "The minimum http status code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub min: Option, + #[doc = "The maximum http status code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, +} +impl FailureStatusCodeRange { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Paged Gateway certificate authority list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatewayCertificateAuthorityCollection { @@ -3623,7 +5147,7 @@ impl GatewayCertificateAuthorityCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatewayCertificateAuthorityContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Gateway certificate authority details."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -3677,7 +5201,7 @@ impl GatewayCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatewayContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Properties of the Gateway contract."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -3731,7 +5255,7 @@ impl GatewayHostnameConfigurationCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GatewayHostnameConfigurationContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Gateway hostname configuration details."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -3861,6 +5385,124 @@ impl GenerateSsoUrlResult { Self::default() } } +#[doc = "The response of the list schema operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GlobalSchemaCollection { + #[doc = "Global Schema Contract value."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for GlobalSchemaCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl GlobalSchemaCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Global Schema Contract details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GlobalSchemaContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Schema create or update contract Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl GlobalSchemaContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Schema create or update contract Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GlobalSchemaContractProperties { + #[doc = "Schema Type. Immutable."] + #[serde(rename = "schemaType")] + pub schema_type: global_schema_contract_properties::SchemaType, + #[doc = "Free-form schema entity description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Json-encoded string for non json-based schema."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "Global Schema Document Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub document: Option, +} +impl GlobalSchemaContractProperties { + pub fn new(schema_type: global_schema_contract_properties::SchemaType) -> Self { + Self { + schema_type, + description: None, + value: None, + document: None, + } + } +} +pub mod global_schema_contract_properties { + use super::*; + #[doc = "Schema Type. Immutable."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SchemaType")] + pub enum SchemaType { + #[serde(rename = "xml")] + Xml, + #[serde(rename = "json")] + Json, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SchemaType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SchemaType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SchemaType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Xml => serializer.serialize_unit_variant("SchemaType", 0u32, "xml"), + Self::Json => serializer.serialize_unit_variant("SchemaType", 1u32, "json"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Global Schema Document Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GlobalSchemaDocumentProperties {} +impl GlobalSchemaDocumentProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Paged Group list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupCollection { @@ -3893,7 +5535,7 @@ impl GroupCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GroupContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Group contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4043,6 +5685,19 @@ pub mod group_update_parameters_properties { External, } } +#[doc = "HTTP header and it's value."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpHeader { + #[doc = "Header name."] + pub name: String, + #[doc = "Header value."] + pub value: String, +} +impl HttpHeader { + pub fn new(name: String, value: String) -> Self { + Self { name, value } + } +} #[doc = "Custom hostname configuration."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HostnameConfiguration { @@ -4064,7 +5719,7 @@ pub struct HostnameConfiguration { #[doc = "Certificate Password."] #[serde(rename = "certificatePassword", default, skip_serializing_if = "Option::is_none")] pub certificate_password: Option, - #[doc = "Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type."] + #[doc = "Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to gateway Hostname Type."] #[serde(rename = "defaultSslBinding", default, skip_serializing_if = "Option::is_none")] pub default_ssl_binding: Option, #[doc = "Specify true to always negotiate client certificate on the hostname. Default Value is false."] @@ -4073,6 +5728,12 @@ pub struct HostnameConfiguration { #[doc = "SSL certificate information."] #[serde(default, skip_serializing_if = "Option::is_none")] pub certificate: Option, + #[doc = "Certificate Source."] + #[serde(rename = "certificateSource", default, skip_serializing_if = "Option::is_none")] + pub certificate_source: Option, + #[doc = "Certificate Status."] + #[serde(rename = "certificateStatus", default, skip_serializing_if = "Option::is_none")] + pub certificate_status: Option, } impl HostnameConfiguration { pub fn new(type_: hostname_configuration::Type, host_name: String) -> Self { @@ -4086,6 +5747,8 @@ impl HostnameConfiguration { default_ssl_binding: None, negotiate_client_certificate: None, certificate: None, + certificate_source: None, + certificate_status: None, } } } @@ -4134,6 +5797,86 @@ pub mod hostname_configuration { } } } + #[doc = "Certificate Source."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CertificateSource")] + pub enum CertificateSource { + Managed, + KeyVault, + Custom, + BuiltIn, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CertificateSource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CertificateSource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CertificateSource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Managed => serializer.serialize_unit_variant("CertificateSource", 0u32, "Managed"), + Self::KeyVault => serializer.serialize_unit_variant("CertificateSource", 1u32, "KeyVault"), + Self::Custom => serializer.serialize_unit_variant("CertificateSource", 2u32, "Custom"), + Self::BuiltIn => serializer.serialize_unit_variant("CertificateSource", 3u32, "BuiltIn"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Certificate Status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CertificateStatus")] + pub enum CertificateStatus { + Completed, + Failed, + InProgress, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CertificateStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CertificateStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CertificateStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Completed => serializer.serialize_unit_variant("CertificateStatus", 0u32, "Completed"), + Self::Failed => serializer.serialize_unit_variant("CertificateStatus", 1u32, "Failed"), + Self::InProgress => serializer.serialize_unit_variant("CertificateStatus", 2u32, "InProgress"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } } #[doc = "Http message diagnostic settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] @@ -4188,6 +5931,9 @@ pub struct IdentityProviderBaseParameters { #[doc = "Password Reset Policy Name. Only applies to AAD B2C Identity Provider."] #[serde(rename = "passwordResetPolicyName", default, skip_serializing_if = "Option::is_none")] pub password_reset_policy_name: Option, + #[doc = "The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider."] + #[serde(rename = "clientLibrary", default, skip_serializing_if = "Option::is_none")] + pub client_library: Option, } impl IdentityProviderBaseParameters { pub fn new() -> Self { @@ -4252,7 +5998,7 @@ pub mod identity_provider_base_parameters { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityProviderContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management service developer portal for all users."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4287,7 +6033,7 @@ impl IdentityProviderContractProperties { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IdentityProviderCreateContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "The external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management service developer portal for all users."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4407,7 +6153,7 @@ impl IssueAttachmentCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IssueAttachmentContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Issue Attachment contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4497,7 +6243,7 @@ impl IssueCommentCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IssueCommentContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Issue Comment contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4528,11 +6274,19 @@ impl IssueCommentContractProperties { } } } +#[doc = "A key-value pair that provides additional context on the issue."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IssueContext {} +impl IssueContext { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Issue Contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct IssueContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Issue contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4669,7 +6423,7 @@ impl IssueUpdateContractProperties { #[doc = "Create keyVault contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct KeyVaultContractCreateProperties { - #[doc = "Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires Api Management service to be configured with aka.ms/apimmsi"] + #[doc = "Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi"] #[serde(rename = "secretIdentifier", default, skip_serializing_if = "Option::is_none")] pub secret_identifier: Option, #[doc = "Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity , which will be used to access key vault secret."] @@ -4745,7 +6499,7 @@ impl LoggerCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LoggerContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "The Logger entity in API Management represents an event sink that you can use to log API Management events. Currently the Logger entity supports logging API Management events to Azure Event Hubs."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4940,7 +6694,7 @@ impl NamedValueCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NamedValueContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "NamedValue Contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -4979,7 +6733,7 @@ impl NamedValueContractProperties { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NamedValueCreateContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "NamedValue Contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -5142,7 +6896,7 @@ impl NotificationCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotificationContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Notification Contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -5240,7 +6994,7 @@ impl OpenIdConnectProviderCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OpenidConnectProviderContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "OpenID Connect Providers Contract."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -5268,6 +7022,12 @@ pub struct OpenidConnectProviderContractProperties { #[doc = "Client Secret of developer console which is the client application."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] pub client_secret: Option, + #[doc = "If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is provided."] + #[serde(rename = "useInTestConsole", default, skip_serializing_if = "Option::is_none")] + pub use_in_test_console: Option, + #[doc = "If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if no value is provided."] + #[serde(rename = "useInApiDocumentation", default, skip_serializing_if = "Option::is_none")] + pub use_in_api_documentation: Option, } impl OpenidConnectProviderContractProperties { pub fn new(display_name: String, metadata_endpoint: String, client_id: String) -> Self { @@ -5277,6 +7037,8 @@ impl OpenidConnectProviderContractProperties { metadata_endpoint, client_id, client_secret: None, + use_in_test_console: None, + use_in_api_documentation: None, } } } @@ -5310,6 +7072,12 @@ pub struct OpenidConnectProviderUpdateContractProperties { #[doc = "Client Secret of developer console which is the client application."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] pub client_secret: Option, + #[doc = "If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is provided."] + #[serde(rename = "useInTestConsole", default, skip_serializing_if = "Option::is_none")] + pub use_in_test_console: Option, + #[doc = "If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if no value is provided."] + #[serde(rename = "useInApiDocumentation", default, skip_serializing_if = "Option::is_none")] + pub use_in_api_documentation: Option, } impl OpenidConnectProviderUpdateContractProperties { pub fn new() -> Self { @@ -5389,11 +7157,11 @@ impl OperationCollection { Self::default() } } -#[doc = "Api Operation details."] +#[doc = "API Operation details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Operation Contract Properties"] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -5427,7 +7195,7 @@ impl OperationContractProperties { } } } -#[doc = "Api Operation Entity Base Contract details."] +#[doc = "API Operation Entity Base Contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationEntityBaseContract { #[doc = "Collection of URL template parameters."] @@ -5485,15 +7253,29 @@ impl OperationListResult { Self::default() } } -#[doc = "Operation Result."] +#[doc = "Long Running Git Operation Results."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationResultContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Operation Result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl OperationResultContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Operation Result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationResultContractProperties { #[doc = "Operation result identifier."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, #[doc = "Status of an async operation."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, #[doc = "Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"] #[serde(default, with = "azure_core::date::rfc3339::option")] pub started: Option, @@ -5515,12 +7297,12 @@ pub struct OperationResultContract { )] pub action_log: Vec, } -impl OperationResultContract { +impl OperationResultContractProperties { pub fn new() -> Self { Self::default() } } -pub mod operation_result_contract { +pub mod operation_result_contract_properties { use super::*; #[doc = "Status of an async operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -5558,13 +7340,13 @@ pub struct OperationTagResourceContractProperties { #[doc = "Operation name."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - #[doc = "Api Name."] + #[doc = "API Name."] #[serde(rename = "apiName", default, skip_serializing_if = "Option::is_none")] pub api_name: Option, - #[doc = "Api Revision."] + #[doc = "API Revision."] #[serde(rename = "apiRevision", default, skip_serializing_if = "Option::is_none")] pub api_revision: Option, - #[doc = "Api Version."] + #[doc = "API Version."] #[serde(rename = "apiVersion", default, skip_serializing_if = "Option::is_none")] pub api_version: Option, #[doc = "Operation Description."] @@ -5582,7 +7364,7 @@ impl OperationTagResourceContractProperties { Self::default() } } -#[doc = "Api Operation Update Contract details."] +#[doc = "API Operation Update Contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OperationUpdateContract { #[doc = "Operation Update Contract Properties."] @@ -5604,16 +7386,49 @@ pub struct OperationUpdateContractProperties { pub display_name: Option, #[doc = "A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub method: Option, - #[doc = "Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}"] - #[serde(rename = "urlTemplate", default, skip_serializing_if = "Option::is_none")] - pub url_template: Option, + pub method: Option, + #[doc = "Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}"] + #[serde(rename = "urlTemplate", default, skip_serializing_if = "Option::is_none")] + pub url_template: Option, +} +impl OperationUpdateContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Endpoints accessed for a common purpose that the Api Management Service requires outbound network access to."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OutboundEnvironmentEndpoint { + #[doc = "The type of service accessed by the Api Management Service, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The endpoints that the Api Management Service reaches the service at."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoints: Vec, } -impl OperationUpdateContractProperties { +impl OutboundEnvironmentEndpoint { pub fn new() -> Self { Self::default() } } +#[doc = "Collection of Outbound Environment Endpoints"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OutboundEnvironmentEndpointList { + #[doc = "Collection of resources."] + pub value: Vec, + #[doc = "Link to next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl OutboundEnvironmentEndpointList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} #[doc = "Operation parameters details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ParameterContract { @@ -5638,6 +7453,15 @@ pub struct ParameterContract { skip_serializing_if = "Vec::is_empty" )] pub values: Vec, + #[doc = "Schema identifier."] + #[serde(rename = "schemaId", default, skip_serializing_if = "Option::is_none")] + pub schema_id: Option, + #[doc = "Type name defined by the schema."] + #[serde(rename = "typeName", default, skip_serializing_if = "Option::is_none")] + pub type_name: Option, + #[doc = "Parameter examples."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub examples: Option, } impl ParameterContract { pub fn new(name: String, type_: String) -> Self { @@ -5648,9 +7472,41 @@ impl ParameterContract { default_value: None, required: None, values: Vec::new(), + schema_id: None, + type_name: None, + examples: None, } } } +#[doc = "Parameter example."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ParameterExampleContract { + #[doc = "Short description for the example"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option, + #[doc = "Long description for the example"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Example value. May be a primitive value, or an object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "A URL that points to the literal example"] + #[serde(rename = "externalValue", default, skip_serializing_if = "Option::is_none")] + pub external_value: Option, +} +impl ParameterExampleContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Parameter examples."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ParameterExamplesContract {} +impl ParameterExamplesContract { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Diagnostic settings for incoming/outgoing HTTP messages to the Gateway."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PipelineDiagnosticSettings { @@ -5683,6 +7539,12 @@ pub struct PolicyCollection { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, } +impl azure_core::Continuable for PolicyCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} impl PolicyCollection { pub fn new() -> Self { Self::default() @@ -5692,7 +7554,7 @@ impl PolicyCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Policy contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -5769,10 +7631,10 @@ pub mod policy_contract_properties { } } } -#[doc = "Descriptions of APIM policies."] +#[doc = "Descriptions of API Management policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PolicyDescriptionCollection { - #[doc = "Descriptions of APIM policies."] + #[doc = "Descriptions of API Management policies."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -5783,36 +7645,364 @@ pub struct PolicyDescriptionCollection { #[serde(default, skip_serializing_if = "Option::is_none")] pub count: Option, } -impl PolicyDescriptionCollection { +impl PolicyDescriptionCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Policy description details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PolicyDescriptionContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Policy description properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PolicyDescriptionContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Policy description properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PolicyDescriptionContractProperties { + #[doc = "Policy description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Binary OR value of the Snippet scope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option, +} +impl PolicyDescriptionContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response of the get policy fragments operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PolicyFragmentCollection { + #[doc = "Policy fragment contract value."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PolicyFragmentCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PolicyFragmentCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Policy fragment contract details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PolicyFragmentContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Policy fragment contract properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PolicyFragmentContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Policy fragment contract properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyFragmentContractProperties { + #[doc = "Contents of the policy fragment."] + pub value: String, + #[doc = "Policy fragment description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Format of the policy fragment content."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub format: Option, +} +impl PolicyFragmentContractProperties { + pub fn new(value: String) -> Self { + Self { + value, + description: None, + format: None, + } + } +} +pub mod policy_fragment_contract_properties { + use super::*; + #[doc = "Format of the policy fragment content."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Format")] + pub enum Format { + #[serde(rename = "xml")] + Xml, + #[serde(rename = "rawxml")] + Rawxml, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Format { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Format { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Format { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Xml => serializer.serialize_unit_variant("Format", 0u32, "xml"), + Self::Rawxml => serializer.serialize_unit_variant("Format", 1u32, "rawxml"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Format { + fn default() -> Self { + Self::Xml + } + } +} +#[doc = "The collection of the developer portal configurations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PortalConfigCollection { + #[doc = "The developer portal configurations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PortalConfigCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PortalConfigCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The developer portal configuration contract."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PortalConfigContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The developer portal configuration contract properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PortalConfigContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The developer portal Cross-Origin Resource Sharing (CORS) settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PortalConfigCorsProperties { + #[doc = "Allowed origins, e.g. `https://trusted.com`."] + #[serde( + rename = "allowedOrigins", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_origins: Vec, +} +impl PortalConfigCorsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The developer portal Content Security Policy (CSP) settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PortalConfigCspProperties { + #[doc = "The mode of the developer portal Content Security Policy (CSP)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[doc = "The URLs used by the browser to report CSP violations."] + #[serde( + rename = "reportUri", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub report_uri: Vec, + #[doc = "Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`."] + #[serde( + rename = "allowedSources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_sources: Vec, +} +impl PortalConfigCspProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod portal_config_csp_properties { + use super::*; + #[doc = "The mode of the developer portal Content Security Policy (CSP)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Mode")] + pub enum Mode { + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "disabled")] + Disabled, + #[serde(rename = "reportOnly")] + ReportOnly, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Mode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Mode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Mode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Mode", 0u32, "enabled"), + Self::Disabled => serializer.serialize_unit_variant("Mode", 1u32, "disabled"), + Self::ReportOnly => serializer.serialize_unit_variant("Mode", 2u32, "reportOnly"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Mode { + fn default() -> Self { + Self::Disabled + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PortalConfigDelegationProperties { + #[doc = "Enable or disable delegation for user registration."] + #[serde(rename = "delegateRegistration", default, skip_serializing_if = "Option::is_none")] + pub delegate_registration: Option, + #[doc = "Enable or disable delegation for product subscriptions."] + #[serde(rename = "delegateSubscription", default, skip_serializing_if = "Option::is_none")] + pub delegate_subscription: Option, + #[doc = "A delegation endpoint URL."] + #[serde(rename = "delegationUrl", default, skip_serializing_if = "Option::is_none")] + pub delegation_url: Option, + #[doc = "A base64-encoded validation key to ensure requests originate from Azure API Management service."] + #[serde(rename = "validationKey", default, skip_serializing_if = "Option::is_none")] + pub validation_key: Option, +} +impl PortalConfigDelegationProperties { pub fn new() -> Self { Self::default() } } -#[doc = "Policy description details."] +#[doc = "The developer portal configuration contract properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PolicyDescriptionContract { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Policy description properties."] +pub struct PortalConfigProperties { + #[doc = "Enable or disable Basic authentication method."] + #[serde(rename = "enableBasicAuth", default, skip_serializing_if = "Option::is_none")] + pub enable_basic_auth: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub signin: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signup: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub delegation: Option, + #[doc = "The developer portal Cross-Origin Resource Sharing (CORS) settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cors: Option, + #[doc = "The developer portal Content Security Policy (CSP) settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub csp: Option, } -impl PolicyDescriptionContract { +impl PortalConfigProperties { pub fn new() -> Self { Self::default() } } -#[doc = "Policy description properties."] +pub mod portal_config_properties { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Signin { + #[doc = "Redirect anonymous users to the sign-in page."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub require: Option, + } + impl Signin { + pub fn new() -> Self { + Self::default() + } + } + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Signup { + #[doc = "Terms of service contract properties."] + #[serde(rename = "termsOfService", default, skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option, + } + impl Signup { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Terms of service contract properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PolicyDescriptionContractProperties { - #[doc = "Policy description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Binary OR value of the Snippet scope."] +pub struct PortalConfigTermsOfServiceProperties { + #[doc = "A terms of service text."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, + pub text: Option, + #[doc = "Ask user for consent to the terms of service."] + #[serde(rename = "requireConsent", default, skip_serializing_if = "Option::is_none")] + pub require_consent: Option, } -impl PolicyDescriptionContractProperties { +impl PortalConfigTermsOfServiceProperties { pub fn new() -> Self { Self::default() } @@ -5821,7 +8011,7 @@ impl PolicyDescriptionContractProperties { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PortalDelegationSettings { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Delegation settings contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -5877,11 +8067,11 @@ impl PortalRevisionCollection { Self::default() } } -#[doc = "Portal revisions contract details."] +#[doc = "Portal Revision's contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PortalRevisionContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -5898,13 +8088,13 @@ pub struct PortalRevisionContractProperties { #[doc = "Portal revision publishing status details."] #[serde(rename = "statusDetails", default, skip_serializing_if = "Option::is_none")] pub status_details: Option, - #[doc = "Portal revision publishing status"] + #[doc = "Status of the portal's revision."] #[serde(default, skip_serializing_if = "Option::is_none")] pub status: Option, - #[doc = "Indicates if the Portal Revision is public."] + #[doc = "Indicates if the portal's revision is public."] #[serde(rename = "isCurrent", default, skip_serializing_if = "Option::is_none")] pub is_current: Option, - #[doc = "Portal revision creation date and time."] + #[doc = "Portal's revision creation date and time."] #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] pub created_date_time: Option, #[doc = "Last updated date and time."] @@ -5918,7 +8108,7 @@ impl PortalRevisionContractProperties { } pub mod portal_revision_contract_properties { use super::*; - #[doc = "Portal revision publishing status"] + #[doc = "Status of the portal's revision."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "Status")] pub enum Status { @@ -5976,10 +8166,10 @@ impl PortalSettingValidationKeyContract { Self::default() } } -#[doc = "Descriptions of APIM policies."] +#[doc = "Descriptions of API Management policies."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PortalSettingsCollection { - #[doc = "Descriptions of APIM policies."] + #[doc = "Descriptions of API Management policies."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -5999,7 +8189,7 @@ impl PortalSettingsCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PortalSettingsContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Sign-in settings contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -6052,7 +8242,7 @@ impl PortalSigninSettingProperties { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PortalSigninSettings { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Sign-in settings contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -6066,7 +8256,7 @@ impl PortalSigninSettings { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PortalSignupSettings { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Sign-up settings contract properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -6081,16 +8271,357 @@ impl PortalSignupSettings { pub struct PortalSignupSettingsProperties { #[doc = "Allow users to sign up on a developer portal."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Terms of service contract properties."] - #[serde(rename = "termsOfService", default, skip_serializing_if = "Option::is_none")] - pub terms_of_service: Option, + pub enabled: Option, + #[doc = "Terms of service contract properties."] + #[serde(rename = "termsOfService", default, skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option, +} +impl PortalSignupSettingsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Private Endpoint resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpoint { + #[doc = "The ARM identifier for Private Endpoint"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl PrivateEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Private Endpoint Connection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnection { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the PrivateEndpointConnectProperties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PrivateEndpointConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of private endpoint connection associated with the specified storage account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionListResult { + #[doc = "Array of private endpoint connections"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for PrivateEndpointConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl PrivateEndpointConnectionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the PrivateEndpointConnectProperties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnectionProperties { + #[doc = "The Private Endpoint resource."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "A collection of information about the state of the connection between service consumer and provider."] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PrivateEndpointConnectionProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { + Self { + private_endpoint: None, + private_link_service_connection_state, + provisioning_state: None, + } + } +} +#[doc = "The current provisioning state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointConnectionProvisioningState")] +pub enum PrivateEndpointConnectionProvisioningState { + Succeeded, + Creating, + Deleting, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointConnectionProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointConnectionProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), + Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), + Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A request to approve or reject a private endpoint connection"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionRequest { + #[doc = "Private Endpoint Connection Resource Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The connection state of the private endpoint connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PrivateEndpointConnectionRequest { + pub fn new() -> Self { + Self::default() + } +} +pub mod private_endpoint_connection_request { + use super::*; + #[doc = "The connection state of the private endpoint connection."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "A collection of information about the state of the connection between service consumer and provider."] + #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] + pub private_link_service_connection_state: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Properties of the PrivateEndpointConnectProperties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnectionWrapperProperties { + #[doc = "A wrapper for an ARM resource id"] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "A collection of information about the state of the connection between service consumer and provider."] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The provisioning state of the private endpoint connection resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "All the Group ids."] + #[serde( + rename = "groupIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub group_ids: Vec, +} +impl PrivateEndpointConnectionWrapperProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { + Self { + private_endpoint: None, + private_link_service_connection_state, + provisioning_state: None, + group_ids: Vec::new(), + } + } +} +#[doc = "The private endpoint connection status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointServiceConnectionStatus")] +pub enum PrivateEndpointServiceConnectionStatus { + Pending, + Approved, + Rejected, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointServiceConnectionStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointServiceConnectionStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"), + Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A private link resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of a private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of private link resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceListResult { + #[doc = "Array of private link resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl PrivateLinkResourceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceProperties { + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "The private link resource required member names."] + #[serde( + rename = "requiredMembers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_members: Vec, + #[doc = "The private link resource Private link DNS zone name."] + #[serde( + rename = "requiredZoneNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_zone_names: Vec, +} +impl PrivateLinkResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A collection of information about the state of the connection between service consumer and provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkServiceConnectionState { + #[doc = "The private endpoint connection status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason for approval/rejection of the connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "A message indicating if changes on the service provider require any updates on the consumer."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl PrivateLinkServiceConnectionState { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paged Product-API link list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProductApiLinkCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ProductApiLinkCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ProductApiLinkCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Product-API link details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProductApiLinkContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Product-API link entity properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, } -impl PortalSignupSettingsProperties { +impl ProductApiLinkContract { pub fn new() -> Self { Self::default() } } +#[doc = "Product-API link entity properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProductApiLinkContractProperties { + #[doc = "Full resource Id of an API."] + #[serde(rename = "apiId")] + pub api_id: String, +} +impl ProductApiLinkContractProperties { + pub fn new(api_id: String) -> Self { + Self { api_id } + } +} #[doc = "Paged Products list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProductCollection { @@ -6123,7 +8654,7 @@ impl ProductCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProductContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Product profile."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -6188,6 +8719,60 @@ pub mod product_entity_base_parameters { Published, } } +#[doc = "Paged Product-group link list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProductGroupLinkCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ProductGroupLinkCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ProductGroupLinkCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Product-group link details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProductGroupLinkContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Product-group link entity properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ProductGroupLinkContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Product-group link entity properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProductGroupLinkContractProperties { + #[doc = "Full resource Id of a group."] + #[serde(rename = "groupId")] + pub group_id: String, +} +impl ProductGroupLinkContractProperties { + pub fn new(group_id: String) -> Self { + Self { group_id } + } +} #[doc = "Product profile."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProductTagResourceContractProperties { @@ -6234,6 +8819,17 @@ impl ProductUpdateProperties { Self::default() } } +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Paged Quota Counter list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct QuotaCounterCollection { @@ -6356,7 +8952,7 @@ impl RecipientEmailCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecipientEmailContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Recipient Email Contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -6404,7 +9000,7 @@ impl RecipientUserCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RecipientUserContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Recipient User Contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -6507,6 +9103,27 @@ impl RegistrationDelegationSettingsProperties { Self::default() } } +#[doc = "Remote Private Endpoint Connection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RemotePrivateEndpointConnectionWrapper { + #[doc = "Private Endpoint connection resource id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Private Endpoint Connection Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Private Endpoint Connection Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Properties of the PrivateEndpointConnectProperties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RemotePrivateEndpointConnectionWrapper { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Paged Report records list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ReportCollection { @@ -6580,7 +9197,7 @@ pub struct ReportRecordContract { #[doc = "Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests"] #[serde(rename = "callCountBlocked", default, skip_serializing_if = "Option::is_none")] pub call_count_blocked: Option, - #[doc = "Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600"] + #[doc = "Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600"] #[serde(rename = "callCountFailed", default, skip_serializing_if = "Option::is_none")] pub call_count_failed: Option, #[doc = "Number of other calls."] @@ -6628,9 +9245,6 @@ pub struct RepresentationContract { #[doc = "Specifies a registered or custom content type for this representation, e.g. application/xml."] #[serde(rename = "contentType")] pub content_type: String, - #[doc = "An example of the representation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sample: Option, #[doc = "Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'."] #[serde(rename = "schemaId", default, skip_serializing_if = "Option::is_none")] pub schema_id: Option, @@ -6645,15 +9259,18 @@ pub struct RepresentationContract { skip_serializing_if = "Vec::is_empty" )] pub form_parameters: Vec, + #[doc = "Parameter examples."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub examples: Option, } impl RepresentationContract { pub fn new(content_type: String) -> Self { Self { content_type, - sample: None, schema_id: None, type_name: None, form_parameters: Vec::new(), + examples: None, } } } @@ -6779,16 +9396,184 @@ impl RequestReportRecordContract { Self::default() } } -#[doc = "The Resource definition."] +#[doc = "Paged Resolver list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ResolverCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ResolverCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "GraphQL API Resolver details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "GraphQL API Resolver Entity Base Contract details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ResolverContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "GraphQL API Resolver Entity Base Contract details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverEntityBaseContract { + #[doc = "Resolver Name."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Path is type/field being resolved."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "Description of the resolver. May include HTML formatting tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl ResolverEntityBaseContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Long Running Git Resolver Results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverResultContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Resolver Result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ResolverResultContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Resolver Result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverResultContractProperties { + #[doc = "Resolver result identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Status of an async resolver."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Start time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub started: Option, + #[doc = "Last update time of an async resolver. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub updated: Option, + #[doc = "Optional result info."] + #[serde(rename = "resultInfo", default, skip_serializing_if = "Option::is_none")] + pub result_info: Option, + #[doc = "Error Body contract."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + #[doc = "This property if only provided as part of the TenantConfiguration_Validate resolver. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy resolver."] + #[serde( + rename = "actionLog", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub action_log: Vec, +} +impl ResolverResultContractProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod resolver_result_contract_properties { + use super::*; + #[doc = "Status of an async resolver."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + Started, + InProgress, + Succeeded, + Failed, + } +} +#[doc = "Log of the entity being created, updated or deleted."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverResultLogItemContract { + #[doc = "The type of entity contract."] + #[serde(rename = "objectType", default, skip_serializing_if = "Option::is_none")] + pub object_type: Option, + #[doc = "Action like create/update/delete."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option, + #[doc = "Identifier of the entity being created/updated/deleted."] + #[serde(rename = "objectKey", default, skip_serializing_if = "Option::is_none")] + pub object_key: Option, +} +impl ResolverResultLogItemContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "GraphQL API Resolver Update Contract details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverUpdateContract { + #[doc = "Resolver Update Contract Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ResolverUpdateContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Resolver Update Contract Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResolverUpdateContractProperties { + #[doc = "Resolver Name."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Path is type/field being resolved."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "Description of the resolver. May include HTML formatting tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl ResolverUpdateContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Resource { - #[doc = "Resource ID."] + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, - #[doc = "Resource name."] + #[doc = "The name of the resource"] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - #[doc = "Resource type for API Management resource."] + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, } @@ -6797,6 +9582,28 @@ impl Resource { Self::default() } } +#[doc = "A collection of resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceCollection { + #[doc = "A collection of resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl ResourceCollection { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Resource location data properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResourceLocationDataContract { @@ -7103,7 +9910,7 @@ impl SaveConfigurationParameterProperties { #[doc = "The response of the list schema operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SchemaCollection { - #[doc = "Api Schema Contract value."] + #[doc = "API Schema Contract value."] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -7128,11 +9935,11 @@ impl SchemaCollection { Self::default() } } -#[doc = "Schema Contract details."] +#[doc = "API Schema Contract details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SchemaContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "API Schema create or update contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -7148,27 +9955,26 @@ pub struct SchemaContractProperties { #[doc = "Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`."] #[serde(rename = "contentType")] pub content_type: String, - #[doc = "Schema Document Properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub document: Option, + #[doc = "Api Schema Document Properties."] + pub document: SchemaDocumentProperties, } impl SchemaContractProperties { - pub fn new(content_type: String) -> Self { - Self { - content_type, - document: None, - } + pub fn new(content_type: String, document: SchemaDocumentProperties) -> Self { + Self { content_type, document } } } -#[doc = "Schema Document Properties."] +#[doc = "Api Schema Document Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SchemaDocumentProperties { #[doc = "Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI."] #[serde(default, skip_serializing_if = "Option::is_none")] pub value: Option, - #[doc = "Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise."] + #[doc = "Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise."] #[serde(default, skip_serializing_if = "Option::is_none")] pub definitions: Option, + #[doc = "Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub components: Option, } impl SchemaDocumentProperties { pub fn new() -> Self { @@ -7207,7 +10013,7 @@ impl SubscriptionCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SubscriptionContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Subscription details."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -7456,23 +10262,77 @@ pub struct SubscriptionUpdateParameters { #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } -impl SubscriptionUpdateParameters { +impl SubscriptionUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Subscriptions delegation settings properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubscriptionsDelegationSettingsProperties { + #[doc = "Enable or disable delegation for subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl SubscriptionsDelegationSettingsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paged Tag-API link list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagApiLinkCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TagApiLinkCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TagApiLinkCollection { pub fn new() -> Self { Self::default() } } -#[doc = "Subscriptions delegation settings properties."] +#[doc = "Tag-API link details."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SubscriptionsDelegationSettingsProperties { - #[doc = "Enable or disable delegation for subscriptions."] +pub struct TagApiLinkContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Tag-API link entity properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, + pub properties: Option, } -impl SubscriptionsDelegationSettingsProperties { +impl TagApiLinkContract { pub fn new() -> Self { Self::default() } } +#[doc = "Tag-API link entity properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagApiLinkContractProperties { + #[doc = "Full resource Id of an API."] + #[serde(rename = "apiId")] + pub api_id: String, +} +impl TagApiLinkContractProperties { + pub fn new(api_id: String) -> Self { + Self { api_id } + } +} #[doc = "Paged Tag list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TagCollection { @@ -7505,7 +10365,7 @@ impl TagCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TagContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Tag contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -7589,7 +10449,7 @@ impl TagDescriptionCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TagDescriptionContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "TagDescription contract Properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -7628,6 +10488,114 @@ impl TagDescriptionCreateParameters { Self::default() } } +#[doc = "Paged Tag-operation link list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagOperationLinkCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TagOperationLinkCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TagOperationLinkCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Tag-operation link details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagOperationLinkContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Tag-operation link entity properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TagOperationLinkContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Tag-operation link entity properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagOperationLinkContractProperties { + #[doc = "Full resource Id of an API operation."] + #[serde(rename = "operationId")] + pub operation_id: String, +} +impl TagOperationLinkContractProperties { + pub fn new(operation_id: String) -> Self { + Self { operation_id } + } +} +#[doc = "Paged Tag-product link list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagProductLinkCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TagProductLinkCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TagProductLinkCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Tag-product link details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagProductLinkContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Tag-product link entity properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TagProductLinkContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Tag-product link entity properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagProductLinkContractProperties { + #[doc = "Full resource Id of a product."] + #[serde(rename = "productId")] + pub product_id: String, +} +impl TagProductLinkContractProperties { + pub fn new(product_id: String) -> Self { + Self { product_id } + } +} #[doc = "Paged Tag list representation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TagResourceCollection { @@ -7696,9 +10664,23 @@ impl TagTagResourceContractProperties { Self::default() } } -#[doc = "Tenant Configuration Synchronization State."] +#[doc = "Result of Tenant Configuration Sync State."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TenantConfigurationSyncStateContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Tenant Configuration Synchronization State."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TenantConfigurationSyncStateContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Tenant Configuration Synchronization State."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TenantConfigurationSyncStateContractProperties { #[doc = "The name of Git branch."] #[serde(default, skip_serializing_if = "Option::is_none")] pub branch: Option, @@ -7720,8 +10702,11 @@ pub struct TenantConfigurationSyncStateContract { #[doc = "The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n"] #[serde(rename = "configurationChangeDate", default, with = "azure_core::date::rfc3339::option")] pub configuration_change_date: Option, + #[doc = "Most recent tenant configuration operation identifier"] + #[serde(rename = "lastOperationId", default, skip_serializing_if = "Option::is_none")] + pub last_operation_id: Option, } -impl TenantConfigurationSyncStateContract { +impl TenantConfigurationSyncStateContractProperties { pub fn new() -> Self { Self::default() } @@ -7755,7 +10740,7 @@ impl TenantSettingsCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TenantSettingsContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "Tenant access information contract of the API Management service."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -7840,7 +10825,7 @@ impl UserCollection { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserContract { #[serde(flatten)] - pub resource: Resource, + pub proxy_resource: ProxyResource, #[doc = "User profile."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -8249,6 +11234,145 @@ impl VirtualNetworkConfiguration { Self::default() } } +#[doc = "Paged Wiki list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WikiCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WikiCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WikiCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Wiki properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WikiContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Wiki contract details"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WikiContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Wiki contract details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WikiContractProperties { + #[doc = "Collection wiki documents included into this wiki."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub documents: Vec, +} +impl WikiContractProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Wiki documentation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WikiDocumentationContract { + #[doc = "Documentation Identifier"] + #[serde(rename = "documentationId", default, skip_serializing_if = "Option::is_none")] + pub documentation_id: Option, +} +impl WikiDocumentationContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Wiki update contract details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WikiUpdateContract { + #[doc = "Wiki contract details"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WikiUpdateContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Paged workspace list representation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceCollection { + #[doc = "Page values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Total record count number across all pages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Next page link if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WorkspaceCollection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceContract { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Workspace entity properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceContract { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace entity properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceContractProperties { + #[doc = "Name of the workspace."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Description of the workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl WorkspaceContractProperties { + pub fn new(display_name: String) -> Self { + Self { + display_name, + description: None, + } + } +} #[doc = "Properties of server X509Names."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct X509CertificateName { @@ -8264,3 +11388,115 @@ impl X509CertificateName { Self::default() } } +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/appconfiguration/src/package_2023_03_01/mod.rs b/services/mgmt/appconfiguration/src/package_2023_03_01/mod.rs index bab4b06b68..e19c2957f5 100644 --- a/services/mgmt/appconfiguration/src/package_2023_03_01/mod.rs +++ b/services/mgmt/appconfiguration/src/package_2023_03_01/mod.rs @@ -2398,7 +2398,7 @@ pub mod key_values { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets the properties of the specified key-value."] + #[doc = "Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios involving App Configuration key-values the data plane API should be used instead."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The Microsoft Azure subscription ID."] @@ -2420,7 +2420,7 @@ pub mod key_values { key_value_name: key_value_name.into(), } } - #[doc = "Creates a key-value."] + #[doc = "Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios involving App Configuration key-values the data plane API should be used instead."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The Microsoft Azure subscription ID."] @@ -2443,7 +2443,7 @@ pub mod key_values { key_value_parameters: None, } } - #[doc = "Deletes a key-value."] + #[doc = "Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios involving App Configuration key-values the data plane API should be used instead."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The Microsoft Azure subscription ID."] diff --git a/services/mgmt/arcdata/Cargo.toml b/services/mgmt/arcdata/Cargo.toml index e962026e5e..dd3e5f670b 100644 --- a/services/mgmt/arcdata/Cargo.toml +++ b/services/mgmt/arcdata/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-03", "enable_reqwest"] +default = ["package-preview-2023-01", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] -"package-preview-2023-03" = [] "package-preview-2023-01" = [] "package-preview-2022-06" = [] "package-preview-2022-03" = [] -"package-preview-2021-07-01" = [] \ No newline at end of file +"package-preview-2021-07-01" = [] +"package-preview-2021-06-01" = [] \ No newline at end of file diff --git a/services/mgmt/arcdata/README.md b/services/mgmt/arcdata/README.md index b2e070c9ff..2ebaef3cc7 100644 --- a/services/mgmt/arcdata/README.md +++ b/services/mgmt/arcdata/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/azurearcda To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-03`. +The default tag is `package-preview-2023-01`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: -- `package-preview-2023-03` has 59 operations from 1 API versions: `2023-03-15-preview`. Use crate feature `package-preview-2023-03` to enable. The operations will be in the `package_preview_2023_03` module. - `package-preview-2023-01` has 38 operations from 1 API versions: `2023-01-15-preview`. Use crate feature `package-preview-2023-01` to enable. The operations will be in the `package_preview_2023_01` module. - `package-preview-2022-06` has 34 operations from 1 API versions: `2022-06-15-preview`. Use crate feature `package-preview-2022-06` to enable. The operations will be in the `package_preview_2022_06` module. - `package-preview-2022-03` has 29 operations from 1 API versions: `2022-03-01-preview`. Use crate feature `package-preview-2022-03` to enable. The operations will be in the `package_preview_2022_03` module. -- `package-preview-2021-07-01` has 25 operations from 1 API versions: `2021-07-01-preview`. Use crate feature `package-preview-2021-07-01` to enable. The operations will be in the `package_preview_2021_07_01` module. \ No newline at end of file +- `package-preview-2021-07-01` has 25 operations from 1 API versions: `2021-07-01-preview`. Use crate feature `package-preview-2021-07-01` to enable. The operations will be in the `package_preview_2021_07_01` module. +- `package-preview-2021-06-01` has 25 operations from 1 API versions: `2021-06-01-preview`. Use crate feature `package-preview-2021-06-01` to enable. The operations will be in the `package_preview_2021_06_01` module. \ No newline at end of file diff --git a/services/mgmt/arcdata/src/lib.rs b/services/mgmt/arcdata/src/lib.rs index b6a3fc8d64..1da3afc053 100644 --- a/services/mgmt/arcdata/src/lib.rs +++ b/services/mgmt/arcdata/src/lib.rs @@ -3,10 +3,6 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] -#[cfg(feature = "package-preview-2023-03")] -pub mod package_preview_2023_03; -#[cfg(all(feature = "package-preview-2023-03", not(feature = "no-default-tag")))] -pub use package_preview_2023_03::*; #[cfg(feature = "package-preview-2023-01")] pub mod package_preview_2023_01; #[cfg(all(feature = "package-preview-2023-01", not(feature = "no-default-tag")))] @@ -23,3 +19,7 @@ pub use package_preview_2022_03::*; pub mod package_preview_2021_07_01; #[cfg(all(feature = "package-preview-2021-07-01", not(feature = "no-default-tag")))] pub use package_preview_2021_07_01::*; +#[cfg(feature = "package-preview-2021-06-01")] +pub mod package_preview_2021_06_01; +#[cfg(all(feature = "package-preview-2021-06-01", not(feature = "no-default-tag")))] +pub use package_preview_2021_06_01::*; diff --git a/services/mgmt/arcdata/src/package_preview_2021_06_01/mod.rs b/services/mgmt/arcdata/src/package_preview_2021_06_01/mod.rs new file mode 100644 index 0000000000..f3e0aec94b --- /dev/null +++ b/services/mgmt/arcdata/src/package_preview_2021_06_01/mod.rs @@ -0,0 +1,2921 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn data_controllers_client(&self) -> data_controllers::Client { + data_controllers::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn postgres_instances_client(&self) -> postgres_instances::Client { + postgres_instances::Client(self.clone()) + } + pub fn sql_managed_instances_client(&self) -> sql_managed_instances::Client { + sql_managed_instances::Client(self.clone()) + } + pub fn sql_server_instances_client(&self) -> sql_server_instances::Client { + sql_server_instances::Client(self.clone()) + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available Azure Data Services on Azure Arc API operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.AzureArcData/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod sql_managed_instances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List sqlManagedInstance resources in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List sqlManagedInstance resources in the resource group"] + #[doc = "Gets all sqlManagedInstances in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves a SQL Managed Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_managed_instance_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_managed_instance_name: sql_managed_instance_name.into(), + } + } + #[doc = "Creates or replaces a SQL Managed Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_managed_instance_name`: The name of SQL Managed Instances"] + #[doc = "* `sql_managed_instance`: The SQL Managed Instance to be created or updated."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_managed_instance_name: impl Into, + sql_managed_instance: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_managed_instance_name: sql_managed_instance_name.into(), + sql_managed_instance: sql_managed_instance.into(), + } + } + #[doc = "Updates a SQL Managed Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_managed_instance_name`: Name of sqlManagedInstance"] + #[doc = "* `parameters`: The SQL Managed Instance."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_managed_instance_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_managed_instance_name: sql_managed_instance_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a SQL Managed Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_managed_instance_name`: The name of Sql Managed Instances"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_managed_instance_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_managed_instance_name: sql_managed_instance_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlManagedInstanceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.AzureArcData/sqlManagedInstances", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlManagedInstanceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlManagedInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_managed_instance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_managed_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlManagedInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_managed_instance_name: String, + pub(crate) sql_managed_instance: models::SqlManagedInstance, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_managed_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.sql_managed_instance)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlManagedInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_managed_instance_name: String, + pub(crate) parameters: models::SqlManagedInstanceUpdate, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_managed_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_managed_instance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_managed_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod sql_server_instances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List sqlServerInstance resources in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List sqlServerInstance resources in the resource group"] + #[doc = "Gets all sqlServerInstances in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves a SQL Server Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_server_instance_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_server_instance_name: sql_server_instance_name.into(), + } + } + #[doc = "Creates or replaces a SQL Server Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_server_instance_name`: The name of SQL Server Instance"] + #[doc = "* `sql_server_instance`: The SQL Server Instance to be created or updated."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_server_instance_name: impl Into, + sql_server_instance: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_server_instance_name: sql_server_instance_name.into(), + sql_server_instance: sql_server_instance.into(), + } + } + #[doc = "Updates a SQL Server Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_server_instance_name`: Name of sqlServerInstance"] + #[doc = "* `parameters`: The SQL Server Instance."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_server_instance_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_server_instance_name: sql_server_instance_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a SQL Server Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `sql_server_instance_name`: The name of SQL Server Instance"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + sql_server_instance_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + sql_server_instance_name: sql_server_instance_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlServerInstanceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.AzureArcData/sqlServerInstances", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlServerInstanceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlServerInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_server_instance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_server_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlServerInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_server_instance_name: String, + pub(crate) sql_server_instance: models::SqlServerInstance, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_server_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.sql_server_instance)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SqlServerInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_server_instance_name: String, + pub(crate) parameters: models::SqlServerInstanceUpdate, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_server_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) sql_server_instance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.sql_server_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod postgres_instances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List postgres Instance resources in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List postgres Instance resources in the resource group"] + #[doc = "Get a postgres Instances list by Resource group name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves a postgres Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + postgres_instance_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + postgres_instance_name: postgres_instance_name.into(), + } + } + #[doc = "Creates or replaces a postgres Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `postgres_instance_name`: Name of PostgresInstance"] + #[doc = "* `resource`: The postgres instance"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + postgres_instance_name: impl Into, + resource: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + postgres_instance_name: postgres_instance_name.into(), + resource: resource.into(), + } + } + #[doc = "Updates a postgres Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] + #[doc = "* `parameters`: The Postgres Instance."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + postgres_instance_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + postgres_instance_name: postgres_instance_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a postgres Instance resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + postgres_instance_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + postgres_instance_name: postgres_instance_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PostgresInstanceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.AzureArcData/postgresInstances", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PostgresInstanceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PostgresInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) postgres_instance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.postgres_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PostgresInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) postgres_instance_name: String, + pub(crate) resource: models::PostgresInstance, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.postgres_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.resource)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PostgresInstance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) postgres_instance_name: String, + pub(crate) parameters: models::PostgresInstanceUpdate, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.postgres_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) postgres_instance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.postgres_instance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod data_controllers { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List dataController resources in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + pub fn list_in_subscription(&self, subscription_id: impl Into) -> list_in_subscription::RequestBuilder { + list_in_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List dataController resources in the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + pub fn list_in_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_in_group::RequestBuilder { + list_in_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves a dataController resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + pub fn get_data_controller( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + data_controller_name: impl Into, + ) -> get_data_controller::RequestBuilder { + get_data_controller::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + data_controller_name: data_controller_name.into(), + } + } + #[doc = "Creates or replaces a dataController resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `data_controller_resource`: desc"] + pub fn put_data_controller( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + data_controller_resource: impl Into, + data_controller_name: impl Into, + ) -> put_data_controller::RequestBuilder { + put_data_controller::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + data_controller_resource: data_controller_resource.into(), + data_controller_name: data_controller_name.into(), + } + } + #[doc = "Updates a dataController resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + #[doc = "* `data_controller_resource`: The update data controller resource"] + pub fn patch_data_controller( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + data_controller_name: impl Into, + data_controller_resource: impl Into, + ) -> patch_data_controller::RequestBuilder { + patch_data_controller::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + data_controller_name: data_controller_name.into(), + data_controller_resource: data_controller_resource.into(), + } + } + #[doc = "Deletes a dataController resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the Azure subscription"] + #[doc = "* `resource_group_name`: The name of the Azure resource group"] + pub fn delete_data_controller( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + data_controller_name: impl Into, + ) -> delete_data_controller::RequestBuilder { + delete_data_controller::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + data_controller_name: data_controller_name.into(), + } + } + } + pub mod list_in_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PageOfDataControllerResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.AzureArcData/dataControllers", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_in_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PageOfDataControllerResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_data_controller { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DataControllerResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) data_controller_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.data_controller_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod put_data_controller { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DataControllerResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) data_controller_resource: models::DataControllerResource, + pub(crate) data_controller_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.data_controller_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.data_controller_resource)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod patch_data_controller { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DataControllerResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) data_controller_name: String, + pub(crate) data_controller_resource: models::DataControllerUpdate, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.data_controller_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.data_controller_resource)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_data_controller { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) data_controller_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.data_controller_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} diff --git a/services/mgmt/arcdata/src/package_preview_2021_06_01/models.rs b/services/mgmt/arcdata/src/package_preview_2021_06_01/models.rs new file mode 100644 index 0000000000..bb318c89c5 --- /dev/null +++ b/services/mgmt/arcdata/src/package_preview_2021_06_01/models.rs @@ -0,0 +1,997 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Username and password for basic login authentication."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BasicLoginInformation { + #[doc = "Login username."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "Login password."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, +} +impl BasicLoginInformation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition representing SKU for ARM resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CommonSku { + #[doc = "The name of the SKU. It is typically a letter+number code"] + pub name: String, + #[doc = "Whether dev/test is enabled. When the dev field is set to true, the resource is used for dev/test purpose. "] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dev: Option, + #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. "] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option, + #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family: Option, + #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capacity: Option, +} +impl CommonSku { + pub fn new(name: String) -> Self { + Self { + name, + dev: None, + size: None, + family: None, + capacity: None, + } + } +} +#[doc = "The data controller properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DataControllerProperties { + #[doc = "Properties from the Kubernetes data controller"] + #[serde(rename = "onPremiseProperty", default, skip_serializing_if = "Option::is_none")] + pub on_premise_property: Option, + #[doc = "The raw kubernetes information"] + #[serde(rename = "k8sRaw", default, skip_serializing_if = "Option::is_none")] + pub k8s_raw: Option, + #[doc = "Properties on upload watermark. Mostly timestamp for each upload data type"] + #[serde(rename = "uploadWatermark", default, skip_serializing_if = "Option::is_none")] + pub upload_watermark: Option, + #[doc = "Last uploaded date from Kubernetes cluster. Defaults to current date time"] + #[serde(rename = "lastUploadedDate", default, with = "azure_core::date::rfc3339::option")] + pub last_uploaded_date: Option, + #[doc = "Username and password for basic login authentication."] + #[serde(rename = "basicLoginInformation", default, skip_serializing_if = "Option::is_none")] + pub basic_login_information: Option, + #[doc = "Log analytics workspace id and primary key"] + #[serde(rename = "logAnalyticsWorkspaceConfig", default, skip_serializing_if = "Option::is_none")] + pub log_analytics_workspace_config: Option, + #[doc = "Service principal for uploading billing, metrics and logs."] + #[serde(rename = "uploadServicePrincipal", default, skip_serializing_if = "Option::is_none")] + pub upload_service_principal: Option, + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl DataControllerProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Data controller resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataControllerResource { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "The complex type of the extended location."] + #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] + pub extended_location: Option, + #[doc = "The data controller properties."] + pub properties: DataControllerProperties, +} +impl DataControllerResource { + pub fn new(tracked_resource: TrackedResource, properties: DataControllerProperties) -> Self { + Self { + tracked_resource, + extended_location: None, + properties, + } + } +} +#[doc = "Used for updating a data controller resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DataControllerUpdate { + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl DataControllerUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An error response from the Azure Data on Azure Arc service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "An error response from the Batch service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An error response from the Batch service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponseBody { + #[doc = "An identifier for the error. Codes are invariant and are intended to be consumed programmatically."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "A message describing the error, intended to be suitable for display in a user interface."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The target of the particular error. For example, the name of the property in error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "A list of additional details about the error."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl ErrorResponseBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The complex type of the extended location."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtendedLocation { + #[doc = "The name of the extended location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of extendedLocation."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl ExtendedLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The type of extendedLocation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ExtendedLocationType")] +pub enum ExtendedLocationType { + CustomLocation, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ExtendedLocationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ExtendedLocationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ExtendedLocationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CustomLocation => serializer.serialize_unit_variant("ExtendedLocationType", 0u32, "CustomLocation"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Identity for the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Identity { + #[doc = "The principal ID of resource identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of resource."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The identity type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Identity { + pub fn new() -> Self { + Self::default() + } +} +pub mod identity { + use super::*; + #[doc = "The identity type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + SystemAssigned, + } +} +#[doc = "The type of identity that creates/modifies resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "IdentityType")] +pub enum IdentityType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for IdentityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for IdentityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for IdentityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("IdentityType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("IdentityType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("IdentityType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("IdentityType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Log analytics workspace id and primary key"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LogAnalyticsWorkspaceConfig { + #[doc = "Azure Log Analytics workspace ID"] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "Primary key of the workspace"] + #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] + pub primary_key: Option, +} +impl LogAnalyticsWorkspaceConfig { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about an error."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ODataError { + #[doc = "A language-independent error name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The target of the error (for example, the name of the property in error)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl ODataError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties from the Kubernetes data controller"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OnPremiseProperty { + #[doc = "A globally unique ID identifying the associated Kubernetes cluster"] + pub id: String, + #[doc = "Certificate that contains the Kubernetes cluster public key used to verify signing"] + #[serde(rename = "publicSigningKey")] + pub public_signing_key: String, + #[doc = "Unique thumbprint returned to customer to verify the certificate being uploaded"] + #[serde(rename = "signingCertificateThumbprint", default, skip_serializing_if = "Option::is_none")] + pub signing_certificate_thumbprint: Option, +} +impl OnPremiseProperty { + pub fn new(id: String, public_signing_key: String) -> Self { + Self { + id, + public_signing_key, + signing_certificate_thumbprint: None, + } + } +} +#[doc = "Azure Data Services on Azure Arc operation definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Operation { + #[doc = "The name of the operation being performed on this particular object."] + pub name: String, + #[doc = "Display metadata associated with the operation."] + pub display: OperationDisplay, + #[doc = "The intended executor of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Indicates whether the operation is a data action"] + #[serde(rename = "isDataAction")] + pub is_data_action: bool, + #[doc = "Additional descriptions for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Operation { + pub fn new(name: String, display: OperationDisplay, is_data_action: bool) -> Self { + Self { + name, + display, + origin: None, + is_data_action, + properties: None, + } + } +} +pub mod operation { + use super::*; + #[doc = "The intended executor of the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Display metadata associated with the operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationDisplay { + #[doc = "The localized friendly form of the resource provider name."] + pub provider: String, + #[doc = "The localized friendly form of the resource type related to this action/operation."] + pub resource: String, + #[doc = "The localized friendly name for the operation."] + pub operation: String, + #[doc = "The localized friendly description for the operation."] + pub description: String, +} +impl OperationDisplay { + pub fn new(provider: String, resource: String, operation: String, description: String) -> Self { + Self { + provider, + resource, + operation, + description, + } + } +} +#[doc = "Result of the request to list Azure Data Services on Azure Arc operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "Array of results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to retrieve next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PageOfDataControllerResource { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to retrieve next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PageOfDataControllerResource { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PageOfDataControllerResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Plan for the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Plan { + #[doc = "A user defined name of the 3rd Party Artifact that is being procured."] + pub name: String, + #[doc = "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic"] + pub publisher: String, + #[doc = "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. "] + pub product: String, + #[doc = "A publisher provided promotion code as provisioned in Data Market for the said product/artifact."] + #[serde(rename = "promotionCode", default, skip_serializing_if = "Option::is_none")] + pub promotion_code: Option, + #[doc = "The version of the desired product/artifact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl Plan { + pub fn new(name: String, publisher: String, product: String) -> Self { + Self { + name, + publisher, + product, + promotion_code: None, + version: None, + } + } +} +#[doc = "A Postgres Instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PostgresInstance { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "The complex type of the extended location."] + #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] + pub extended_location: Option, + #[doc = "Postgres Instance properties."] + pub properties: PostgresInstanceProperties, + #[doc = "The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl PostgresInstance { + pub fn new(tracked_resource: TrackedResource, properties: PostgresInstanceProperties) -> Self { + Self { + tracked_resource, + extended_location: None, + properties, + sku: None, + } + } +} +#[doc = "A list of PostgresInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PostgresInstanceListResult { + #[doc = "Array of results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to retrieve next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PostgresInstanceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PostgresInstanceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Postgres Instance properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PostgresInstanceProperties { + #[doc = "The data controller id"] + #[serde(rename = "dataControllerId", default, skip_serializing_if = "Option::is_none")] + pub data_controller_id: Option, + #[doc = "The instance admin"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub admin: Option, + #[doc = "Username and password for basic login authentication."] + #[serde(rename = "basicLoginInformation", default, skip_serializing_if = "Option::is_none")] + pub basic_login_information: Option, + #[doc = "The raw kubernetes information"] + #[serde(rename = "k8sRaw", default, skip_serializing_if = "Option::is_none")] + pub k8s_raw: Option, + #[doc = "Last uploaded date from Kubernetes cluster. Defaults to current date time"] + #[serde(rename = "lastUploadedDate", default, with = "azure_core::date::rfc3339::option")] + pub last_uploaded_date: Option, + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PostgresInstanceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PostgresInstanceSku { + #[serde(flatten)] + pub common_sku: CommonSku, + #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl PostgresInstanceSku { + pub fn new(common_sku: CommonSku) -> Self { + Self { common_sku, tier: None } + } +} +pub mod postgres_instance_sku { + use super::*; + #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Tier { + Hyperscale, + } + impl Default for Tier { + fn default() -> Self { + Self::Hyperscale + } + } +} +#[doc = "An update to a Postgres Instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PostgresInstanceUpdate { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Postgres Instance properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PostgresInstanceUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceSku { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capacity: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl ResourceSku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A SqlManagedInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlManagedInstance { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of sqlManagedInstance."] + pub properties: SqlManagedInstanceProperties, + #[doc = "The complex type of the extended location."] + #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] + pub extended_location: Option, + #[doc = "The resource model definition representing SKU for Azure Managed Instance - Azure Arc"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl SqlManagedInstance { + pub fn new(tracked_resource: TrackedResource, properties: SqlManagedInstanceProperties) -> Self { + Self { + tracked_resource, + properties, + extended_location: None, + sku: None, + } + } +} +#[doc = "A list of SqlManagedInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SqlManagedInstanceListResult { + #[doc = "Array of results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to retrieve next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SqlManagedInstanceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SqlManagedInstanceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of sqlManagedInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SqlManagedInstanceProperties { + #[doc = "null"] + #[serde(rename = "dataControllerId", default, skip_serializing_if = "Option::is_none")] + pub data_controller_id: Option, + #[doc = "The instance admin user"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub admin: Option, + #[doc = "The instance start time"] + #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The instance end time"] + #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The raw kubernetes information"] + #[serde(rename = "k8sRaw", default, skip_serializing_if = "Option::is_none")] + pub k8s_raw: Option, + #[doc = "Username and password for basic login authentication."] + #[serde(rename = "basicLoginInformation", default, skip_serializing_if = "Option::is_none")] + pub basic_login_information: Option, + #[doc = "Last uploaded date from Kubernetes cluster. Defaults to current date time"] + #[serde(rename = "lastUploadedDate", default, with = "azure_core::date::rfc3339::option")] + pub last_uploaded_date: Option, + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl SqlManagedInstanceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition representing SKU for Azure Managed Instance - Azure Arc"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlManagedInstanceSku { + #[serde(flatten)] + pub common_sku: CommonSku, + #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl SqlManagedInstanceSku { + pub fn new(common_sku: CommonSku) -> Self { + Self { common_sku, tier: None } + } +} +pub mod sql_managed_instance_sku { + use super::*; + #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Tier { + GeneralPurpose, + BusinessCritical, + } + impl Default for Tier { + fn default() -> Self { + Self::GeneralPurpose + } + } +} +#[doc = "An update to a SQL Managed Instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SqlManagedInstanceUpdate { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl SqlManagedInstanceUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A SqlServerInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlServerInstance { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of SqlServerInstance."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SqlServerInstance { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + } + } +} +#[doc = "A list of SqlServerInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SqlServerInstanceListResult { + #[doc = "Array of results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to retrieve next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SqlServerInstanceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SqlServerInstanceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of SqlServerInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlServerInstanceProperties { + #[doc = "SQL Server version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "SQL Server edition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub edition: Option, + #[doc = "ARM Resource id of the container resource (Azure Arc for Servers)."] + #[serde(rename = "containerResourceId")] + pub container_resource_id: String, + #[doc = "The time when the resource was created."] + #[serde(rename = "createTime", default, skip_serializing_if = "Option::is_none")] + pub create_time: Option, + #[doc = "The number of logical processors used by the SQL Server instance."] + #[serde(rename = "vCore", default, skip_serializing_if = "Option::is_none")] + pub v_core: Option, + #[doc = "The cloud connectivity status."] + pub status: String, + #[doc = "SQL Server update level."] + #[serde(rename = "patchLevel", default, skip_serializing_if = "Option::is_none")] + pub patch_level: Option, + #[doc = "SQL Server collation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collation: Option, + #[doc = "SQL Server current version."] + #[serde(rename = "currentVersion", default, skip_serializing_if = "Option::is_none")] + pub current_version: Option, + #[doc = "SQL Server instance name."] + #[serde(rename = "instanceName", default, skip_serializing_if = "Option::is_none")] + pub instance_name: Option, + #[doc = "Dynamic TCP ports used by SQL Server."] + #[serde(rename = "tcpDynamicPorts", default, skip_serializing_if = "Option::is_none")] + pub tcp_dynamic_ports: Option, + #[doc = "Static TCP ports used by SQL Server."] + #[serde(rename = "tcpStaticPorts", default, skip_serializing_if = "Option::is_none")] + pub tcp_static_ports: Option, + #[doc = "SQL Server product ID."] + #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")] + pub product_id: Option, + #[doc = "SQL Server license type."] + #[serde(rename = "licenseType", default, skip_serializing_if = "Option::is_none")] + pub license_type: Option, + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl SqlServerInstanceProperties { + pub fn new(container_resource_id: String, status: String) -> Self { + Self { + version: None, + edition: None, + container_resource_id, + create_time: None, + v_core: None, + status, + patch_level: None, + collation: None, + current_version: None, + instance_name: None, + tcp_dynamic_ports: None, + tcp_static_ports: None, + product_id: None, + license_type: None, + provisioning_state: None, + } + } +} +#[doc = "An update to a SQL Server Instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SqlServerInstanceUpdate { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl SqlServerInstanceUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Read only system data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "An identifier for the identity that created the resource"] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that creates/modifies resources"] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)"] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "An identifier for the identity that last modified the resource"] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that creates/modifies resources"] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for a ARM tracked top level resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, + #[doc = "Read only system data"] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + system_data: None, + } + } +} +#[doc = "Service principal for uploading billing, metrics and logs."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UploadServicePrincipal { + #[doc = "Client ID of the service principal for uploading data."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[doc = "Tenant ID of the service principal."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Authority for the service principal. Example: https://login.microsoftonline.com/"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authority: Option, + #[doc = "Secret of the service principal"] + #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] + pub client_secret: Option, +} +impl UploadServicePrincipal { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties on upload watermark. Mostly timestamp for each upload data type"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UploadWatermark { + #[doc = "Last uploaded date for metrics from kubernetes cluster. Defaults to current date time"] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub metrics: Option, + #[doc = "Last uploaded date for logs from kubernetes cluster. Defaults to current date time"] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub logs: Option, + #[doc = "Last uploaded date for usages from kubernetes cluster. Defaults to current date time"] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub usages: Option, +} +impl UploadWatermark { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/arcdata/src/package_preview_2023_03/models.rs b/services/mgmt/arcdata/src/package_preview_2023_03/models.rs deleted file mode 100644 index 8631ddd228..0000000000 --- a/services/mgmt/arcdata/src/package_preview_2023_03/models.rs +++ /dev/null @@ -1,2658 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "DNS server details"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActiveDirectoryConnectorDnsDetails { - #[doc = "DNS domain name for which DNS lookups should be forwarded to the Active Directory DNS servers."] - #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] - pub domain_name: Option, - #[doc = "List of Active Directory DNS server IP addresses."] - #[serde(rename = "nameserverIPAddresses")] - pub nameserver_ip_addresses: Vec, - #[doc = "Replica count for DNS proxy service. Default value is 1."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub replicas: Option, - #[doc = "Flag indicating whether to prefer Kubernetes DNS server response over AD DNS server response for IP address lookups."] - #[serde(rename = "preferK8sDnsForPtrLookups", default, skip_serializing_if = "Option::is_none")] - pub prefer_k8s_dns_for_ptr_lookups: Option, -} -impl ActiveDirectoryConnectorDnsDetails { - pub fn new(nameserver_ip_addresses: Vec) -> Self { - Self { - domain_name: None, - nameserver_ip_addresses, - replicas: None, - prefer_k8s_dns_for_ptr_lookups: None, - } - } -} -#[doc = "Active Directory domain details"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActiveDirectoryConnectorDomainDetails { - #[doc = "Name (uppercase) of the Active Directory domain that this AD connector will be associated with."] - pub realm: String, - #[doc = "NETBIOS name of the Active Directory domain."] - #[serde(rename = "netbiosDomainName", default, skip_serializing_if = "Option::is_none")] - pub netbios_domain_name: Option, - #[doc = "The service account provisioning mode for this Active Directory connector."] - #[serde(rename = "serviceAccountProvisioning", default, skip_serializing_if = "Option::is_none")] - pub service_account_provisioning: Option, - #[doc = "The distinguished name of the Active Directory Organizational Unit."] - #[serde(rename = "ouDistinguishedName", default, skip_serializing_if = "Option::is_none")] - pub ou_distinguished_name: Option, - #[doc = "Details about the Active Directory domain controllers associated with this AD connector instance"] - #[serde(rename = "domainControllers", default, skip_serializing_if = "Option::is_none")] - pub domain_controllers: Option, -} -impl ActiveDirectoryConnectorDomainDetails { - pub fn new(realm: String) -> Self { - Self { - realm, - netbios_domain_name: None, - service_account_provisioning: None, - ou_distinguished_name: None, - domain_controllers: None, - } - } -} -pub mod active_directory_connector_domain_details { - use super::*; - #[doc = "The service account provisioning mode for this Active Directory connector."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ServiceAccountProvisioning")] - pub enum ServiceAccountProvisioning { - #[serde(rename = "automatic")] - Automatic, - #[serde(rename = "manual")] - Manual, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ServiceAccountProvisioning { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ServiceAccountProvisioning { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ServiceAccountProvisioning { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Automatic => serializer.serialize_unit_variant("ServiceAccountProvisioning", 0u32, "automatic"), - Self::Manual => serializer.serialize_unit_variant("ServiceAccountProvisioning", 1u32, "manual"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for ServiceAccountProvisioning { - fn default() -> Self { - Self::Manual - } - } -} -#[doc = "A list of active directory connectors"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ActiveDirectoryConnectorListResult { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ActiveDirectoryConnectorListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ActiveDirectoryConnectorListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of an Active Directory connector resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActiveDirectoryConnectorProperties { - #[doc = "Username and password for basic login authentication."] - #[serde(rename = "domainServiceAccountLoginInformation", default, skip_serializing_if = "Option::is_none")] - pub domain_service_account_login_information: Option, - #[doc = "The provisioning state of the Active Directory connector resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "The specifications of the AD Kubernetes resource."] - pub spec: ActiveDirectoryConnectorSpec, - #[doc = "The status of the Kubernetes custom resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ActiveDirectoryConnectorProperties { - pub fn new(spec: ActiveDirectoryConnectorSpec) -> Self { - Self { - domain_service_account_login_information: None, - provisioning_state: None, - spec, - status: None, - } - } -} -#[doc = "Active directory connector resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActiveDirectoryConnectorResource { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of an Active Directory connector resource"] - pub properties: ActiveDirectoryConnectorProperties, -} -impl ActiveDirectoryConnectorResource { - pub fn new(properties: ActiveDirectoryConnectorProperties) -> Self { - Self { - proxy_resource: ProxyResource::default(), - properties, - } - } -} -#[doc = "The specifications of the AD Kubernetes resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActiveDirectoryConnectorSpec { - #[doc = "Active Directory domain details"] - #[serde(rename = "activeDirectory")] - pub active_directory: ActiveDirectoryConnectorDomainDetails, - #[doc = "DNS server details"] - pub dns: ActiveDirectoryConnectorDnsDetails, -} -impl ActiveDirectoryConnectorSpec { - pub fn new(active_directory: ActiveDirectoryConnectorDomainDetails, dns: ActiveDirectoryConnectorDnsDetails) -> Self { - Self { active_directory, dns } - } -} -#[doc = "The status of the Kubernetes custom resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ActiveDirectoryConnectorStatus { - #[doc = "The time that the custom resource was last updated."] - #[serde(rename = "lastUpdateTime", default, skip_serializing_if = "Option::is_none")] - pub last_update_time: Option, - #[doc = "The version of the replicaSet associated with the AD connector custom resource."] - #[serde(rename = "observedGeneration", default, skip_serializing_if = "Option::is_none")] - pub observed_generation: Option, - #[doc = "The state of the AD connector custom resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, -} -impl ActiveDirectoryConnectorStatus { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Information about a domain controller in the AD domain."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActiveDirectoryDomainController { - #[doc = "Fully-qualified domain name of a domain controller in the AD domain."] - pub hostname: String, -} -impl ActiveDirectoryDomainController { - pub fn new(hostname: String) -> Self { - Self { hostname } - } -} -#[doc = "Details about the Active Directory domain controllers associated with this AD connector instance"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ActiveDirectoryDomainControllers { - #[doc = "Information about a domain controller in the AD domain."] - #[serde(rename = "primaryDomainController", default, skip_serializing_if = "Option::is_none")] - pub primary_domain_controller: Option, - #[doc = "Information about the secondary domain controllers in the AD domain."] - #[serde(rename = "secondaryDomainControllers", default, skip_serializing_if = "Option::is_none")] - pub secondary_domain_controllers: Option, -} -impl ActiveDirectoryDomainControllers { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Active Directory information that related to the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ActiveDirectoryInformation { - #[doc = "Keytab used for authenticate with Active Directory."] - #[serde(rename = "keytabInformation", default, skip_serializing_if = "Option::is_none")] - pub keytab_information: Option, -} -impl ActiveDirectoryInformation { - pub fn new() -> Self { - Self::default() - } -} -pub type ActiveDirectorySecondaryDomainControllers = Vec; -#[doc = "A list of Arc Sql Availability Group Databases."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArcSqlAvailabilityGroupDatabasesListResult { - #[doc = "Array of Arc Sql Availability Group Database."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ArcSqlAvailabilityGroupDatabasesListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ArcSqlAvailabilityGroupDatabasesListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of Arc Sql Availability Group Replica."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArcSqlAvailabilityGroupReplicaListResult { - #[doc = "Array of Arc Sql Availability Group Replica."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ArcSqlAvailabilityGroupReplicaListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ArcSqlAvailabilityGroupReplicaListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of Arc Sql Server Availability Group."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArcSqlServerAvailabilityGroupListResult { - #[doc = "Array of Arc Sql Server Availability Group."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ArcSqlServerAvailabilityGroupListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ArcSqlServerAvailabilityGroupListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of Arc Sql Server database."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ArcSqlServerDatabaseListResult { - #[doc = "Array of Arc Sql Server database."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ArcSqlServerDatabaseListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ArcSqlServerDatabaseListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The specifications of the availability group replica configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AvailabilityGroupConfigure { - #[doc = "Mirroring endpoint URL of availability group replica"] - #[serde(rename = "endpointUrl", default, skip_serializing_if = "Option::is_none")] - pub endpoint_url: Option, - #[doc = "Availability Synchronization mode description of availability group replica."] - #[serde(rename = "availabilityModeDesc", default, skip_serializing_if = "Option::is_none")] - pub availability_mode_desc: Option, - #[doc = "failover mode description of the availability group replica."] - #[serde(rename = "failoverModeDesc", default, skip_serializing_if = "Option::is_none")] - pub failover_mode_desc: Option, - #[doc = "The time-out period of availability group session replica, in seconds."] - #[serde(rename = "sessionTimeout", default, skip_serializing_if = "Option::is_none")] - pub session_timeout: Option, - #[doc = "Allowed the connections for primary role of the availability group replica."] - #[serde(rename = "primaryRoleAllowConnectionsDesc", default, skip_serializing_if = "Option::is_none")] - pub primary_role_allow_connections_desc: Option, - #[doc = "Allowed the connections for secondary role of availability group replica."] - #[serde(rename = "secondaryRoleAllowConnectionsDesc", default, skip_serializing_if = "Option::is_none")] - pub secondary_role_allow_connections_desc: Option, - #[doc = "Date that the replica was created."] - #[serde(rename = "createDate", default, with = "azure_core::date::rfc3339::option")] - pub create_date: Option, - #[doc = "Date that the replica was modified."] - #[serde(rename = "modifyDate", default, with = "azure_core::date::rfc3339::option")] - pub modify_date: Option, - #[doc = "Represents the user-specified priority for performing backups on this replica relative to the other replicas in the same availability group."] - #[serde(rename = "backupPriority", default, skip_serializing_if = "Option::is_none")] - pub backup_priority: Option, - #[doc = "Connectivity endpoint (URL) of the read only availability replica."] - #[serde(rename = "readOnlyRoutingUrl", default, skip_serializing_if = "Option::is_none")] - pub read_only_routing_url: Option, - #[doc = "Connectivity endpoint (URL) of the read write availability replica."] - #[serde(rename = "readWriteRoutingUrl", default, skip_serializing_if = "Option::is_none")] - pub read_write_routing_url: Option, - #[doc = "Describes seeding mode."] - #[serde(rename = "seedingModeDesc", default, skip_serializing_if = "Option::is_none")] - pub seeding_mode_desc: Option, -} -impl AvailabilityGroupConfigure { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The specifications of the availability group state"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AvailabilityGroupState { - #[doc = "Role description of the availability group replica."] - #[serde(rename = "availabilityGroupReplicaRole", default, skip_serializing_if = "Option::is_none")] - pub availability_group_replica_role: Option, - #[doc = "Operation state description of the availability group replica"] - #[serde(rename = "operationalStateDesc", default, skip_serializing_if = "Option::is_none")] - pub operational_state_desc: Option, - #[doc = "Recovery health description of the availability group replica."] - #[serde(rename = "recoveryHealthDesc", default, skip_serializing_if = "Option::is_none")] - pub recovery_health_desc: Option, - #[doc = "Synchronization health description of the availability group replica."] - #[serde(rename = "synchronizationHealthDesc", default, skip_serializing_if = "Option::is_none")] - pub synchronization_health_desc: Option, - #[doc = "Connected state description of the availability group replica."] - #[serde(rename = "connectedStateDesc", default, skip_serializing_if = "Option::is_none")] - pub connected_state_desc: Option, - #[doc = "Last connect error description of the availability group replica."] - #[serde(rename = "lastConnectErrorDescription", default, skip_serializing_if = "Option::is_none")] - pub last_connect_error_description: Option, - #[doc = "Last connect error time stamp of the availability group replica."] - #[serde(rename = "lastConnectErrorTimestamp", default, with = "azure_core::date::rfc3339::option")] - pub last_connect_error_timestamp: Option, -} -impl AvailabilityGroupState { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Username and password for basic login authentication."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BasicLoginInformation { - #[doc = "Login username."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[doc = "Login password."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub password: Option, -} -impl BasicLoginInformation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource model definition representing SKU for ARM resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommonSku { - #[doc = "The name of the SKU. It is typically a letter+number code"] - pub name: String, - #[doc = "Whether dev/test is enabled. When the dev field is set to true, the resource is used for dev/test purpose. "] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dev: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. "] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "If the service has different generations of hardware, for the same SKU, then that can be captured here."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, -} -impl CommonSku { - pub fn new(name: String) -> Self { - Self { - name, - dev: None, - size: None, - family: None, - capacity: None, - } - } -} -#[doc = "The data controller properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataControllerProperties { - #[doc = "The infrastructure the data controller is running on."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub infrastructure: Option, - #[doc = "Properties from the Kubernetes data controller"] - #[serde(rename = "onPremiseProperty", default, skip_serializing_if = "Option::is_none")] - pub on_premise_property: Option, - #[doc = "The raw kubernetes information"] - #[serde(rename = "k8sRaw", default, skip_serializing_if = "Option::is_none")] - pub k8s_raw: Option, - #[doc = "Properties on upload watermark. Mostly timestamp for each upload data type"] - #[serde(rename = "uploadWatermark", default, skip_serializing_if = "Option::is_none")] - pub upload_watermark: Option, - #[doc = "Last uploaded date from Kubernetes cluster. Defaults to current date time"] - #[serde(rename = "lastUploadedDate", default, with = "azure_core::date::rfc3339::option")] - pub last_uploaded_date: Option, - #[doc = "Username and password for basic login authentication."] - #[serde(rename = "basicLoginInformation", default, skip_serializing_if = "Option::is_none")] - pub basic_login_information: Option, - #[doc = "Username and password for basic login authentication."] - #[serde(rename = "metricsDashboardCredential", default, skip_serializing_if = "Option::is_none")] - pub metrics_dashboard_credential: Option, - #[doc = "Username and password for basic login authentication."] - #[serde(rename = "logsDashboardCredential", default, skip_serializing_if = "Option::is_none")] - pub logs_dashboard_credential: Option, - #[doc = "Log analytics workspace id and primary key"] - #[serde(rename = "logAnalyticsWorkspaceConfig", default, skip_serializing_if = "Option::is_none")] - pub log_analytics_workspace_config: Option, - #[doc = "Service principal for uploading billing, metrics and logs."] - #[serde(rename = "uploadServicePrincipal", default, skip_serializing_if = "Option::is_none")] - pub upload_service_principal: Option, - #[doc = "The provisioning state of the Arc Data Controller resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs to."] - #[serde(rename = "clusterId", default, skip_serializing_if = "Option::is_none")] - pub cluster_id: Option, - #[doc = "If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to."] - #[serde(rename = "extensionId", default, skip_serializing_if = "Option::is_none")] - pub extension_id: Option, -} -impl DataControllerProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod data_controller_properties { - use super::*; - #[doc = "The infrastructure the data controller is running on."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Infrastructure { - #[serde(rename = "azure")] - Azure, - #[serde(rename = "gcp")] - Gcp, - #[serde(rename = "aws")] - Aws, - #[serde(rename = "alibaba")] - Alibaba, - #[serde(rename = "onpremises")] - Onpremises, - #[serde(rename = "other")] - Other, - } - impl Default for Infrastructure { - fn default() -> Self { - Self::Other - } - } -} -#[doc = "Data controller resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataControllerResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The complex type of the extended location."] - #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] - pub extended_location: Option, - #[doc = "The data controller properties."] - pub properties: DataControllerProperties, -} -impl DataControllerResource { - pub fn new(tracked_resource: TrackedResource, properties: DataControllerProperties) -> Self { - Self { - tracked_resource, - extended_location: None, - properties, - } - } -} -#[doc = "Used for updating a data controller resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DataControllerUpdate { - #[doc = "Resource tags"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The data controller properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DataControllerUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An error response from the Azure Data on Azure Arc service."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "An error response from the Batch service."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An error response from the Batch service."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponseBody { - #[doc = "An identifier for the error. Codes are invariant and are intended to be consumed programmatically."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "A message describing the error, intended to be suitable for display in a user interface."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The target of the particular error. For example, the name of the property in error."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "A list of additional details about the error."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, -} -impl ErrorResponseBody { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The complex type of the extended location."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExtendedLocation { - #[doc = "The name of the extended location."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of extendedLocation."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl ExtendedLocation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The type of extendedLocation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ExtendedLocationType")] -pub enum ExtendedLocationType { - CustomLocation, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ExtendedLocationType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ExtendedLocationType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ExtendedLocationType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CustomLocation => serializer.serialize_unit_variant("ExtendedLocationType", 0u32, "CustomLocation"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A list of failover groups."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FailoverGroupListResult { - #[doc = "Array of failover group results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for FailoverGroupListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl FailoverGroupListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a failover group resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FailoverGroupProperties { - #[doc = "The provisioning state of the failover group resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "The resource ID of the partner SQL managed instance."] - #[serde(rename = "partnerManagedInstanceId")] - pub partner_managed_instance_id: String, - #[doc = "The specifications of the failover group resource."] - pub spec: FailoverGroupSpec, - #[doc = "The status of the failover group custom resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl FailoverGroupProperties { - pub fn new(partner_managed_instance_id: String, spec: FailoverGroupSpec) -> Self { - Self { - provisioning_state: None, - partner_managed_instance_id, - spec, - status: None, - } - } -} -pub mod failover_group_properties { - use super::*; - #[doc = "The provisioning state of the failover group resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningState")] - pub enum ProvisioningState { - Succeeded, - Failed, - Canceled, - Accepted, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Canceled"), - Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Accepted"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "A failover group resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FailoverGroupResource { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a failover group resource."] - pub properties: FailoverGroupProperties, -} -impl FailoverGroupResource { - pub fn new(properties: FailoverGroupProperties) -> Self { - Self { - proxy_resource: ProxyResource::default(), - properties, - } - } -} -#[doc = "The specifications of the failover group resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FailoverGroupSpec { - #[doc = "The shared name of the failover group for this SQL managed instance. Both SQL managed instance and its partner have to use the same shared name."] - #[serde(rename = "sharedName", default, skip_serializing_if = "Option::is_none")] - pub shared_name: Option, - #[doc = "The name of the SQL managed instance with this failover group role."] - #[serde(rename = "sourceMI", default, skip_serializing_if = "Option::is_none")] - pub source_mi: Option, - #[doc = "The name of the partner SQL managed instance."] - #[serde(rename = "partnerMI", default, skip_serializing_if = "Option::is_none")] - pub partner_mi: Option, - #[doc = "The mirroring endpoint URL of the partner SQL managed instance."] - #[serde(rename = "partnerMirroringURL", default, skip_serializing_if = "Option::is_none")] - pub partner_mirroring_url: Option, - #[doc = "The mirroring endpoint public certificate for the partner SQL managed instance. Only PEM format is supported."] - #[serde(rename = "partnerMirroringCert", default, skip_serializing_if = "Option::is_none")] - pub partner_mirroring_cert: Option, - #[doc = "The partner sync mode of the SQL managed instance."] - #[serde(rename = "partnerSyncMode", default, skip_serializing_if = "Option::is_none")] - pub partner_sync_mode: Option, - #[doc = "The role of the SQL managed instance in this failover group."] - pub role: failover_group_spec::Role, -} -impl FailoverGroupSpec { - pub fn new(role: failover_group_spec::Role) -> Self { - Self { - shared_name: None, - source_mi: None, - partner_mi: None, - partner_mirroring_url: None, - partner_mirroring_cert: None, - partner_sync_mode: None, - role, - } - } -} -pub mod failover_group_spec { - use super::*; - #[doc = "The partner sync mode of the SQL managed instance."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "PartnerSyncMode")] - pub enum PartnerSyncMode { - #[serde(rename = "async")] - Async, - #[serde(rename = "sync")] - Sync, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for PartnerSyncMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for PartnerSyncMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for PartnerSyncMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Async => serializer.serialize_unit_variant("PartnerSyncMode", 0u32, "async"), - Self::Sync => serializer.serialize_unit_variant("PartnerSyncMode", 1u32, "sync"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for PartnerSyncMode { - fn default() -> Self { - Self::Async - } - } - #[doc = "The role of the SQL managed instance in this failover group."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Role")] - pub enum Role { - #[serde(rename = "primary")] - Primary, - #[serde(rename = "secondary")] - Secondary, - #[serde(rename = "force-primary-allow-data-loss")] - ForcePrimaryAllowDataLoss, - #[serde(rename = "force-secondary")] - ForceSecondary, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Role { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Role { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Role { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Primary => serializer.serialize_unit_variant("Role", 0u32, "primary"), - Self::Secondary => serializer.serialize_unit_variant("Role", 1u32, "secondary"), - Self::ForcePrimaryAllowDataLoss => serializer.serialize_unit_variant("Role", 2u32, "force-primary-allow-data-loss"), - Self::ForceSecondary => serializer.serialize_unit_variant("Role", 3u32, "force-secondary"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Role { - fn default() -> Self { - Self::Primary - } - } -} -#[doc = "The kubernetes resource limits and requests used to restrict or reserve resource usage."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct K8sResourceRequirements { - #[doc = "Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requests: Option, - #[doc = "Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub limits: Option, -} -impl K8sResourceRequirements { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The kubernetes scheduling information."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct K8sScheduling { - #[doc = "The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub default: Option, -} -impl K8sScheduling { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct K8sSchedulingOptions { - #[doc = "The kubernetes resource limits and requests used to restrict or reserve resource usage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resources: Option, -} -impl K8sSchedulingOptions { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Keytab used for authenticate with Active Directory."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KeytabInformation { - #[doc = "A base64-encoded keytab."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub keytab: Option, -} -impl KeytabInformation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Log analytics workspace id and primary key"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct LogAnalyticsWorkspaceConfig { - #[doc = "Azure Log Analytics workspace ID"] - #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] - pub workspace_id: Option, - #[doc = "Primary key of the workspace"] - #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] - pub primary_key: Option, -} -impl LogAnalyticsWorkspaceConfig { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties from the Kubernetes data controller"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OnPremiseProperty { - #[doc = "A globally unique ID identifying the associated Kubernetes cluster"] - pub id: String, - #[doc = "Certificate that contains the Kubernetes cluster public key used to verify signing"] - #[serde(rename = "publicSigningKey")] - pub public_signing_key: String, - #[doc = "Unique thumbprint returned to customer to verify the certificate being uploaded"] - #[serde(rename = "signingCertificateThumbprint", default, skip_serializing_if = "Option::is_none")] - pub signing_certificate_thumbprint: Option, -} -impl OnPremiseProperty { - pub fn new(id: String, public_signing_key: String) -> Self { - Self { - id, - public_signing_key, - signing_certificate_thumbprint: None, - } - } -} -#[doc = "Azure Data Services on Azure Arc operation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Operation { - #[doc = "The name of the operation being performed on this particular object."] - pub name: String, - #[doc = "Display metadata associated with the operation."] - pub display: OperationDisplay, - #[doc = "The intended executor of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option, - #[doc = "Indicates whether the operation is a data action"] - #[serde(rename = "isDataAction")] - pub is_data_action: bool, - #[doc = "Additional descriptions for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Operation { - pub fn new(name: String, display: OperationDisplay, is_data_action: bool) -> Self { - Self { - name, - display, - origin: None, - is_data_action, - properties: None, - } - } -} -pub mod operation { - use super::*; - #[doc = "The intended executor of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Origin")] - pub enum Origin { - #[serde(rename = "user")] - User, - #[serde(rename = "system")] - System, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Origin { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Origin { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Origin { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), - Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Display metadata associated with the operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OperationDisplay { - #[doc = "The localized friendly form of the resource provider name."] - pub provider: String, - #[doc = "The localized friendly form of the resource type related to this action/operation."] - pub resource: String, - #[doc = "The localized friendly name for the operation."] - pub operation: String, - #[doc = "The localized friendly description for the operation."] - pub description: String, -} -impl OperationDisplay { - pub fn new(provider: String, resource: String, operation: String, description: String) -> Self { - Self { - provider, - resource, - operation, - description, - } - } -} -#[doc = "Result of the request to list Azure Data Services on Azure Arc operations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OperationListResult { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for OperationListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl OperationListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of data controllers."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PageOfDataControllerResource { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for PageOfDataControllerResource { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl PageOfDataControllerResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A Postgres Instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PostgresInstance { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The complex type of the extended location."] - #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] - pub extended_location: Option, - #[doc = "Postgres Instance properties."] - pub properties: PostgresInstanceProperties, - #[doc = "The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl PostgresInstance { - pub fn new(tracked_resource: TrackedResource, properties: PostgresInstanceProperties) -> Self { - Self { - tracked_resource, - extended_location: None, - properties, - sku: None, - } - } -} -#[doc = "A list of PostgresInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PostgresInstanceListResult { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for PostgresInstanceListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl PostgresInstanceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Postgres Instance properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PostgresInstanceProperties { - #[doc = "The data controller id"] - #[serde(rename = "dataControllerId", default, skip_serializing_if = "Option::is_none")] - pub data_controller_id: Option, - #[doc = "The instance admin"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub admin: Option, - #[doc = "Username and password for basic login authentication."] - #[serde(rename = "basicLoginInformation", default, skip_serializing_if = "Option::is_none")] - pub basic_login_information: Option, - #[doc = "The raw kubernetes information"] - #[serde(rename = "k8sRaw", default, skip_serializing_if = "Option::is_none")] - pub k8s_raw: Option, - #[doc = "Last uploaded date from Kubernetes cluster. Defaults to current date time"] - #[serde(rename = "lastUploadedDate", default, with = "azure_core::date::rfc3339::option")] - pub last_uploaded_date: Option, - #[doc = "The provisioning state of the Azure Arc-enabled PostgreSQL instance."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl PostgresInstanceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct PostgresInstanceSku { - #[serde(flatten)] - pub common_sku: CommonSku, - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, -} -impl PostgresInstanceSku { - pub fn new(common_sku: CommonSku) -> Self { - Self { common_sku, tier: None } - } -} -pub mod postgres_instance_sku { - use super::*; - #[doc = "This field is required to be implemented by the Resource Provider if the service has more than one tier."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Tier { - Hyperscale, - } - impl Default for Tier { - fn default() -> Self { - Self::Hyperscale - } - } -} -#[doc = "An update to a Postgres Instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PostgresInstanceUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "Postgres Instance properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl PostgresInstanceUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProxyResource { - #[serde(flatten)] - pub resource: Resource, -} -impl ProxyResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A SqlAvailabilityGroup."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlAvailabilityGroup { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Properties of SqlAvailabilityGroup."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SqlAvailabilityGroup { - pub fn new(tracked_resource: TrackedResource) -> Self { - Self { - tracked_resource, - properties: None, - } - } -} -#[doc = "The properties of Arc Sql availability group database replica resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupDatabaseReplicaResourceProperties { - #[doc = "the database replica name."] - #[serde(rename = "replicaName", default, skip_serializing_if = "Option::is_none")] - pub replica_name: Option, - #[doc = "Whether the availability database is local."] - #[serde(rename = "isLocal", default, skip_serializing_if = "Option::is_none")] - pub is_local: Option, - #[doc = "Returns 1 if the replica is primary, or 0 if it is a secondary replica."] - #[serde(rename = "isPrimaryReplica", default, skip_serializing_if = "Option::is_none")] - pub is_primary_replica: Option, - #[doc = "Description of the data-movement state."] - #[serde(rename = "synchronizationStateDesc", default, skip_serializing_if = "Option::is_none")] - pub synchronization_state_desc: Option, - #[doc = "Whether this replica is transaction committer."] - #[serde(rename = "isCommitParticipant", default, skip_serializing_if = "Option::is_none")] - pub is_commit_participant: Option, - #[doc = "Description of the health of database."] - #[serde(rename = "synchronizationHealthDesc", default, skip_serializing_if = "Option::is_none")] - pub synchronization_health_desc: Option, - #[doc = "Description of the database state of the availability replica."] - #[serde(rename = "databaseStateDesc", default, skip_serializing_if = "Option::is_none")] - pub database_state_desc: Option, - #[doc = "Whether this data movement is suspended."] - #[serde(rename = "isSuspended", default, skip_serializing_if = "Option::is_none")] - pub is_suspended: Option, - #[doc = "Description of the database suspended state reason."] - #[serde(rename = "suspendReasonDesc", default, skip_serializing_if = "Option::is_none")] - pub suspend_reason_desc: Option, - #[doc = "The provisioning state of the Arc-enabled SQL Server availability group resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl SqlAvailabilityGroupDatabaseReplicaResourceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Arc Sql Server Availability Group Database"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlAvailabilityGroupDatabaseResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The properties of Arc Sql availability group multiple database replica resource"] - pub properties: SqlAvailabilityGroupMultiDatabaseReplicaResourceProperties, -} -impl SqlAvailabilityGroupDatabaseResource { - pub fn new(tracked_resource: TrackedResource, properties: SqlAvailabilityGroupMultiDatabaseReplicaResourceProperties) -> Self { - Self { - tracked_resource, - properties, - } - } -} -#[doc = "An update to Availability Group Database Replica resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupDatabaseUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The properties of Arc Sql availability group multiple database replica resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SqlAvailabilityGroupDatabaseUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of SqlAvailabilityGroup."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupListResult { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for SqlAvailabilityGroupListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl SqlAvailabilityGroupListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of Arc Sql availability group multiple database replica resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupMultiDatabaseReplicaResourceProperties { - #[doc = "ID GUID of the database for availability group."] - #[serde(rename = "groupDatabaseId", default, skip_serializing_if = "Option::is_none")] - pub group_database_id: Option, - #[doc = "Array of Arc Sql Availability Group Database Replicas."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The provisioning state of the Arc-enabled SQL Server availability group resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl SqlAvailabilityGroupMultiDatabaseReplicaResourceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of SqlAvailabilityGroup."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlAvailabilityGroupProperties { - #[doc = "The name of the availability group."] - #[serde(rename = "availabilityGroupName")] - pub availability_group_name: String, - #[doc = "Id GUID of the availability group."] - #[serde(rename = "availabilityGroupId")] - pub availability_group_id: String, - #[doc = "The name of the instance name which availability group primary is on."] - #[serde(rename = "instanceName", default, skip_serializing_if = "Option::is_none")] - pub instance_name: Option, - #[doc = "Timestamp for when the data was collected from the client machine."] - #[serde(rename = "collectionTimestamp", default, with = "azure_core::date::rfc3339::option")] - pub collection_timestamp: Option, - #[doc = "SQL Server availability group current version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, - #[doc = "SQL Server basic availability group."] - #[serde(rename = "basicFeatures", default, skip_serializing_if = "Option::is_none")] - pub basic_features: Option, - #[doc = "SQL Server availability group DTC support enabled."] - #[serde(rename = "dtcSupport", default, skip_serializing_if = "Option::is_none")] - pub dtc_support: Option, - #[doc = "SQL Server availability group failover for database health conditions."] - #[serde(rename = "dbFailover", default, skip_serializing_if = "Option::is_none")] - pub db_failover: Option, - #[doc = "SQL Server distributed availability group."] - #[serde(rename = "isDistributed", default, skip_serializing_if = "Option::is_none")] - pub is_distributed: Option, - #[doc = "SQL Server availability group cluster type description"] - #[serde(rename = "clusterTypeDesc", default, skip_serializing_if = "Option::is_none")] - pub cluster_type_desc: Option, - #[doc = "Availability group required the number of synchronized secondary to commit."] - #[serde(rename = "requiredSynchronizedSecondariesCommit", default, skip_serializing_if = "Option::is_none")] - pub required_synchronized_secondaries_commit: Option, - #[doc = "SQL Server availability group contained system databases."] - #[serde(rename = "isContained", default, skip_serializing_if = "Option::is_none")] - pub is_contained: Option, -} -impl SqlAvailabilityGroupProperties { - pub fn new(availability_group_name: String, availability_group_id: String) -> Self { - Self { - availability_group_name, - availability_group_id, - instance_name: None, - collection_timestamp: None, - version: None, - basic_features: None, - dtc_support: None, - db_failover: None, - is_distributed: None, - cluster_type_desc: None, - required_synchronized_secondaries_commit: None, - is_contained: None, - } - } -} -#[doc = "Arc Sql Server Availability Group"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlAvailabilityGroupReplicaResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The properties of Arc Sql availability group replica resource"] - pub properties: SqlAvailabilityGroupReplicaResourceProperties, -} -impl SqlAvailabilityGroupReplicaResource { - pub fn new(tracked_resource: TrackedResource, properties: SqlAvailabilityGroupReplicaResourceProperties) -> Self { - Self { - tracked_resource, - properties, - } - } -} -#[doc = "The properties of Arc Sql availability group replica resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupReplicaResourceProperties { - #[doc = "ID GUID of the availability group."] - #[serde(rename = "replicaId", default, skip_serializing_if = "Option::is_none")] - pub replica_id: Option, - #[doc = "the replica name."] - #[serde(rename = "replicaName", default, skip_serializing_if = "Option::is_none")] - pub replica_name: Option, - #[doc = "The specifications of the availability group replica configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configure: Option, - #[doc = "The specifications of the availability group state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The provisioning state of the Arc-enabled SQL Server availability group resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl SqlAvailabilityGroupReplicaResourceProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An update to Availability Group Replica resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupReplicaUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The properties of Arc Sql availability group replica resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SqlAvailabilityGroupReplicaUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An update to a SQL Availability Group."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlAvailabilityGroupUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl SqlAvailabilityGroupUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A SqlManagedInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlManagedInstance { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Properties of sqlManagedInstance."] - pub properties: SqlManagedInstanceProperties, - #[doc = "The complex type of the extended location."] - #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] - pub extended_location: Option, - #[doc = "The resource model definition representing SKU for Azure Managed Instance - Azure Arc"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, -} -impl SqlManagedInstance { - pub fn new(tracked_resource: TrackedResource, properties: SqlManagedInstanceProperties) -> Self { - Self { - tracked_resource, - properties, - extended_location: None, - sku: None, - } - } -} -#[doc = "The raw kubernetes information."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlManagedInstanceK8sRaw { - #[doc = "The kubernetes spec information."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub spec: Option, -} -impl SqlManagedInstanceK8sRaw { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The kubernetes spec information."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlManagedInstanceK8sSpec { - #[doc = "The kubernetes scheduling information."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scheduling: Option, - #[doc = "This option specifies the number of SQL Managed Instance replicas that will be deployed in your Kubernetes cluster for high availability purposes. If sku.tier is BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is GeneralPurpose, replicas must be '1'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub replicas: Option, -} -impl SqlManagedInstanceK8sSpec { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of SqlManagedInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlManagedInstanceListResult { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for SqlManagedInstanceListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl SqlManagedInstanceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of sqlManagedInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlManagedInstanceProperties { - #[doc = "null"] - #[serde(rename = "dataControllerId", default, skip_serializing_if = "Option::is_none")] - pub data_controller_id: Option, - #[doc = "The instance admin user"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub admin: Option, - #[doc = "The instance start time"] - #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The instance end time"] - #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The raw kubernetes information."] - #[serde(rename = "k8sRaw", default, skip_serializing_if = "Option::is_none")] - pub k8s_raw: Option, - #[doc = "Username and password for basic login authentication."] - #[serde(rename = "basicLoginInformation", default, skip_serializing_if = "Option::is_none")] - pub basic_login_information: Option, - #[doc = "Last uploaded date from Kubernetes cluster. Defaults to current date time"] - #[serde(rename = "lastUploadedDate", default, with = "azure_core::date::rfc3339::option")] - pub last_uploaded_date: Option, - #[doc = "The provisioning state of the Arc-enabled SQL Managed Instance resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Active Directory information that related to the resource."] - #[serde(rename = "activeDirectoryInformation", default, skip_serializing_if = "Option::is_none")] - pub active_directory_information: Option, - #[doc = "The license type to apply for this managed instance."] - #[serde(rename = "licenseType", default, skip_serializing_if = "Option::is_none")] - pub license_type: Option, - #[doc = "If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs to."] - #[serde(rename = "clusterId", default, skip_serializing_if = "Option::is_none")] - pub cluster_id: Option, - #[doc = "If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to."] - #[serde(rename = "extensionId", default, skip_serializing_if = "Option::is_none")] - pub extension_id: Option, -} -impl SqlManagedInstanceProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod sql_managed_instance_properties { - use super::*; - #[doc = "The license type to apply for this managed instance."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LicenseType")] - pub enum LicenseType { - BasePrice, - LicenseIncluded, - DisasterRecovery, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LicenseType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LicenseType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LicenseType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::BasePrice => serializer.serialize_unit_variant("LicenseType", 0u32, "BasePrice"), - Self::LicenseIncluded => serializer.serialize_unit_variant("LicenseType", 1u32, "LicenseIncluded"), - Self::DisasterRecovery => serializer.serialize_unit_variant("LicenseType", 2u32, "DisasterRecovery"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for LicenseType { - fn default() -> Self { - Self::BasePrice - } - } -} -#[doc = "The resource model definition representing SKU for Azure Managed Instance - Azure Arc"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlManagedInstanceSku { - #[doc = "The name of the SKU."] - pub name: sql_managed_instance_sku::Name, - #[doc = "The pricing tier for the instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, - #[doc = "Whether dev/test is enabled. When the dev field is set to true, the resource is used for dev/test purpose. "] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dev: Option, - #[doc = "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. "] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub size: Option, - #[doc = "The SKU family"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family: Option, - #[doc = "The SKU capacity"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub capacity: Option, -} -impl SqlManagedInstanceSku { - pub fn new(name: sql_managed_instance_sku::Name) -> Self { - Self { - name, - tier: None, - dev: None, - size: None, - family: None, - capacity: None, - } - } -} -pub mod sql_managed_instance_sku { - use super::*; - #[doc = "The name of the SKU."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Name { - #[serde(rename = "vCore")] - VCore, - } - #[doc = "The pricing tier for the instance."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Tier { - GeneralPurpose, - BusinessCritical, - } - impl Default for Tier { - fn default() -> Self { - Self::GeneralPurpose - } - } -} -#[doc = "An update to a SQL Managed Instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlManagedInstanceUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl SqlManagedInstanceUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Arc Sql Server Availability Group"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlServerAvailabilityGroupResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The properties of Arc Sql Server availability group resource"] - pub properties: SqlServerAvailabilityGroupResourceProperties, -} -impl SqlServerAvailabilityGroupResource { - pub fn new(tracked_resource: TrackedResource, properties: SqlServerAvailabilityGroupResourceProperties) -> Self { - Self { - tracked_resource, - properties, - } - } -} -#[doc = "The properties of Arc Sql Server availability group resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlServerAvailabilityGroupResourceProperties { - #[doc = "ID GUID of the availability group."] - #[serde(rename = "availabilityGroupId")] - pub availability_group_id: String, - #[doc = "the availability group name."] - #[serde(rename = "availabilityGroupName", default, skip_serializing_if = "Option::is_none")] - pub availability_group_name: Option, - #[doc = "The specifications of the availability group replica configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configure: Option, - #[doc = "The specifications of the availability group state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The provisioning state of the Arc-enabled SQL Server availability group resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl SqlServerAvailabilityGroupResourceProperties { - pub fn new(availability_group_id: String) -> Self { - Self { - availability_group_id, - availability_group_name: None, - configure: None, - state: None, - provisioning_state: None, - } - } -} -#[doc = "An update to availability group resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlServerAvailabilityGroupUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The properties of Arc Sql Server availability group resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SqlServerAvailabilityGroupUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Arc Sql Server database"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlServerDatabaseResource { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The properties of Arc Sql Server database resource"] - pub properties: SqlServerDatabaseResourceProperties, -} -impl SqlServerDatabaseResource { - pub fn new(tracked_resource: TrackedResource, properties: SqlServerDatabaseResourceProperties) -> Self { - Self { - tracked_resource, - properties, - } - } -} -#[doc = "The properties of Arc Sql Server database resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlServerDatabaseResourceProperties { - #[doc = "Collation of the database."] - #[serde(rename = "collationName", default, skip_serializing_if = "Option::is_none")] - pub collation_name: Option, - #[doc = "Creation date of the database."] - #[serde(rename = "databaseCreationDate", default, with = "azure_core::date::rfc3339::option")] - pub database_creation_date: Option, - #[doc = "Compatibility level of the database"] - #[serde(rename = "compatibilityLevel", default, skip_serializing_if = "Option::is_none")] - pub compatibility_level: Option, - #[doc = "Size of the database."] - #[serde(rename = "sizeMB", default, skip_serializing_if = "Option::is_none")] - pub size_mb: Option, - #[doc = "Space left of the database."] - #[serde(rename = "spaceAvailableMB", default, skip_serializing_if = "Option::is_none")] - pub space_available_mb: Option, - #[doc = "State of the database."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "Whether the database is read only or not."] - #[serde(rename = "isReadOnly", default, skip_serializing_if = "Option::is_none")] - pub is_read_only: Option, - #[doc = "Status of the database."] - #[serde(rename = "recoveryMode", default, skip_serializing_if = "Option::is_none")] - pub recovery_mode: Option, - #[doc = "List of features that are enabled for the database"] - #[serde(rename = "databaseOptions", default, skip_serializing_if = "Option::is_none")] - pub database_options: Option, - #[serde(rename = "backupInformation", default, skip_serializing_if = "Option::is_none")] - pub backup_information: Option, - #[doc = "The provisioning state of the Arc-enabled SQL Server database resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, -} -impl SqlServerDatabaseResourceProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod sql_server_database_resource_properties { - use super::*; - #[doc = "State of the database."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "State")] - pub enum State { - Online, - Restoring, - Recovering, - RecoveryPending, - Suspect, - Emergency, - Offline, - Copying, - OfflineSecondary, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for State { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for State { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for State { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Online => serializer.serialize_unit_variant("State", 0u32, "Online"), - Self::Restoring => serializer.serialize_unit_variant("State", 1u32, "Restoring"), - Self::Recovering => serializer.serialize_unit_variant("State", 2u32, "Recovering"), - Self::RecoveryPending => serializer.serialize_unit_variant("State", 3u32, "RecoveryPending"), - Self::Suspect => serializer.serialize_unit_variant("State", 4u32, "Suspect"), - Self::Emergency => serializer.serialize_unit_variant("State", 5u32, "Emergency"), - Self::Offline => serializer.serialize_unit_variant("State", 6u32, "Offline"), - Self::Copying => serializer.serialize_unit_variant("State", 7u32, "Copying"), - Self::OfflineSecondary => serializer.serialize_unit_variant("State", 8u32, "OfflineSecondary"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Status of the database."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "RecoveryMode")] - pub enum RecoveryMode { - Full, - #[serde(rename = "Bulk-logged")] - BulkLogged, - Simple, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for RecoveryMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for RecoveryMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for RecoveryMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Full => serializer.serialize_unit_variant("RecoveryMode", 0u32, "Full"), - Self::BulkLogged => serializer.serialize_unit_variant("RecoveryMode", 1u32, "Bulk-logged"), - Self::Simple => serializer.serialize_unit_variant("RecoveryMode", 2u32, "Simple"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "List of features that are enabled for the database"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DatabaseOptions { - #[serde(rename = "isAutoCloseOn", default, skip_serializing_if = "Option::is_none")] - pub is_auto_close_on: Option, - #[serde(rename = "isAutoShrinkOn", default, skip_serializing_if = "Option::is_none")] - pub is_auto_shrink_on: Option, - #[serde(rename = "isAutoCreateStatsOn", default, skip_serializing_if = "Option::is_none")] - pub is_auto_create_stats_on: Option, - #[serde(rename = "isAutoUpdateStatsOn", default, skip_serializing_if = "Option::is_none")] - pub is_auto_update_stats_on: Option, - #[serde(rename = "isRemoteDataArchiveEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_remote_data_archive_enabled: Option, - #[serde(rename = "isMemoryOptimizationEnabled", default, skip_serializing_if = "Option::is_none")] - pub is_memory_optimization_enabled: Option, - #[serde(rename = "isEncrypted", default, skip_serializing_if = "Option::is_none")] - pub is_encrypted: Option, - #[serde(rename = "isTrustworthyOn", default, skip_serializing_if = "Option::is_none")] - pub is_trustworthy_on: Option, - } - impl DatabaseOptions { - pub fn new() -> Self { - Self::default() - } - } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct BackupInformation { - #[doc = "Date time of last full backup."] - #[serde(rename = "lastFullBackup", default, with = "azure_core::date::rfc3339::option")] - pub last_full_backup: Option, - #[doc = "Date time of last log backup."] - #[serde(rename = "lastLogBackup", default, with = "azure_core::date::rfc3339::option")] - pub last_log_backup: Option, - } - impl BackupInformation { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "An update to database resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlServerDatabaseUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The properties of Arc Sql Server database resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SqlServerDatabaseUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A SqlServerInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlServerInstance { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Properties of SqlServerInstance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SqlServerInstance { - pub fn new(tracked_resource: TrackedResource) -> Self { - Self { - tracked_resource, - properties: None, - } - } -} -#[doc = "A list of SqlServerInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlServerInstanceListResult { - #[doc = "Array of results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for SqlServerInstanceListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl SqlServerInstanceListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties of SqlServerInstance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SqlServerInstanceProperties { - #[doc = "SQL Server version."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, - #[doc = "SQL Server edition."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub edition: Option, - #[doc = "ARM Resource id of the container resource (Azure Arc for Servers)."] - #[serde(rename = "containerResourceId")] - pub container_resource_id: String, - #[doc = "The time when the resource was created."] - #[serde(rename = "createTime", default, skip_serializing_if = "Option::is_none")] - pub create_time: Option, - #[doc = "The number of logical processors used by the SQL Server instance."] - #[serde(rename = "vCore", default, skip_serializing_if = "Option::is_none")] - pub v_core: Option, - #[doc = "The number of total cores of the Operating System Environment (OSE) hosting the SQL Server instance."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cores: Option, - #[doc = "The cloud connectivity status."] - pub status: sql_server_instance_properties::Status, - #[doc = "SQL Server update level."] - #[serde(rename = "patchLevel", default, skip_serializing_if = "Option::is_none")] - pub patch_level: Option, - #[doc = "SQL Server collation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collation: Option, - #[doc = "SQL Server current version."] - #[serde(rename = "currentVersion", default, skip_serializing_if = "Option::is_none")] - pub current_version: Option, - #[doc = "SQL Server instance name."] - #[serde(rename = "instanceName", default, skip_serializing_if = "Option::is_none")] - pub instance_name: Option, - #[doc = "Dynamic TCP ports used by SQL Server."] - #[serde(rename = "tcpDynamicPorts", default, skip_serializing_if = "Option::is_none")] - pub tcp_dynamic_ports: Option, - #[doc = "Static TCP ports used by SQL Server."] - #[serde(rename = "tcpStaticPorts", default, skip_serializing_if = "Option::is_none")] - pub tcp_static_ports: Option, - #[doc = "SQL Server product ID."] - #[serde(rename = "productId", default, skip_serializing_if = "Option::is_none")] - pub product_id: Option, - #[doc = "SQL Server license type."] - #[serde(rename = "licenseType", default, skip_serializing_if = "Option::is_none")] - pub license_type: Option, - #[doc = "Timestamp of last Azure Defender status update."] - #[serde(rename = "azureDefenderStatusLastUpdated", default, with = "azure_core::date::rfc3339::option")] - pub azure_defender_status_last_updated: Option, - #[doc = "Status of Azure Defender."] - #[serde(rename = "azureDefenderStatus", default, skip_serializing_if = "Option::is_none")] - pub azure_defender_status: Option, - #[doc = "The provisioning state of the Arc-enabled SQL Server resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Type of host for Azure Arc SQL Server"] - #[serde(rename = "hostType", default, skip_serializing_if = "Option::is_none")] - pub host_type: Option, -} -impl SqlServerInstanceProperties { - pub fn new(container_resource_id: String, status: sql_server_instance_properties::Status) -> Self { - Self { - version: None, - edition: None, - container_resource_id, - create_time: None, - v_core: None, - cores: None, - status, - patch_level: None, - collation: None, - current_version: None, - instance_name: None, - tcp_dynamic_ports: None, - tcp_static_ports: None, - product_id: None, - license_type: None, - azure_defender_status_last_updated: None, - azure_defender_status: None, - provisioning_state: None, - host_type: None, - } - } -} -pub mod sql_server_instance_properties { - use super::*; - #[doc = "SQL Server version."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Version")] - pub enum Version { - #[serde(rename = "SQL Server 2012")] - SqlServer2012, - #[serde(rename = "SQL Server 2014")] - SqlServer2014, - #[serde(rename = "SQL Server 2016")] - SqlServer2016, - #[serde(rename = "SQL Server 2017")] - SqlServer2017, - #[serde(rename = "SQL Server 2019")] - SqlServer2019, - #[serde(rename = "SQL Server 2022")] - SqlServer2022, - Unknown, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Version { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Version { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Version { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::SqlServer2012 => serializer.serialize_unit_variant("Version", 0u32, "SQL Server 2012"), - Self::SqlServer2014 => serializer.serialize_unit_variant("Version", 1u32, "SQL Server 2014"), - Self::SqlServer2016 => serializer.serialize_unit_variant("Version", 2u32, "SQL Server 2016"), - Self::SqlServer2017 => serializer.serialize_unit_variant("Version", 3u32, "SQL Server 2017"), - Self::SqlServer2019 => serializer.serialize_unit_variant("Version", 4u32, "SQL Server 2019"), - Self::SqlServer2022 => serializer.serialize_unit_variant("Version", 5u32, "SQL Server 2022"), - Self::Unknown => serializer.serialize_unit_variant("Version", 6u32, "Unknown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "SQL Server edition."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Edition")] - pub enum Edition { - Evaluation, - Enterprise, - Standard, - Web, - Developer, - Express, - #[serde(rename = "Business Intelligence")] - BusinessIntelligence, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Edition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Edition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Edition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Evaluation => serializer.serialize_unit_variant("Edition", 0u32, "Evaluation"), - Self::Enterprise => serializer.serialize_unit_variant("Edition", 1u32, "Enterprise"), - Self::Standard => serializer.serialize_unit_variant("Edition", 2u32, "Standard"), - Self::Web => serializer.serialize_unit_variant("Edition", 3u32, "Web"), - Self::Developer => serializer.serialize_unit_variant("Edition", 4u32, "Developer"), - Self::Express => serializer.serialize_unit_variant("Edition", 5u32, "Express"), - Self::BusinessIntelligence => serializer.serialize_unit_variant("Edition", 6u32, "Business Intelligence"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The cloud connectivity status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Connected, - Disconnected, - Registered, - Unknown, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Connected => serializer.serialize_unit_variant("Status", 0u32, "Connected"), - Self::Disconnected => serializer.serialize_unit_variant("Status", 1u32, "Disconnected"), - Self::Registered => serializer.serialize_unit_variant("Status", 2u32, "Registered"), - Self::Unknown => serializer.serialize_unit_variant("Status", 3u32, "Unknown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "SQL Server license type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LicenseType")] - pub enum LicenseType { - Undefined, - Free, - #[serde(rename = "HADR")] - Hadr, - #[serde(rename = "ServerCAL")] - ServerCal, - LicenseOnly, - #[serde(rename = "PAYG")] - Payg, - Paid, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LicenseType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LicenseType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LicenseType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Undefined => serializer.serialize_unit_variant("LicenseType", 0u32, "Undefined"), - Self::Free => serializer.serialize_unit_variant("LicenseType", 1u32, "Free"), - Self::Hadr => serializer.serialize_unit_variant("LicenseType", 2u32, "HADR"), - Self::ServerCal => serializer.serialize_unit_variant("LicenseType", 3u32, "ServerCAL"), - Self::LicenseOnly => serializer.serialize_unit_variant("LicenseType", 4u32, "LicenseOnly"), - Self::Payg => serializer.serialize_unit_variant("LicenseType", 5u32, "PAYG"), - Self::Paid => serializer.serialize_unit_variant("LicenseType", 6u32, "Paid"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Status of Azure Defender."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "AzureDefenderStatus")] - pub enum AzureDefenderStatus { - Protected, - Unprotected, - Unknown, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for AzureDefenderStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for AzureDefenderStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for AzureDefenderStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Protected => serializer.serialize_unit_variant("AzureDefenderStatus", 0u32, "Protected"), - Self::Unprotected => serializer.serialize_unit_variant("AzureDefenderStatus", 1u32, "Unprotected"), - Self::Unknown => serializer.serialize_unit_variant("AzureDefenderStatus", 2u32, "Unknown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Type of host for Azure Arc SQL Server"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "HostType")] - pub enum HostType { - #[serde(rename = "Azure Virtual Machine")] - AzureVirtualMachine, - #[serde(rename = "Azure VMWare Virtual Machine")] - AzureVmWareVirtualMachine, - #[serde(rename = "Azure Kubernetes Service")] - AzureKubernetesService, - #[serde(rename = "AWS VMWare Virtual Machine")] - AwsVmWareVirtualMachine, - #[serde(rename = "AWS Kubernetes Service")] - AwsKubernetesService, - #[serde(rename = "GCP VMWare Virtual Machine")] - GcpVmWareVirtualMachine, - #[serde(rename = "GCP Kubernetes Service")] - GcpKubernetesService, - Container, - #[serde(rename = "Virtual Machine")] - VirtualMachine, - #[serde(rename = "Physical Server")] - PhysicalServer, - #[serde(rename = "AWS Virtual Machine")] - AwsVirtualMachine, - #[serde(rename = "GCP Virtual Machine")] - GcpVirtualMachine, - Other, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for HostType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for HostType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for HostType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AzureVirtualMachine => serializer.serialize_unit_variant("HostType", 0u32, "Azure Virtual Machine"), - Self::AzureVmWareVirtualMachine => serializer.serialize_unit_variant("HostType", 1u32, "Azure VMWare Virtual Machine"), - Self::AzureKubernetesService => serializer.serialize_unit_variant("HostType", 2u32, "Azure Kubernetes Service"), - Self::AwsVmWareVirtualMachine => serializer.serialize_unit_variant("HostType", 3u32, "AWS VMWare Virtual Machine"), - Self::AwsKubernetesService => serializer.serialize_unit_variant("HostType", 4u32, "AWS Kubernetes Service"), - Self::GcpVmWareVirtualMachine => serializer.serialize_unit_variant("HostType", 5u32, "GCP VMWare Virtual Machine"), - Self::GcpKubernetesService => serializer.serialize_unit_variant("HostType", 6u32, "GCP Kubernetes Service"), - Self::Container => serializer.serialize_unit_variant("HostType", 7u32, "Container"), - Self::VirtualMachine => serializer.serialize_unit_variant("HostType", 8u32, "Virtual Machine"), - Self::PhysicalServer => serializer.serialize_unit_variant("HostType", 9u32, "Physical Server"), - Self::AwsVirtualMachine => serializer.serialize_unit_variant("HostType", 10u32, "AWS Virtual Machine"), - Self::GcpVirtualMachine => serializer.serialize_unit_variant("HostType", 11u32, "GCP Virtual Machine"), - Self::Other => serializer.serialize_unit_variant("HostType", 12u32, "Other"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "An update to a SQL Server Instance."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SqlServerInstanceUpdate { - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl SqlServerInstanceUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The geo-location where the resource lives"] - pub location: String, -} -impl TrackedResource { - pub fn new(location: String) -> Self { - Self { - resource: Resource::default(), - tags: None, - location, - } - } -} -#[doc = "Service principal for uploading billing, metrics and logs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UploadServicePrincipal { - #[doc = "Client ID of the service principal for uploading data."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "Tenant ID of the service principal."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "Authority for the service principal. Example: https://login.microsoftonline.com/"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authority: Option, - #[doc = "Secret of the service principal"] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, -} -impl UploadServicePrincipal { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties on upload watermark. Mostly timestamp for each upload data type"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UploadWatermark { - #[doc = "Last uploaded date for metrics from kubernetes cluster. Defaults to current date time"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub metrics: Option, - #[doc = "Last uploaded date for logs from kubernetes cluster. Defaults to current date time"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub logs: Option, - #[doc = "Last uploaded date for usages from kubernetes cluster. Defaults to current date time"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub usages: Option, -} -impl UploadWatermark { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/baremetalinfrastructure/Cargo.toml b/services/mgmt/baremetalinfrastructure/Cargo.toml index 57b995aafc..ded388bb04 100644 --- a/services/mgmt/baremetalinfrastructure/Cargo.toml +++ b/services/mgmt/baremetalinfrastructure/Cargo.toml @@ -32,9 +32,10 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2021-08-09", "enable_reqwest"] +default = ["package-2023-04-06", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-2023-04-06" = [] "package-2021-08-09" = [] "package-2020-08-06-preview" = [] \ No newline at end of file diff --git a/services/mgmt/baremetalinfrastructure/README.md b/services/mgmt/baremetalinfrastructure/README.md index 71cd1c212e..a2b13e8563 100644 --- a/services/mgmt/baremetalinfrastructure/README.md +++ b/services/mgmt/baremetalinfrastructure/README.md @@ -6,9 +6,10 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/baremetali To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2021-08-09`. +The default tag is `package-2023-04-06`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-2023-04-06` has 11 operations from 1 API versions: `2023-04-06`. Use crate feature `package-2023-04-06` to enable. The operations will be in the `package_2023_04_06` module. - `package-2021-08-09` has 5 operations from 1 API versions: `2021-08-09`. Use crate feature `package-2021-08-09` to enable. The operations will be in the `package_2021_08_09` module. - `package-2020-08-06-preview` has 9 operations from 1 API versions: `2020-08-06-preview`. Use crate feature `package-2020-08-06-preview` to enable. The operations will be in the `package_2020_08_06_preview` module. \ No newline at end of file diff --git a/services/mgmt/baremetalinfrastructure/src/lib.rs b/services/mgmt/baremetalinfrastructure/src/lib.rs index cc84e4feee..a2f65e0b6b 100644 --- a/services/mgmt/baremetalinfrastructure/src/lib.rs +++ b/services/mgmt/baremetalinfrastructure/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-04-06")] +pub mod package_2023_04_06; +#[cfg(all(feature = "package-2023-04-06", not(feature = "no-default-tag")))] +pub use package_2023_04_06::*; #[cfg(feature = "package-2021-08-09")] pub mod package_2021_08_09; #[cfg(all(feature = "package-2021-08-09", not(feature = "no-default-tag")))] diff --git a/services/mgmt/dns/src/package_2017_09/mod.rs b/services/mgmt/baremetalinfrastructure/src/package_2023_04_06/mod.rs similarity index 73% rename from services/mgmt/dns/src/package_2017_09/mod.rs rename to services/mgmt/baremetalinfrastructure/src/package_2023_04_06/mod.rs index bc6f6f8ae9..ad985752bf 100644 --- a/services/mgmt/dns/src/package_2017_09/mod.rs +++ b/services/mgmt/baremetalinfrastructure/src/package_2023_04_06/mod.rs @@ -103,180 +103,206 @@ impl Client { pipeline, } } - pub fn record_sets_client(&self) -> record_sets::Client { - record_sets::Client(self.clone()) + pub fn azure_bare_metal_instances_client(&self) -> azure_bare_metal_instances::Client { + azure_bare_metal_instances::Client(self.clone()) } - pub fn zones_client(&self) -> zones::Client { - zones::Client(self.clone()) + pub fn azure_bare_metal_storage_instances_client(&self) -> azure_bare_metal_storage_instances::Client { + azure_bare_metal_storage_instances::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) } } -pub mod record_sets { +pub mod azure_bare_metal_instances { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets a record set."] + #[doc = "Gets a list of Azure BareMetal instances in the specified subscription."] + #[doc = "Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] - #[doc = "* `record_type`: The type of DNS record in this record set."] #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn get( - &self, - resource_group_name: impl Into, - zone_name: impl Into, - relative_record_set_name: impl Into, - record_type: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - relative_record_set_name: relative_record_set_name.into(), - record_type: record_type.into(), subscription_id: subscription_id.into(), } } - #[doc = "Creates or updates a record set within a DNS zone."] + #[doc = "Gets a list of Azure BareMetal instances in the specified subscription and resource group."] + #[doc = "Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] - #[doc = "* `record_type`: The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created)."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate operation."] #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn create_or_update( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( &self, - resource_group_name: impl Into, - zone_name: impl Into, - relative_record_set_name: impl Into, - record_type: impl Into, - parameters: impl Into, subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - relative_record_set_name: relative_record_set_name.into(), - record_type: record_type.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), - if_match: None, - if_none_match: None, + resource_group_name: resource_group_name.into(), } } - #[doc = "Updates a record set within a DNS zone."] + #[doc = "Gets an Azure BareMetal instance."] + #[doc = "Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] - #[doc = "* `record_type`: The type of DNS record in this record set."] - #[doc = "* `parameters`: Parameters supplied to the Update operation."] #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn update( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `azure_bare_metal_instance_name`: Name of the Azure BareMetal on Azure instance."] + pub fn get( &self, - resource_group_name: impl Into, - zone_name: impl Into, - relative_record_set_name: impl Into, - record_type: impl Into, - parameters: impl Into, subscription_id: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + resource_group_name: impl Into, + azure_bare_metal_instance_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - relative_record_set_name: relative_record_set_name.into(), - record_type: record_type.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), - if_match: None, + resource_group_name: resource_group_name.into(), + azure_bare_metal_instance_name: azure_bare_metal_instance_name.into(), } } - #[doc = "Deletes a record set from a DNS zone. This operation cannot be undone."] + #[doc = "Patches the Tags field of a Azure BareMetal instance."] + #[doc = "Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] - #[doc = "* `record_type`: The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted)."] #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn delete( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `azure_bare_metal_instance_name`: Name of the Azure BareMetal on Azure instance."] + #[doc = "* `tags_parameter`: Request body that only contains the new Tags field"] + pub fn update( &self, - resource_group_name: impl Into, - zone_name: impl Into, - relative_record_set_name: impl Into, - record_type: impl Into, subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + resource_group_name: impl Into, + azure_bare_metal_instance_name: impl Into, + tags_parameter: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - relative_record_set_name: relative_record_set_name.into(), - record_type: record_type.into(), subscription_id: subscription_id.into(), - if_match: None, + resource_group_name: resource_group_name.into(), + azure_bare_metal_instance_name: azure_bare_metal_instance_name.into(), + tags_parameter: tags_parameter.into(), } } - #[doc = "Lists the record sets of a specified type in a DNS zone."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `record_type`: The type of record sets to enumerate."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_type( - &self, - resource_group_name: impl Into, - zone_name: impl Into, - record_type: impl Into, - subscription_id: impl Into, - ) -> list_by_type::RequestBuilder { - list_by_type::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - record_type: record_type.into(), - subscription_id: subscription_id.into(), - top: None, - recordsetnamesuffix: None, + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AzureBareMetalInstancesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "Lists all record sets in a DNS zone."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_dns_zone( - &self, - resource_group_name: impl Into, - zone_name: impl Into, - subscription_id: impl Into, - ) -> list_by_dns_zone::RequestBuilder { - list_by_dns_zone::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - subscription_id: subscription_id.into(), - top: None, - recordsetnamesuffix: None, + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } - pub mod get { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecordSet = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalInstancesListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -313,67 +339,79 @@ pub mod record_sets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) relative_record_set_name: String, - pub(crate) record_type: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.zone_name, - &this.record_type, - &this.relative_record_set_name + &this.resource_group_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod create_or_update { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecordSet = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalInstance = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -410,26 +448,11 @@ pub mod record_sets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) relative_record_set_name: String, - pub(crate) record_type: String, - pub(crate) parameters: models::RecordSet, pub(crate) subscription_id: String, - pub(crate) if_match: Option, - pub(crate) if_none_match: Option, + pub(crate) resource_group_name: String, + pub(crate) azure_bare_metal_instance_name: String, } impl RequestBuilder { - #[doc = "The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } - #[doc = "Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored."] - pub fn if_none_match(mut self, if_none_match: impl Into) -> Self { - self.if_none_match = Some(if_none_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -439,15 +462,13 @@ pub mod record_sets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.zone_name, - &this.record_type, - &this.relative_record_set_name + &this.azure_bare_metal_instance_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -456,15 +477,8 @@ pub mod record_sets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - if let Some(if_none_match) = &this.if_none_match { - req.insert_header("if-none-match", if_none_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -472,8 +486,8 @@ pub mod record_sets { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -488,9 +502,9 @@ pub mod record_sets { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecordSet = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalInstance = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -527,20 +541,12 @@ pub mod record_sets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) relative_record_set_name: String, - pub(crate) record_type: String, - pub(crate) parameters: models::RecordSet, pub(crate) subscription_id: String, - pub(crate) if_match: Option, + pub(crate) resource_group_name: String, + pub(crate) azure_bare_metal_instance_name: String, + pub(crate) tags_parameter: models::Tags, } impl RequestBuilder { - #[doc = "The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting concurrent changes."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -550,13 +556,11 @@ pub mod record_sets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.zone_name, - &this.record_type, - &this.relative_record_set_name + &this.azure_bare_metal_instance_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -567,12 +571,9 @@ pub mod record_sets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + let req_body = azure_core::to_json(&this.tags_parameter)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -580,8 +581,8 @@ pub mod record_sets { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -592,9 +593,42 @@ pub mod record_sets { } } } - pub mod delete { - use super::models; +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of AzureBareMetal management operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -612,19 +646,9 @@ pub mod record_sets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) relative_record_set_name: String, - pub(crate) record_type: String, - pub(crate) subscription_id: String, - pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -634,15 +658,10 @@ pub mod record_sets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", + "{}/providers/Microsoft.BareMetalInfrastructure/operations", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.zone_name, - &this.record_type, - &this.relative_record_set_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -651,10 +670,7 @@ pub mod record_sets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -663,13 +679,131 @@ pub mod record_sets { } } } - pub mod list_by_type { +} +pub mod azure_bare_metal_storage_instances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of Azure BareMetalStorage instances in the specified subscription."] + #[doc = "Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of Azure BareMetalStorage instances in the specified subscription and resource group."] + #[doc = "Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Gets an Azure BareMetal Storage instance."] + #[doc = "Gets an Azure BareMetal Storage instance for the specified subscription, resource group, and instance name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `azure_bare_metal_storage_instance_name`: Name of the AzureBareMetalStorage on Azure instance."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + azure_bare_metal_storage_instance_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + azure_bare_metal_storage_instance_name: azure_bare_metal_storage_instance_name.into(), + } + } + #[doc = "Create an azure baremetal storage resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `azure_bare_metal_storage_instance_name`: Name of the AzureBareMetalStorage on Azure instance."] + #[doc = "* `request_body_parameters`: request body for put call"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + azure_bare_metal_storage_instance_name: impl Into, + request_body_parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + azure_bare_metal_storage_instance_name: azure_bare_metal_storage_instance_name.into(), + request_body_parameters: request_body_parameters.into(), + } + } + #[doc = "Patches the Tags field of a Azure BareMetalStorage instance."] + #[doc = "Patches the Tags field of a Azure BareMetalStorage instance for the specified subscription, resource group, and instance name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `azure_bare_metal_storage_instance_name`: Name of the AzureBareMetalStorage on Azure instance."] + #[doc = "* `tags_parameter`: Request body that only contains the new Tags field"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + azure_bare_metal_storage_instance_name: impl Into, + tags_parameter: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + azure_bare_metal_storage_instance_name: azure_bare_metal_storage_instance_name.into(), + tags_parameter: tags_parameter.into(), + } + } + #[doc = "Delete an AzureBareMetalStorageInstance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `azure_bare_metal_storage_instance_name`: Name of the AzureBareMetalStorage on Azure instance."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + azure_bare_metal_storage_instance_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + azure_bare_metal_storage_instance_name: azure_bare_metal_storage_instance_name.into(), + } + } + } + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecordSetListResult = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalStorageInstancesListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -706,35 +840,17 @@ pub mod record_sets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) record_type: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) recordsetnamesuffix: Option, } impl RequestBuilder { - #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with ."] - pub fn recordsetnamesuffix(mut self, recordsetnamesuffix: impl Into) -> Self { - self.recordsetnamesuffix = Some(recordsetnamesuffix.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}", + "{}/subscriptions/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.zone_name, - &this.record_type + &this.subscription_id ))?; let rsp = match continuation { Some(value) => { @@ -752,7 +868,7 @@ pub mod record_sets { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -768,15 +884,7 @@ pub mod record_sets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(recordsetnamesuffix) = &this.recordsetnamesuffix { - req.url_mut() - .query_pairs_mut() - .append_pair("$recordsetnamesuffix", recordsetnamesuffix); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -796,13 +904,13 @@ pub mod record_sets { } } } - pub mod list_by_dns_zone { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecordSetListResult = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalStorageInstancesListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -839,33 +947,19 @@ pub mod record_sets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, pub(crate) subscription_id: String, - pub(crate) top: Option, - pub(crate) recordsetnamesuffix: Option, + pub(crate) resource_group_name: String, } impl RequestBuilder { - #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with ."] - pub fn recordsetnamesuffix(mut self, recordsetnamesuffix: impl Into) -> Self { - self.recordsetnamesuffix = Some(recordsetnamesuffix.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/recordsets", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.zone_name + &this.resource_group_name ))?; let rsp = match continuation { Some(value) => { @@ -883,7 +977,7 @@ pub mod record_sets { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -899,15 +993,7 @@ pub mod record_sets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(recordsetnamesuffix) = &this.recordsetnamesuffix { - req.url_mut() - .query_pairs_mut() - .append_pair("$recordsetnamesuffix", recordsetnamesuffix); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -927,110 +1013,13 @@ pub mod record_sets { } } } -} -pub mod zones { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn get( - &self, - resource_group_name: impl Into, - zone_name: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Creates or updates a DNS zone. Does not modify DNS records within the zone."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate operation."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - zone_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - if_match: None, - if_none_match: None, - } - } - #[doc = "Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn delete( - &self, - resource_group_name: impl Into, - zone_name: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - zone_name: zone_name.into(), - subscription_id: subscription_id.into(), - if_match: None, - } - } - #[doc = "Lists the DNS zones within a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_resource_group( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - top: None, - } - } - #[doc = "Lists the DNS zones in all resource groups in a subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - top: None, - } - } - } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Zone = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalStorageInstance = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1067,9 +1056,9 @@ pub mod zones { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) azure_bare_metal_storage_instance_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1080,13 +1069,7 @@ pub mod zones { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.zone_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . azure_bare_metal_storage_instance_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1096,7 +1079,7 @@ pub mod zones { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1105,8 +1088,8 @@ pub mod zones { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1117,13 +1100,13 @@ pub mod zones { } } } - pub mod create_or_update { + pub mod create { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Zone = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalStorageInstance = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1160,24 +1143,12 @@ pub mod zones { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) parameters: models::Zone, pub(crate) subscription_id: String, - pub(crate) if_match: Option, - pub(crate) if_none_match: Option, + pub(crate) resource_group_name: String, + pub(crate) azure_bare_metal_storage_instance_name: String, + pub(crate) request_body_parameters: models::AzureBareMetalStorageInstance, } impl RequestBuilder { - #[doc = "The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } - #[doc = "Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored."] - pub fn if_none_match(mut self, if_none_match: impl Into) -> Self { - self.if_none_match = Some(if_none_match.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1186,13 +1157,7 @@ pub mod zones { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.zone_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . azure_bare_metal_storage_instance_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1202,15 +1167,9 @@ pub mod zones { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - if let Some(if_none_match) = &this.if_none_match { - req.insert_header("if-none-match", if_none_match); - } + let req_body = azure_core::to_json(&this.request_body_parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1218,8 +1177,8 @@ pub mod zones { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1230,81 +1189,13 @@ pub mod zones { } } } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) zone_name: String, - pub(crate) subscription_id: String, - pub(crate) if_match: Option, - } - impl RequestBuilder { - #[doc = "The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes."] - pub fn if_match(mut self, if_match: impl Into) -> Self { - self.if_match = Some(if_match.into()); - self - } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.zone_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - if let Some(if_match) = &this.if_match { - req.insert_header("if-match", if_match); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod list_by_resource_group { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ZoneListResult = serde_json::from_slice(&bytes)?; + let body: models::AzureBareMetalStorageInstance = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1341,107 +1232,55 @@ pub mod zones { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) top: Option, + pub(crate) resource_group_name: String, + pub(crate) azure_bare_metal_storage_instance_name: String, + pub(crate) tags_parameter: models::Tags, } impl RequestBuilder { - #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . azure_bare_metal_storage_instance_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.tags_parameter)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ZoneListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1460,75 +1299,34 @@ pub mod zones { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) top: Option, + pub(crate) resource_group_name: String, + pub(crate) azure_bare_metal_storage_instance_name: String, } impl RequestBuilder { - #[doc = "The maximum number of DNS zones to return. If not specified, returns up to 100 zones."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Network/dnszones", - this.client.endpoint(), - &this.subscription_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2017-09-01"); - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . azure_bare_metal_storage_instance_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-06"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } diff --git a/services/mgmt/baremetalinfrastructure/src/package_2023_04_06/models.rs b/services/mgmt/baremetalinfrastructure/src/package_2023_04_06/models.rs new file mode 100644 index 0000000000..61b4f2871e --- /dev/null +++ b/services/mgmt/baremetalinfrastructure/src/package_2023_04_06/models.rs @@ -0,0 +1,921 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureBareMetalInstance { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Describes the properties of an AzureBareMetal instance."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl AzureBareMetalInstance { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + } + } +} +#[doc = "Describes the properties of an AzureBareMetal instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureBareMetalInstanceProperties { + #[doc = "Specifies the hardware settings for the AzureBareMetal instance."] + #[serde(rename = "hardwareProfile", default, skip_serializing_if = "Option::is_none")] + pub hardware_profile: Option, + #[doc = "Specifies the storage settings for the AzureBareMetal instance disks."] + #[serde(rename = "storageProfile", default, skip_serializing_if = "Option::is_none")] + pub storage_profile: Option, + #[doc = "Specifies the operating system settings for the AzureBareMetal instance."] + #[serde(rename = "osProfile", default, skip_serializing_if = "Option::is_none")] + pub os_profile: Option, + #[doc = "Specifies the network settings for the AzureBareMetal instance disks."] + #[serde(rename = "networkProfile", default, skip_serializing_if = "Option::is_none")] + pub network_profile: Option, + #[doc = "Specifies the AzureBareMetal instance unique ID."] + #[serde(rename = "azureBareMetalInstanceId", default, skip_serializing_if = "Option::is_none")] + pub azure_bare_metal_instance_id: Option, + #[doc = "Resource power state"] + #[serde(rename = "powerState", default, skip_serializing_if = "Option::is_none")] + pub power_state: Option, + #[doc = "Resource proximity placement group"] + #[serde(rename = "proximityPlacementGroup", default, skip_serializing_if = "Option::is_none")] + pub proximity_placement_group: Option, + #[doc = "Hardware revision of an AzureBareMetal instance"] + #[serde(rename = "hwRevision", default, skip_serializing_if = "Option::is_none")] + pub hw_revision: Option, + #[doc = "ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance"] + #[serde(rename = "partnerNodeId", default, skip_serializing_if = "Option::is_none")] + pub partner_node_id: Option, + #[doc = "State of provisioning of the AzureBareMetalInstance"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl AzureBareMetalInstanceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod azure_bare_metal_instance_properties { + use super::*; + #[doc = "Resource power state"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PowerState")] + pub enum PowerState { + #[serde(rename = "starting")] + Starting, + #[serde(rename = "started")] + Started, + #[serde(rename = "stopping")] + Stopping, + #[serde(rename = "stopped")] + Stopped, + #[serde(rename = "restarting")] + Restarting, + #[serde(rename = "unknown")] + Unknown, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PowerState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PowerState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PowerState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Starting => serializer.serialize_unit_variant("PowerState", 0u32, "starting"), + Self::Started => serializer.serialize_unit_variant("PowerState", 1u32, "started"), + Self::Stopping => serializer.serialize_unit_variant("PowerState", 2u32, "stopping"), + Self::Stopped => serializer.serialize_unit_variant("PowerState", 3u32, "stopped"), + Self::Restarting => serializer.serialize_unit_variant("PowerState", 4u32, "restarting"), + Self::Unknown => serializer.serialize_unit_variant("PowerState", 5u32, "unknown"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "State of provisioning of the AzureBareMetalInstance"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Accepted, + Creating, + Updating, + Failed, + Succeeded, + Deleting, + Migrating, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Updating"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Deleting"), + Self::Migrating => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Migrating"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The response from the List AzureBareMetal Instances operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureBareMetalInstancesListResult { + #[doc = "The list of Azure BareMetal instances."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of AzureBareMetal instances."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AzureBareMetalInstancesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AzureBareMetalInstancesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AzureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureBareMetalStorageInstance { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Describes the properties of an AzureBareMetalStorageInstance."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl AzureBareMetalStorageInstance { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + } + } +} +#[doc = "Describes the properties of an AzureBareMetalStorageInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureBareMetalStorageInstanceProperties { + #[doc = "Specifies the AzureBareMetaStorageInstance unique ID."] + #[serde( + rename = "azureBareMetalStorageInstanceUniqueIdentifier", + default, + skip_serializing_if = "Option::is_none" + )] + pub azure_bare_metal_storage_instance_unique_identifier: Option, + #[doc = "described the storage properties of the azure baremetalstorage instance"] + #[serde(rename = "storageProperties", default, skip_serializing_if = "Option::is_none")] + pub storage_properties: Option, +} +impl AzureBareMetalStorageInstanceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response from the Get AzureBareMetalStorageInstances operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureBareMetalStorageInstancesListResult { + #[doc = "The list of AzureBareMetalStorage instances."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of AzureBareMetalStorage instances."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AzureBareMetalStorageInstancesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AzureBareMetalStorageInstancesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Specifies the disk information fo the AzureBareMetal instance"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Disk { + #[doc = "The disk name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Specifies the size of an empty data disk in gigabytes."] + #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] + pub disk_size_gb: Option, + #[doc = "Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lun: Option, +} +impl Disk { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Detailed BareMetal operation information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Display { + #[doc = "The localized friendly form of the resource provider name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly form of the resource type related to this action/operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The localized friendly name for the operation as shown to the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The localized friendly description for the operation as shown to the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl Display { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Specifies the hardware settings for the AzureBareMetal instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HardwareProfile { + #[doc = "Name of the hardware type (vendor and/or their product name)"] + #[serde(rename = "hardwareType", default, skip_serializing_if = "Option::is_none")] + pub hardware_type: Option, + #[doc = "Specifies the AzureBareMetal instance SKU."] + #[serde(rename = "azureBareMetalInstanceSize", default, skip_serializing_if = "Option::is_none")] + pub azure_bare_metal_instance_size: Option, +} +impl HardwareProfile { + pub fn new() -> Self { + Self::default() + } +} +pub mod hardware_profile { + use super::*; + #[doc = "Name of the hardware type (vendor and/or their product name)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "HardwareType")] + pub enum HardwareType { + #[serde(rename = "Cisco_UCS")] + CiscoUcs, + #[serde(rename = "HPE")] + Hpe, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for HardwareType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for HardwareType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for HardwareType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CiscoUcs => serializer.serialize_unit_variant("HardwareType", 0u32, "Cisco_UCS"), + Self::Hpe => serializer.serialize_unit_variant("HardwareType", 1u32, "HPE"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Specifies the AzureBareMetal instance SKU."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AzureBareMetalInstanceSize")] + pub enum AzureBareMetalInstanceSize { + S72m, + S144m, + S72, + S144, + S192, + S192m, + S192xm, + S96, + S112, + S224, + S224m, + S224om, + S224oo, + S224oom, + S224ooo, + S384, + S384m, + S384xm, + S384xxm, + S448, + S448m, + S448om, + S448oo, + S448oom, + S448ooo, + S576m, + S576xm, + S672, + S672m, + S672om, + S672oo, + S672oom, + S672ooo, + S768, + S768m, + S768xm, + S896, + S896m, + S896om, + S896oo, + S896oom, + S896ooo, + S960m, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AzureBareMetalInstanceSize { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AzureBareMetalInstanceSize { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AzureBareMetalInstanceSize { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::S72m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 0u32, "S72m"), + Self::S144m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 1u32, "S144m"), + Self::S72 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 2u32, "S72"), + Self::S144 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 3u32, "S144"), + Self::S192 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 4u32, "S192"), + Self::S192m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 5u32, "S192m"), + Self::S192xm => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 6u32, "S192xm"), + Self::S96 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 7u32, "S96"), + Self::S112 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 8u32, "S112"), + Self::S224 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 9u32, "S224"), + Self::S224m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 10u32, "S224m"), + Self::S224om => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 11u32, "S224om"), + Self::S224oo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 12u32, "S224oo"), + Self::S224oom => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 13u32, "S224oom"), + Self::S224ooo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 14u32, "S224ooo"), + Self::S384 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 15u32, "S384"), + Self::S384m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 16u32, "S384m"), + Self::S384xm => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 17u32, "S384xm"), + Self::S384xxm => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 18u32, "S384xxm"), + Self::S448 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 19u32, "S448"), + Self::S448m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 20u32, "S448m"), + Self::S448om => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 21u32, "S448om"), + Self::S448oo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 22u32, "S448oo"), + Self::S448oom => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 23u32, "S448oom"), + Self::S448ooo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 24u32, "S448ooo"), + Self::S576m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 25u32, "S576m"), + Self::S576xm => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 26u32, "S576xm"), + Self::S672 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 27u32, "S672"), + Self::S672m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 28u32, "S672m"), + Self::S672om => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 29u32, "S672om"), + Self::S672oo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 30u32, "S672oo"), + Self::S672oom => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 31u32, "S672oom"), + Self::S672ooo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 32u32, "S672ooo"), + Self::S768 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 33u32, "S768"), + Self::S768m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 34u32, "S768m"), + Self::S768xm => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 35u32, "S768xm"), + Self::S896 => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 36u32, "S896"), + Self::S896m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 37u32, "S896m"), + Self::S896om => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 38u32, "S896om"), + Self::S896oo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 39u32, "S896oo"), + Self::S896oom => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 40u32, "S896oom"), + Self::S896ooo => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 41u32, "S896ooo"), + Self::S960m => serializer.serialize_unit_variant("AzureBareMetalInstanceSize", 42u32, "S960m"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Specifies the IP address of the network interface."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IpAddress { + #[doc = "Specifies the IP address of the network interface."] + #[serde(rename = "ipAddress", default, skip_serializing_if = "Option::is_none")] + pub ip_address: Option, +} +impl IpAddress { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Specifies the network settings for the AzureBareMetal instance disks."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkProfile { + #[doc = "Specifies the network interfaces for the AzureBareMetal instance."] + #[serde( + rename = "networkInterfaces", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_interfaces: Vec, + #[doc = "Specifies the circuit id for connecting to express route."] + #[serde(rename = "circuitId", default, skip_serializing_if = "Option::is_none")] + pub circuit_id: Option, +} +impl NetworkProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Specifies the operating system settings for the AzureBareMetal instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OsProfile { + #[doc = "Specifies the host OS name of the AzureBareMetal instance."] + #[serde(rename = "computerName", default, skip_serializing_if = "Option::is_none")] + pub computer_name: Option, + #[doc = "This property allows you to specify the type of the OS."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Specifies version of operating system."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Specifies the SSH public key used to access the operating system."] + #[serde(rename = "sshPublicKey", default, skip_serializing_if = "Option::is_none")] + pub ssh_public_key: Option, +} +impl OsProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AzureBareMetal operation information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Detailed BareMetal operation information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "indicates whether an operation is a data action or not."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of AzureBareMetal operations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationList { + #[doc = "List of AzureBareMetal operations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for OperationList { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl OperationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Sample result definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Result { + #[doc = "Sample property of type string"] + #[serde(rename = "sampleProperty", default, skip_serializing_if = "Option::is_none")] + pub sample_property: Option, +} +impl Result { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the billing related details of the AzureBareMetalStorageInstance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageBillingProperties { + #[doc = "the billing mode for the storage instance"] + #[serde(rename = "billingMode", default, skip_serializing_if = "Option::is_none")] + pub billing_mode: Option, + #[doc = "the SKU type that is provisioned"] + #[serde(rename = "azureBareMetalStorageInstanceSize", default, skip_serializing_if = "Option::is_none")] + pub azure_bare_metal_storage_instance_size: Option, +} +impl StorageBillingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Specifies the storage settings for the AzureBareMetal instance disks."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageProfile { + #[doc = "IP Address to connect to storage."] + #[serde(rename = "nfsIpAddress", default, skip_serializing_if = "Option::is_none")] + pub nfs_ip_address: Option, + #[doc = "Specifies information about the operating system disk used by baremetal instance."] + #[serde( + rename = "osDisks", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub os_disks: Vec, +} +impl StorageProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "described the storage properties of the azure baremetalstorage instance"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageProperties { + #[doc = "State of provisioning of the AzureBareMetalStorageInstance"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "the offering type for which the resource is getting provisioned"] + #[serde(rename = "offeringType", default, skip_serializing_if = "Option::is_none")] + pub offering_type: Option, + #[doc = "the storage protocol for which the resource is getting provisioned"] + #[serde(rename = "storageType", default, skip_serializing_if = "Option::is_none")] + pub storage_type: Option, + #[doc = "the kind of storage instance"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub generation: Option, + #[doc = "the hardware type of the storage instance"] + #[serde(rename = "hardwareType", default, skip_serializing_if = "Option::is_none")] + pub hardware_type: Option, + #[doc = "the workload for which the resource is getting provisioned"] + #[serde(rename = "workloadType", default, skip_serializing_if = "Option::is_none")] + pub workload_type: Option, + #[doc = "Describes the billing related details of the AzureBareMetalStorageInstance."] + #[serde(rename = "storageBillingProperties", default, skip_serializing_if = "Option::is_none")] + pub storage_billing_properties: Option, +} +impl StorageProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod storage_properties { + use super::*; + #[doc = "State of provisioning of the AzureBareMetalStorageInstance"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Accepted, + Creating, + Updating, + Failed, + Succeeded, + Deleting, + Canceled, + Migrating, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Updating"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Succeeded"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Deleting"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Canceled"), + Self::Migrating => serializer.serialize_unit_variant("ProvisioningState", 7u32, "Migrating"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Tags field of the AzureBareMetal/AzureBareMetaStorage instance."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Tags { + #[doc = "Tags field of the AzureBareMetal/AzureBareMetaStorage instance."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl Tags { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/chaos/Cargo.toml b/services/mgmt/chaos/Cargo.toml index d837836cec..361590f069 100644 --- a/services/mgmt/chaos/Cargo.toml +++ b/services/mgmt/chaos/Cargo.toml @@ -32,11 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-04", "enable_reqwest"] +default = ["package-2023-04-15-preview", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] -"package-preview-2023-04" = [] -"package-preview-2022-10" = [] +"package-2023-04-15-preview" = [] +"package-2023-04-01-preview" = [] +"package-2022-10-01-preview" = [] "package-2022-07-01-preview" = [] "package-2021-09-15-preview" = [] \ No newline at end of file diff --git a/services/mgmt/chaos/README.md b/services/mgmt/chaos/README.md index 3ed6d416a5..bb63e98af8 100644 --- a/services/mgmt/chaos/README.md +++ b/services/mgmt/chaos/README.md @@ -6,11 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/chaos/reso To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-04`. +The default tag is `package-2023-04-15-preview`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: -- `package-preview-2023-04` has 25 operations from 1 API versions: `2023-04-01-preview`. Use crate feature `package-preview-2023-04` to enable. The operations will be in the `package_preview_2023_04` module. -- `package-preview-2022-10` has 24 operations from 1 API versions: `2022-10-01-preview`. Use crate feature `package-preview-2022-10` to enable. The operations will be in the `package_preview_2022_10` module. +- `package-2023-04-15-preview` has 25 operations from 1 API versions: `2023-04-15-preview`. Use crate feature `package-2023-04-15-preview` to enable. The operations will be in the `package_2023_04_15_preview` module. +- `package-2023-04-01-preview` has 25 operations from 1 API versions: `2023-04-01-preview`. Use crate feature `package-2023-04-01-preview` to enable. The operations will be in the `package_2023_04_01_preview` module. +- `package-2022-10-01-preview` has 24 operations from 1 API versions: `2022-10-01-preview`. Use crate feature `package-2022-10-01-preview` to enable. The operations will be in the `package_2022_10_01_preview` module. - `package-2022-07-01-preview` has 24 operations from 1 API versions: `2022-07-01-preview`. Use crate feature `package-2022-07-01-preview` to enable. The operations will be in the `package_2022_07_01_preview` module. - `package-2021-09-15-preview` has 24 operations from 1 API versions: `2021-09-15-preview`. Use crate feature `package-2021-09-15-preview` to enable. The operations will be in the `package_2021_09_15_preview` module. \ No newline at end of file diff --git a/services/mgmt/chaos/src/lib.rs b/services/mgmt/chaos/src/lib.rs index d6fd0dddd4..4114addc7e 100644 --- a/services/mgmt/chaos/src/lib.rs +++ b/services/mgmt/chaos/src/lib.rs @@ -3,14 +3,18 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] -#[cfg(feature = "package-preview-2023-04")] -pub mod package_preview_2023_04; -#[cfg(all(feature = "package-preview-2023-04", not(feature = "no-default-tag")))] -pub use package_preview_2023_04::*; -#[cfg(feature = "package-preview-2022-10")] -pub mod package_preview_2022_10; -#[cfg(all(feature = "package-preview-2022-10", not(feature = "no-default-tag")))] -pub use package_preview_2022_10::*; +#[cfg(feature = "package-2023-04-15-preview")] +pub mod package_2023_04_15_preview; +#[cfg(all(feature = "package-2023-04-15-preview", not(feature = "no-default-tag")))] +pub use package_2023_04_15_preview::*; +#[cfg(feature = "package-2023-04-01-preview")] +pub mod package_2023_04_01_preview; +#[cfg(all(feature = "package-2023-04-01-preview", not(feature = "no-default-tag")))] +pub use package_2023_04_01_preview::*; +#[cfg(feature = "package-2022-10-01-preview")] +pub mod package_2022_10_01_preview; +#[cfg(all(feature = "package-2022-10-01-preview", not(feature = "no-default-tag")))] +pub use package_2022_10_01_preview::*; #[cfg(feature = "package-2022-07-01-preview")] pub mod package_2022_07_01_preview; #[cfg(all(feature = "package-2022-07-01-preview", not(feature = "no-default-tag")))] diff --git a/services/mgmt/chaos/src/package_preview_2022_10/mod.rs b/services/mgmt/chaos/src/package_2022_10_01_preview/mod.rs similarity index 100% rename from services/mgmt/chaos/src/package_preview_2022_10/mod.rs rename to services/mgmt/chaos/src/package_2022_10_01_preview/mod.rs diff --git a/services/mgmt/chaos/src/package_preview_2022_10/models.rs b/services/mgmt/chaos/src/package_2022_10_01_preview/models.rs similarity index 100% rename from services/mgmt/chaos/src/package_preview_2022_10/models.rs rename to services/mgmt/chaos/src/package_2022_10_01_preview/models.rs diff --git a/services/mgmt/chaos/src/package_preview_2023_04/mod.rs b/services/mgmt/chaos/src/package_2023_04_01_preview/mod.rs similarity index 100% rename from services/mgmt/chaos/src/package_preview_2023_04/mod.rs rename to services/mgmt/chaos/src/package_2023_04_01_preview/mod.rs diff --git a/services/mgmt/chaos/src/package_preview_2023_04/models.rs b/services/mgmt/chaos/src/package_2023_04_01_preview/models.rs similarity index 96% rename from services/mgmt/chaos/src/package_preview_2023_04/models.rs rename to services/mgmt/chaos/src/package_2023_04_01_preview/models.rs index ccd49044c1..ec76954457 100644 --- a/services/mgmt/chaos/src/package_preview_2023_04/models.rs +++ b/services/mgmt/chaos/src/package_2023_04_01_preview/models.rs @@ -257,6 +257,29 @@ impl TrackedResource { } } } +#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User assigned identity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client ID of the assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Model that represents the base action model."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Action { @@ -475,9 +498,22 @@ pub struct CapabilityTypeProperties { #[doc = "String of the kind of this Capability Type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub kind: Option, - #[doc = "Array of control and data plane actions necessary to execute capability type."] - #[serde(rename = "permissionsNecessary", default, skip_serializing_if = "Option::is_none")] - pub permissions_necessary: Option, + #[doc = "Control plane actions necessary to execute capability type."] + #[serde( + rename = "azureRBACActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub azure_rbac_actions: Vec, + #[doc = "Data plane actions necessary to execute capability type."] + #[serde( + rename = "azureRBACDataActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub azure_rbac_data_actions: Vec, #[doc = "Runtime properties of this Capability Type."] #[serde(rename = "runtimeProperties", default, skip_serializing_if = "Option::is_none")] pub runtime_properties: Option, @@ -489,30 +525,6 @@ impl CapabilityTypeProperties { } pub mod capability_type_properties { use super::*; - #[doc = "Array of control and data plane actions necessary to execute capability type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct PermissionsNecessary { - #[doc = "Control plane actions necessary to execute capability type."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub actions: Vec, - #[doc = "Control plane actions necessary to execute capability type."] - #[serde( - rename = "dataActions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub data_actions: Vec, - } - impl PermissionsNecessary { - pub fn new() -> Self { - Self::default() - } - } #[doc = "Runtime properties of this Capability Type."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RuntimeProperties { @@ -894,7 +906,7 @@ pub struct ResourceIdentity { #[doc = "String of the resource identity type."] #[serde(rename = "type")] pub type_: resource_identity::Type, - #[doc = "The list of user identities associated with the experiment."] + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] pub user_assigned_identities: Option, #[doc = "GUID that represents the principal ID of this resource identity."] @@ -1266,11 +1278,3 @@ impl TargetTypeProperties { pub type Url = String; pub type UrlNullable = String; pub type Urn = String; -#[doc = "The list of user identities associated with the experiment."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UserAssignedIdentities {} -impl UserAssignedIdentities { - pub fn new() -> Self { - Self::default() - } -} diff --git a/services/mgmt/chaos/src/package_2023_04_15_preview/mod.rs b/services/mgmt/chaos/src/package_2023_04_15_preview/mod.rs new file mode 100644 index 0000000000..437300ce04 --- /dev/null +++ b/services/mgmt/chaos/src/package_2023_04_15_preview/mod.rs @@ -0,0 +1,3209 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn capabilities_client(&self) -> capabilities::Client { + capabilities::Client(self.clone()) + } + pub fn capability_types_client(&self) -> capability_types::Client { + capability_types::Client(self.clone()) + } + pub fn experiments_client(&self) -> experiments::Client { + experiments::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn target_types_client(&self) -> target_types::Client { + target_types::Client(self.clone()) + } + pub fn targets_client(&self) -> targets::Client { + targets::Client(self.clone()) + } +} +pub mod capabilities { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of Capability resources that extend a Target resource.."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + continuation_token: None, + } + } + #[doc = "Get a Capability resource that extends a Target resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + #[doc = "* `capability_name`: String that represents a Capability resource name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + capability_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + capability_name: capability_name.into(), + } + } + #[doc = "Create or update a Capability resource that extends a Target resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + #[doc = "* `capability_name`: String that represents a Capability resource name."] + #[doc = "* `capability`: Capability resource to be created or updated."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + capability_name: impl Into, + capability: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + capability_name: capability_name.into(), + capability: capability.into(), + } + } + #[doc = "Delete a Capability that extends a Target resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + #[doc = "* `capability_name`: String that represents a Capability resource name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + capability_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + capability_name: capability_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CapabilityListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + pub(crate) continuation_token: Option, + } + impl RequestBuilder { + #[doc = "String that sets the continuation token."] + pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}/capabilities", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut().query_pairs_mut().append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Capability = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + pub(crate) capability_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}/capabilities/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name, + &this.capability_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Capability = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + pub(crate) capability_name: String, + pub(crate) capability: models::Capability, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}/capabilities/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name, + &this.capability_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.capability)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + pub(crate) capability_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}/capabilities/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name, + &this.capability_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod capability_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of Capability Type resources for given Target Type and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `location_name`: String that represents a Location resource name."] + #[doc = "* `target_type_name`: String that represents a Target Type resource name."] + pub fn list( + &self, + subscription_id: impl Into, + location_name: impl Into, + target_type_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + target_type_name: target_type_name.into(), + continuation_token: None, + } + } + #[doc = "Get a Capability Type resource for given Target Type and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `location_name`: String that represents a Location resource name."] + #[doc = "* `target_type_name`: String that represents a Target Type resource name."] + #[doc = "* `capability_type_name`: String that represents a Capability Type resource name."] + pub fn get( + &self, + subscription_id: impl Into, + location_name: impl Into, + target_type_name: impl Into, + capability_type_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + target_type_name: target_type_name.into(), + capability_type_name: capability_type_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CapabilityTypeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + pub(crate) target_type_name: String, + pub(crate) continuation_token: Option, + } + impl RequestBuilder { + #[doc = "String that sets the continuation token."] + pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Chaos/locations/{}/targetTypes/{}/capabilityTypes", + this.client.endpoint(), + &this.subscription_id, + &this.location_name, + &this.target_type_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut().query_pairs_mut().append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CapabilityType = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + pub(crate) target_type_name: String, + pub(crate) capability_type_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Chaos/locations/{}/targetTypes/{}/capabilityTypes/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location_name, + &this.target_type_name, + &this.capability_type_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod experiments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of Experiment resources in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + pub fn list_all(&self, subscription_id: impl Into) -> list_all::RequestBuilder { + list_all::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + running: None, + continuation_token: None, + } + } + #[doc = "Get a list of Experiment resources in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + running: None, + continuation_token: None, + } + } + #[doc = "Get a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + } + } + #[doc = "Create or update a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + #[doc = "* `experiment`: Experiment resource to be created or updated."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + experiment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + experiment: experiment.into(), + } + } + #[doc = "The operation to update an experiment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + #[doc = "* `experiment`: Parameters supplied to the Update experiment operation."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + experiment: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + experiment: experiment.into(), + } + } + #[doc = "Delete a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + } + } + #[doc = "Cancel a running Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + pub fn cancel( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + ) -> cancel::RequestBuilder { + cancel::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + } + } + #[doc = "Start a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + pub fn start( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + ) -> start::RequestBuilder { + start::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + } + } + #[doc = "Get a list of statuses of a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + pub fn list_all_statuses( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + ) -> list_all_statuses::RequestBuilder { + list_all_statuses::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + } + } + #[doc = "Get a status of a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + #[doc = "* `status_id`: GUID that represents a Experiment status."] + pub fn get_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + status_id: impl Into, + ) -> get_status::RequestBuilder { + get_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + status_id: status_id.into(), + } + } + #[doc = "Get a list of execution details of a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + pub fn list_execution_details( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + ) -> list_execution_details::RequestBuilder { + list_execution_details::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + } + } + #[doc = "Get an execution detail of a Experiment resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `experiment_name`: String that represents a Experiment resource name."] + #[doc = "* `execution_details_id`: GUID that represents a Experiment execution detail."] + pub fn get_execution_details( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + experiment_name: impl Into, + execution_details_id: impl Into, + ) -> get_execution_details::RequestBuilder { + get_execution_details::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + experiment_name: experiment_name.into(), + execution_details_id: execution_details_id.into(), + } + } + } + pub mod list_all { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) running: Option, + pub(crate) continuation_token: Option, + } + impl RequestBuilder { + #[doc = "Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered."] + pub fn running(mut self, running: bool) -> Self { + self.running = Some(running); + self + } + #[doc = "String that sets the continuation token."] + pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Chaos/experiments", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + if let Some(running) = &this.running { + req.url_mut().query_pairs_mut().append_pair("running", &running.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut().query_pairs_mut().append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) running: Option, + pub(crate) continuation_token: Option, + } + impl RequestBuilder { + #[doc = "Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered."] + pub fn running(mut self, running: bool) -> Self { + self.running = Some(running); + self + } + #[doc = "String that sets the continuation token."] + pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + if let Some(running) = &this.running { + req.url_mut().query_pairs_mut().append_pair("running", &running.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut().query_pairs_mut().append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Experiment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Experiment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + pub(crate) experiment: models::Experiment, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.experiment)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Experiment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + pub(crate) experiment: models::ExperimentUpdate, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.experiment)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod cancel { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentCancelOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}/cancel", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod start { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentStartOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}/start", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_all_statuses { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentStatusListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}/statuses", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + pub(crate) status_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}/statuses/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name, + &this.status_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_execution_details { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentExecutionDetailsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}/executionDetails", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_execution_details { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExperimentExecutionDetails = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) experiment_name: String, + pub(crate) execution_details_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Chaos/experiments/{}/executionDetails/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.experiment_name, + &this.execution_details_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list all available Operations."] + pub fn list_all(&self) -> list_all::RequestBuilder { + list_all::RequestBuilder { client: self.0.clone() } + } + } + pub mod list_all { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!("{}/providers/Microsoft.Chaos/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod target_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of Target Type resources for given location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `location_name`: String that represents a Location resource name."] + pub fn list(&self, subscription_id: impl Into, location_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + continuation_token: None, + } + } + #[doc = "Get a Target Type resources for given location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `location_name`: String that represents a Location resource name."] + #[doc = "* `target_type_name`: String that represents a Target Type resource name."] + pub fn get( + &self, + subscription_id: impl Into, + location_name: impl Into, + target_type_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + target_type_name: target_type_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TargetTypeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + pub(crate) continuation_token: Option, + } + impl RequestBuilder { + #[doc = "String that sets the continuation token."] + pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Chaos/locations/{}/targetTypes", + this.client.endpoint(), + &this.subscription_id, + &this.location_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut().query_pairs_mut().append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TargetType = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + pub(crate) target_type_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Chaos/locations/{}/targetTypes/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location_name, + &this.target_type_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod targets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of Target resources that extend a tracked regional resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + continuation_token: None, + } + } + #[doc = "Get a Target resource that extends a tracked regional resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + } + } + #[doc = "Create or update a Target resource that extends a tracked regional resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + #[doc = "* `target`: Target resource to be created or updated."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + target: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + target: target.into(), + } + } + #[doc = "Delete a Target resource that extends a tracked regional resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: GUID that represents an Azure subscription ID."] + #[doc = "* `resource_group_name`: String that represents an Azure resource group."] + #[doc = "* `parent_provider_namespace`: String that represents a resource provider namespace."] + #[doc = "* `parent_resource_type`: String that represents a resource type."] + #[doc = "* `parent_resource_name`: String that represents a resource name."] + #[doc = "* `target_name`: String that represents a Target resource name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_provider_namespace: impl Into, + parent_resource_type: impl Into, + parent_resource_name: impl Into, + target_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_provider_namespace: parent_provider_namespace.into(), + parent_resource_type: parent_resource_type.into(), + parent_resource_name: parent_resource_name.into(), + target_name: target_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TargetListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) continuation_token: Option, + } + impl RequestBuilder { + #[doc = "String that sets the continuation token."] + pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { + self.continuation_token = Some(continuation_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut().query_pairs_mut().append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Target = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Target = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + pub(crate) target: models::Target, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.target)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_provider_namespace: String, + pub(crate) parent_resource_type: String, + pub(crate) parent_resource_name: String, + pub(crate) target_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Chaos/targets/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_provider_namespace, + &this.parent_resource_type, + &this.parent_resource_name, + &this.target_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} diff --git a/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs b/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs new file mode 100644 index 0000000000..20cef238a1 --- /dev/null +++ b/services/mgmt/chaos/src/package_2023_04_15_preview/models.rs @@ -0,0 +1,1280 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of a REST API operation, returned from the Resource Provider Operations API"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Localized display information for this particular operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[serde(rename = "actionType", default, skip_serializing_if = "Option::is_none")] + pub action_type: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Localized display information for this particular operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The short, localized friendly description of the operation; suitable for tool tips and detailed views."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(rename = "user,system")] + UserSystem, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UserSystem => serializer.serialize_unit_variant("Origin", 2u32, "user,system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + Internal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Internal => serializer.serialize_unit_variant("ActionType", 0u32, "Internal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of operations supported by the resource provider"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results (if there are any)."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User assigned identity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client ID of the assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the base action model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Action { + #[doc = "Enum that discriminates between action models."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "String that represents a URN."] + pub name: Urn, +} +impl Action { + pub fn new(type_: String, name: Urn) -> Self { + Self { type_, name } + } +} +#[doc = "Model that represents the an action and its status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ActionStatus { + #[doc = "The name of the action status."] + #[serde(rename = "actionName", default, skip_serializing_if = "Option::is_none")] + pub action_name: Option, + #[doc = "The id of the action status."] + #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] + pub action_id: Option, + #[doc = "The status of the action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "String that represents the start time of the action."] + #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] + pub start_time: Option, + #[doc = "String that represents the end time of the action."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "The array of targets."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub targets: Vec, +} +impl ActionStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a branch in the step."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Branch { + #[doc = "String of the branch name."] + pub name: String, + #[doc = "List of actions."] + pub actions: Vec, +} +impl Branch { + pub fn new(name: String, actions: Vec) -> Self { + Self { name, actions } + } +} +#[doc = "Model that represents the a list of actions and action statuses."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BranchStatus { + #[doc = "The name of the branch status."] + #[serde(rename = "branchName", default, skip_serializing_if = "Option::is_none")] + pub branch_name: Option, + #[doc = "The id of the branch status."] + #[serde(rename = "branchId", default, skip_serializing_if = "Option::is_none")] + pub branch_id: Option, + #[doc = "The status of the branch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The array of actions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub actions: Vec, +} +impl BranchStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a Capability resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Capability { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "Model that represents the Capability properties model."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Capability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a list of Capability resources and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilityListResult { + #[doc = "List of Capability resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CapabilityListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CapabilityListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Capability properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilityProperties { + #[doc = "String of the Publisher that this Capability extends."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "String of the Target Type that this Capability extends."] + #[serde(rename = "targetType", default, skip_serializing_if = "Option::is_none")] + pub target_type: Option, + #[doc = "Localized string of the description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "String that represents a URL."] + #[serde(rename = "parametersSchema", default, skip_serializing_if = "Option::is_none")] + pub parameters_schema: Option, + #[doc = "String that represents a URN."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub urn: Option, +} +impl CapabilityProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a Capability Type resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilityType { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "Location of the Capability Type resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Model that represents the Capability Type properties model."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CapabilityType { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a list of Capability Type resources and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilityTypeListResult { + #[doc = "List of Capability Type resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CapabilityTypeListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CapabilityTypeListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Capability Type properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilityTypeProperties { + #[doc = "String of the Publisher that this Capability Type extends."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "String of the Target Type that this Capability Type extends."] + #[serde(rename = "targetType", default, skip_serializing_if = "Option::is_none")] + pub target_type: Option, + #[doc = "Localized string of the display name."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Localized string of the description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "String that represents a URL."] + #[serde(rename = "parametersSchema", default, skip_serializing_if = "Option::is_none")] + pub parameters_schema: Option, + #[doc = "String that represents a URN."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub urn: Option, + #[doc = "String of the kind of this Capability Type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[doc = "Control plane actions necessary to execute capability type."] + #[serde( + rename = "azureRBACActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub azure_rbac_actions: Vec, + #[doc = "Data plane actions necessary to execute capability type."] + #[serde( + rename = "azureRBACDataActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub azure_rbac_data_actions: Vec, + #[doc = "Runtime properties of this Capability Type."] + #[serde(rename = "runtimeProperties", default, skip_serializing_if = "Option::is_none")] + pub runtime_properties: Option, +} +impl CapabilityTypeProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod capability_type_properties { + use super::*; + #[doc = "Runtime properties of this Capability Type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct RuntimeProperties { + #[doc = "String of the kind of the resource's action type (continuous or discrete)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + } + impl RuntimeProperties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Model that represents a Experiment resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Experiment { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The identity of a resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Model that represents the Experiment properties model."] + pub properties: ExperimentProperties, +} +impl Experiment { + pub fn new(tracked_resource: TrackedResource, properties: ExperimentProperties) -> Self { + Self { + tracked_resource, + system_data: None, + identity: None, + properties, + } + } +} +#[doc = "Model that represents the result of a cancel Experiment operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentCancelOperationResult { + #[doc = "String of the Experiment name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "String that represents a URL."] + #[serde(rename = "statusUrl", default, skip_serializing_if = "Option::is_none")] + pub status_url: Option, +} +impl ExperimentCancelOperationResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Experiment action target details error model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentExecutionActionTargetDetailsError { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl ExperimentExecutionActionTargetDetailsError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Experiment action target details properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentExecutionActionTargetDetailsProperties { + #[doc = "The status of the execution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The target for the action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "String that represents the failed date time."] + #[serde(rename = "targetFailedTime", default, with = "azure_core::date::rfc3339::option")] + pub target_failed_time: Option, + #[doc = "String that represents the completed date time."] + #[serde(rename = "targetCompletedTime", default, with = "azure_core::date::rfc3339::option")] + pub target_completed_time: Option, + #[doc = "Model that represents the Experiment action target details error model."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl ExperimentExecutionActionTargetDetailsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the execution details of a Experiment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentExecutionDetails { + #[doc = "String of the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "String of the fully qualified resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "String of the resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Model that represents the Experiment execution details properties model."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ExperimentExecutionDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a list of Experiment execution details and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentExecutionDetailsListResult { + #[doc = "List of Experiment execution details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExperimentExecutionDetailsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExperimentExecutionDetailsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Experiment execution details properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentExecutionDetailsProperties { + #[doc = "The id of the experiment."] + #[serde(rename = "experimentId", default, skip_serializing_if = "Option::is_none")] + pub experiment_id: Option, + #[doc = "The value of the status of the experiment execution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason why the execution failed."] + #[serde(rename = "failureReason", default, skip_serializing_if = "Option::is_none")] + pub failure_reason: Option, + #[doc = "String that represents the created date time."] + #[serde(rename = "createdDateTime", default, with = "azure_core::date::rfc3339::option")] + pub created_date_time: Option, + #[doc = "String that represents the last action date time."] + #[serde(rename = "lastActionDateTime", default, with = "azure_core::date::rfc3339::option")] + pub last_action_date_time: Option, + #[doc = "String that represents the start date time."] + #[serde(rename = "startDateTime", default, with = "azure_core::date::rfc3339::option")] + pub start_date_time: Option, + #[doc = "String that represents the stop date time."] + #[serde(rename = "stopDateTime", default, with = "azure_core::date::rfc3339::option")] + pub stop_date_time: Option, + #[doc = "The information of the experiment run."] + #[serde(rename = "runInformation", default, skip_serializing_if = "Option::is_none")] + pub run_information: Option, +} +impl ExperimentExecutionDetailsProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod experiment_execution_details_properties { + use super::*; + #[doc = "The information of the experiment run."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct RunInformation { + #[doc = "The steps of the experiment run."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub steps: Vec, + } + impl RunInformation { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Model that represents a list of Experiment resources and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentListResult { + #[doc = "List of Experiment resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExperimentListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExperimentListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Experiment properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExperimentProperties { + #[doc = "List of steps."] + pub steps: Vec, + #[doc = "List of selectors."] + pub selectors: Vec, + #[doc = "A boolean value that indicates if experiment should be started on creation or not."] + #[serde(rename = "startOnCreation", default, skip_serializing_if = "Option::is_none")] + pub start_on_creation: Option, +} +impl ExperimentProperties { + pub fn new(steps: Vec, selectors: Vec) -> Self { + Self { + steps, + selectors, + start_on_creation: None, + } + } +} +#[doc = "Model that represents the result of a start Experiment operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentStartOperationResult { + #[doc = "String of the Experiment name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "String that represents a URL."] + #[serde(rename = "statusUrl", default, skip_serializing_if = "Option::is_none")] + pub status_url: Option, +} +impl ExperimentStartOperationResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the status of a Experiment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentStatus { + #[doc = "String of the resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "String of the fully qualified resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "String of the resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Model that represents the Experiment status properties model."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ExperimentStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a list of Experiment statuses and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentStatusListResult { + #[doc = "List of Experiment statuses."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExperimentStatusListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExperimentStatusListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the Experiment status properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentStatusProperties { + #[doc = "String that represents the status of a Experiment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "String that represents the created date time of a Experiment."] + #[serde(rename = "createdDateUtc", default, with = "azure_core::date::rfc3339::option")] + pub created_date_utc: Option, + #[doc = "String that represents the end date time of a Experiment."] + #[serde(rename = "endDateUtc", default, with = "azure_core::date::rfc3339::option")] + pub end_date_utc: Option, +} +impl ExperimentStatusProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an experiment update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExperimentUpdate { + #[doc = "The identity of a resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl ExperimentUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents available filter types that can be applied to a targets list."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Filter { + #[doc = "Enum that discriminates between filter types. Currently only `Simple` type is supported."] + #[serde(rename = "type")] + pub type_: filter::Type, +} +impl Filter { + pub fn new(type_: filter::Type) -> Self { + Self { type_ } + } +} +pub mod filter { + use super::*; + #[doc = "Enum that discriminates between filter types. Currently only `Simple` type is supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Simple, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Simple => serializer.serialize_unit_variant("Type", 0u32, "Simple"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The identity of a resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceIdentity { + #[doc = "String of the resource identity type."] + #[serde(rename = "type")] + pub type_: resource_identity::Type, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, + #[doc = "GUID that represents the principal ID of this resource identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "GUID that represents the tenant ID of this resource identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl ResourceIdentity { + pub fn new(type_: resource_identity::Type) -> Self { + Self { + type_, + user_assigned_identities: None, + principal_id: None, + tenant_id: None, + } + } +} +pub mod resource_identity { + use super::*; + #[doc = "String of the resource identity type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Type { + None, + SystemAssigned, + UserAssigned, + } +} +#[doc = "Model that represents a selector in the Experiment resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Selector { + #[doc = "Enum of the selector type."] + #[serde(rename = "type")] + pub type_: selector::Type, + #[doc = "String of the selector ID."] + pub id: String, + #[doc = "Model that represents available filter types that can be applied to a targets list."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, +} +impl Selector { + pub fn new(type_: selector::Type, id: String) -> Self { + Self { type_, id, filter: None } + } +} +pub mod selector { + use super::*; + #[doc = "Enum of the selector type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + List, + Query, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::List => serializer.serialize_unit_variant("Type", 0u32, "List"), + Self::Query => serializer.serialize_unit_variant("Type", 1u32, "Query"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Model that represents a step in the Experiment resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Step { + #[doc = "String of the step name."] + pub name: String, + #[doc = "List of branches."] + pub branches: Vec, +} +impl Step { + pub fn new(name: String, branches: Vec) -> Self { + Self { name, branches } + } +} +#[doc = "Model that represents the a list of branches and branch statuses."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StepStatus { + #[doc = "The name of the step."] + #[serde(rename = "stepName", default, skip_serializing_if = "Option::is_none")] + pub step_name: Option, + #[doc = "The id of the step."] + #[serde(rename = "stepId", default, skip_serializing_if = "Option::is_none")] + pub step_id: Option, + #[doc = "The value of the status of the step."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The array of branches."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub branches: Vec, +} +impl StepStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Model that represents a Target resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Target { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "Location of the target resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Model that represents the base Target properties model."] + pub properties: TargetProperties, +} +impl Target { + pub fn new(properties: TargetProperties) -> Self { + Self { + resource: Resource::default(), + system_data: None, + location: None, + properties, + } + } +} +#[doc = "Model that represents a list of Target resources and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TargetListResult { + #[doc = "List of Target resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TargetListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TargetListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the base Target properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TargetProperties {} +impl TargetProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents a Target Type resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TargetType { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "Location of the Target Type resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Model that represents the base Target Type properties model."] + pub properties: TargetTypeProperties, +} +impl TargetType { + pub fn new(properties: TargetTypeProperties) -> Self { + Self { + resource: Resource::default(), + system_data: None, + location: None, + properties, + } + } +} +#[doc = "Model that represents a list of Target Type resources and a link for pagination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TargetTypeListResult { + #[doc = "List of Target Type resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Optional string that represents a URL."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TargetTypeListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TargetTypeListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Model that represents the base Target Type properties model."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TargetTypeProperties { + #[doc = "Localized string of the display name."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Localized string of the description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "String that represents a URL."] + #[serde(rename = "propertiesSchema", default, skip_serializing_if = "Option::is_none")] + pub properties_schema: Option, + #[doc = "List of resource types this Target Type can extend."] + #[serde( + rename = "resourceTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_types: Vec, +} +impl TargetTypeProperties { + pub fn new() -> Self { + Self::default() + } +} +pub type Url = String; +pub type UrlNullable = String; +pub type Urn = String; diff --git a/services/mgmt/compute/src/package_2022_09_04/models.rs b/services/mgmt/compute/src/package_2022_09_04/models.rs index d76f9e922f..cf3d3d1f72 100644 --- a/services/mgmt/compute/src/package_2022_09_04/models.rs +++ b/services/mgmt/compute/src/package_2022_09_04/models.rs @@ -1373,6 +1373,24 @@ impl CommunityGalleryImage { Self::default() } } +#[doc = "This is the community gallery image definition identifier."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CommunityGalleryImageIdentifier { + #[doc = "The name of the gallery image definition publisher."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "The name of the gallery image definition offer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub offer: Option, + #[doc = "The name of the gallery image definition SKU."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl CommunityGalleryImageIdentifier { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The List Community Gallery Images operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommunityGalleryImageList { @@ -1405,8 +1423,8 @@ pub struct CommunityGalleryImageProperties { #[doc = "The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable."] #[serde(rename = "endOfLifeDate", default, with = "azure_core::date::rfc3339::option")] pub end_of_life_date: Option, - #[doc = "This is the gallery image definition identifier."] - pub identifier: GalleryImageIdentifier, + #[doc = "This is the community gallery image definition identifier."] + pub identifier: CommunityGalleryImageIdentifier, #[doc = "The properties describe the recommended machine configuration for this Image Definition. These properties are updatable."] #[serde(default, skip_serializing_if = "Option::is_none")] pub recommended: Option, @@ -1440,7 +1458,7 @@ impl CommunityGalleryImageProperties { pub fn new( os_type: community_gallery_image_properties::OsType, os_state: community_gallery_image_properties::OsState, - identifier: GalleryImageIdentifier, + identifier: CommunityGalleryImageIdentifier, ) -> Self { Self { os_type, diff --git a/services/mgmt/compute/src/package_2022_11_01/models.rs b/services/mgmt/compute/src/package_2022_11_01/models.rs index bc4c259156..9f51e92712 100644 --- a/services/mgmt/compute/src/package_2022_11_01/models.rs +++ b/services/mgmt/compute/src/package_2022_11_01/models.rs @@ -1430,6 +1430,24 @@ impl CommunityGalleryImage { Self::default() } } +#[doc = "This is the community gallery image definition identifier."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CommunityGalleryImageIdentifier { + #[doc = "The name of the gallery image definition publisher."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "The name of the gallery image definition offer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub offer: Option, + #[doc = "The name of the gallery image definition SKU."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl CommunityGalleryImageIdentifier { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The List Community Gallery Images operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommunityGalleryImageList { @@ -1462,8 +1480,8 @@ pub struct CommunityGalleryImageProperties { #[doc = "The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable."] #[serde(rename = "endOfLifeDate", default, with = "azure_core::date::rfc3339::option")] pub end_of_life_date: Option, - #[doc = "This is the gallery image definition identifier."] - pub identifier: GalleryImageIdentifier, + #[doc = "This is the community gallery image definition identifier."] + pub identifier: CommunityGalleryImageIdentifier, #[doc = "The properties describe the recommended machine configuration for this Image Definition. These properties are updatable."] #[serde(default, skip_serializing_if = "Option::is_none")] pub recommended: Option, @@ -1497,7 +1515,7 @@ impl CommunityGalleryImageProperties { pub fn new( os_type: community_gallery_image_properties::OsType, os_state: community_gallery_image_properties::OsState, - identifier: GalleryImageIdentifier, + identifier: CommunityGalleryImageIdentifier, ) -> Self { Self { os_type, diff --git a/services/mgmt/compute/src/package_2023_03_01/models.rs b/services/mgmt/compute/src/package_2023_03_01/models.rs index d72336d2ab..1ed44fb9cf 100644 --- a/services/mgmt/compute/src/package_2023_03_01/models.rs +++ b/services/mgmt/compute/src/package_2023_03_01/models.rs @@ -1430,6 +1430,24 @@ impl CommunityGalleryImage { Self::default() } } +#[doc = "This is the community gallery image definition identifier."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CommunityGalleryImageIdentifier { + #[doc = "The name of the gallery image definition publisher."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "The name of the gallery image definition offer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub offer: Option, + #[doc = "The name of the gallery image definition SKU."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl CommunityGalleryImageIdentifier { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The List Community Gallery Images operation response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CommunityGalleryImageList { @@ -1462,8 +1480,8 @@ pub struct CommunityGalleryImageProperties { #[doc = "The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable."] #[serde(rename = "endOfLifeDate", default, with = "azure_core::date::rfc3339::option")] pub end_of_life_date: Option, - #[doc = "This is the gallery image definition identifier."] - pub identifier: GalleryImageIdentifier, + #[doc = "This is the community gallery image definition identifier."] + pub identifier: CommunityGalleryImageIdentifier, #[doc = "The properties describe the recommended machine configuration for this Image Definition. These properties are updatable."] #[serde(default, skip_serializing_if = "Option::is_none")] pub recommended: Option, @@ -1497,7 +1515,7 @@ impl CommunityGalleryImageProperties { pub fn new( os_type: community_gallery_image_properties::OsType, os_state: community_gallery_image_properties::OsState, - identifier: GalleryImageIdentifier, + identifier: CommunityGalleryImageIdentifier, ) -> Self { Self { os_type, diff --git a/services/mgmt/containerinstance/src/package_preview_2022_10/models.rs b/services/mgmt/containerinstance/src/package_preview_2022_10/models.rs index b47fd68902..01150119cd 100644 --- a/services/mgmt/containerinstance/src/package_preview_2022_10/models.rs +++ b/services/mgmt/containerinstance/src/package_preview_2022_10/models.rs @@ -872,6 +872,9 @@ pub struct ContainerProperties { #[doc = "The container probe, for liveness or readiness"] #[serde(rename = "readinessProbe", default, skip_serializing_if = "Option::is_none")] pub readiness_probe: Option, + #[doc = "The security context for the container."] + #[serde(rename = "securityContext", default, skip_serializing_if = "Option::is_none")] + pub security_context: Option, } impl ContainerProperties { pub fn new(image: String, resources: ResourceRequirements) -> Self { @@ -885,6 +888,7 @@ impl ContainerProperties { volume_mounts: Vec::new(), liveness_probe: None, readiness_probe: None, + security_context: None, } } } @@ -1251,6 +1255,9 @@ pub struct InitContainerPropertiesDefinition { skip_serializing_if = "Vec::is_empty" )] pub volume_mounts: Vec, + #[doc = "The security context for the container."] + #[serde(rename = "securityContext", default, skip_serializing_if = "Option::is_none")] + pub security_context: Option, } impl InitContainerPropertiesDefinition { pub fn new() -> Self { @@ -1751,6 +1758,56 @@ impl SecretVolume { Self::default() } } +#[doc = "The capabilities to add or drop from a container."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContextCapabilitiesDefinition { + #[doc = "The capabilities to add to the container."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub add: Vec, + #[doc = "The capabilities to drop from the container."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub drop: Vec, +} +impl SecurityContextCapabilitiesDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The security context for the container."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContextDefinition { + #[doc = "The flag to determine if the container permissions is elevated to Privileged."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub privileged: Option, + #[doc = "A boolean value indicating whether the init process can elevate its privileges"] + #[serde(rename = "allowPrivilegeEscalation", default, skip_serializing_if = "Option::is_none")] + pub allow_privilege_escalation: Option, + #[doc = "The capabilities to add or drop from a container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + #[doc = "Sets the User GID for the container."] + #[serde(rename = "runAsGroup", default, skip_serializing_if = "Option::is_none")] + pub run_as_group: Option, + #[doc = "Sets the User UID for the container."] + #[serde(rename = "runAsUser", default, skip_serializing_if = "Option::is_none")] + pub run_as_user: Option, + #[doc = "a base64 encoded string containing the contents of the JSON in the seccomp profile"] + #[serde(rename = "seccompProfile", default, skip_serializing_if = "Option::is_none")] + pub seccomp_profile: Option, +} +impl SecurityContextDefinition { + pub fn new() -> Self { + Self::default() + } +} #[doc = "A single usage result"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Usage { diff --git a/services/mgmt/containerinstance/src/package_preview_2023_02/models.rs b/services/mgmt/containerinstance/src/package_preview_2023_02/models.rs index bd193e5574..5359978a96 100644 --- a/services/mgmt/containerinstance/src/package_preview_2023_02/models.rs +++ b/services/mgmt/containerinstance/src/package_preview_2023_02/models.rs @@ -858,6 +858,9 @@ pub struct ContainerProperties { #[doc = "The container probe, for liveness or readiness"] #[serde(rename = "readinessProbe", default, skip_serializing_if = "Option::is_none")] pub readiness_probe: Option, + #[doc = "The security context for the container."] + #[serde(rename = "securityContext", default, skip_serializing_if = "Option::is_none")] + pub security_context: Option, } impl ContainerProperties { pub fn new(image: String, resources: ResourceRequirements) -> Self { @@ -871,6 +874,7 @@ impl ContainerProperties { volume_mounts: Vec::new(), liveness_probe: None, readiness_probe: None, + security_context: None, } } } @@ -1737,6 +1741,56 @@ impl SecretVolume { Self::default() } } +#[doc = "The capabilities to add or drop from a container."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContextCapabilitiesDefinition { + #[doc = "The capabilities to add to the container."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub add: Vec, + #[doc = "The capabilities to drop from the container."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub drop: Vec, +} +impl SecurityContextCapabilitiesDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The security context for the container."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContextDefinition { + #[doc = "The flag to determine if the container permissions is elevated to Privileged."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub privileged: Option, + #[doc = "A boolean value indicating whether the init process can elevate its privileges"] + #[serde(rename = "allowPrivilegeEscalation", default, skip_serializing_if = "Option::is_none")] + pub allow_privilege_escalation: Option, + #[doc = "The capabilities to add or drop from a container."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + #[doc = "Sets the User GID for the container."] + #[serde(rename = "runAsGroup", default, skip_serializing_if = "Option::is_none")] + pub run_as_group: Option, + #[doc = "Sets the User UID for the container."] + #[serde(rename = "runAsUser", default, skip_serializing_if = "Option::is_none")] + pub run_as_user: Option, + #[doc = "a base64 encoded string containing the contents of the JSON in the seccomp profile"] + #[serde(rename = "seccompProfile", default, skip_serializing_if = "Option::is_none")] + pub seccomp_profile: Option, +} +impl SecurityContextDefinition { + pub fn new() -> Self { + Self::default() + } +} #[doc = "A single usage result"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Usage { diff --git a/services/mgmt/cosmosdb/Cargo.toml b/services/mgmt/cosmosdb/Cargo.toml index f9b80fcb87..b7c59b393e 100644 --- a/services/mgmt/cosmosdb/Cargo.toml +++ b/services/mgmt/cosmosdb/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-03", "enable_reqwest"] +default = ["package-preview-2023-03-15", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-03-15" = [] "package-preview-2023-03" = [] "package-preview-2022-11" = [] "package-preview-2022-08" = [] -"package-preview-2022-05" = [] -"package-preview-2022-02" = [] \ No newline at end of file +"package-preview-2022-05" = [] \ No newline at end of file diff --git a/services/mgmt/cosmosdb/README.md b/services/mgmt/cosmosdb/README.md index 6ca78f69dd..2ae6f49117 100644 --- a/services/mgmt/cosmosdb/README.md +++ b/services/mgmt/cosmosdb/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cosmos-db/ To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-03`. +The default tag is `package-preview-2023-03-15`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-03-15` has 234 operations from 1 API versions: `2023-03-15-preview`. Use crate feature `package-preview-2023-03-15` to enable. The operations will be in the `package_preview_2023_03_15` module. - `package-preview-2023-03` has 232 operations from 1 API versions: `2023-03-01-preview`. Use crate feature `package-preview-2023-03` to enable. The operations will be in the `package_preview_2023_03` module. - `package-preview-2022-11` has 220 operations from 1 API versions: `2022-11-15-preview`. Use crate feature `package-preview-2022-11` to enable. The operations will be in the `package_preview_2022_11` module. - `package-preview-2022-08` has 220 operations from 1 API versions: `2022-08-15-preview`. Use crate feature `package-preview-2022-08` to enable. The operations will be in the `package_preview_2022_08` module. -- `package-preview-2022-05` has 216 operations from 1 API versions: `2022-05-15-preview`. Use crate feature `package-preview-2022-05` to enable. The operations will be in the `package_preview_2022_05` module. -- `package-preview-2022-02` has 216 operations from 1 API versions: `2022-02-15-preview`. Use crate feature `package-preview-2022-02` to enable. The operations will be in the `package_preview_2022_02` module. \ No newline at end of file +- `package-preview-2022-05` has 216 operations from 1 API versions: `2022-05-15-preview`. Use crate feature `package-preview-2022-05` to enable. The operations will be in the `package_preview_2022_05` module. \ No newline at end of file diff --git a/services/mgmt/cosmosdb/src/lib.rs b/services/mgmt/cosmosdb/src/lib.rs index 6e1e303d81..e36b72233c 100644 --- a/services/mgmt/cosmosdb/src/lib.rs +++ b/services/mgmt/cosmosdb/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-03-15")] +pub mod package_preview_2023_03_15; +#[cfg(all(feature = "package-preview-2023-03-15", not(feature = "no-default-tag")))] +pub use package_preview_2023_03_15::*; #[cfg(feature = "package-preview-2023-03")] pub mod package_preview_2023_03; #[cfg(all(feature = "package-preview-2023-03", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_preview_2022_08::*; pub mod package_preview_2022_05; #[cfg(all(feature = "package-preview-2022-05", not(feature = "no-default-tag")))] pub use package_preview_2022_05::*; -#[cfg(feature = "package-preview-2022-02")] -pub mod package_preview_2022_02; -#[cfg(all(feature = "package-preview-2022-02", not(feature = "no-default-tag")))] -pub use package_preview_2022_02::*; diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs b/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs index bd74014013..fb7993ac28 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2022_08/models.rs @@ -4656,10 +4656,7 @@ pub mod mongo_role_definition_resource { use super::*; #[doc = "Indicates whether the Role Definition was built-in or user created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - BuiltInRole, - CustomRole, - } + pub enum Type {} } #[doc = "Parameters to create and update an Azure Cosmos DB Mongo User Definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs b/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs index 30a0fccd81..893ef4457b 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2022_11/models.rs @@ -4711,10 +4711,7 @@ pub mod mongo_role_definition_resource { use super::*; #[doc = "Indicates whether the Role Definition was built-in or user created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - BuiltInRole, - CustomRole, - } + pub enum Type {} } #[doc = "Parameters to create and update an Azure Cosmos DB Mongo User Definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] diff --git a/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs b/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs index 89bb5acdad..9c0b62712e 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2023_03/models.rs @@ -5152,10 +5152,7 @@ pub mod mongo_role_definition_resource { use super::*; #[doc = "Indicates whether the Role Definition was built-in or user created."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - BuiltInRole, - CustomRole, - } + pub enum Type {} } #[doc = "Parameters to create and update an Azure Cosmos DB Mongo User Definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_02/mod.rs b/services/mgmt/cosmosdb/src/package_preview_2023_03_15/mod.rs similarity index 91% rename from services/mgmt/cosmosdb/src/package_preview_2022_02/mod.rs rename to services/mgmt/cosmosdb/src/package_preview_2023_03_15/mod.rs index 3dc3af3031..49380106b3 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_02/mod.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2023_03_15/mod.rs @@ -145,6 +145,9 @@ impl Client { pub fn locations_client(&self) -> locations::Client { locations::Client(self.clone()) } + pub fn mongo_clusters_client(&self) -> mongo_clusters::Client { + mongo_clusters::Client(self.clone()) + } pub fn mongo_db_resources_client(&self) -> mongo_db_resources::Client { mongo_db_resources::Client(self.clone()) } @@ -641,7 +644,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -736,7 +739,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_parameters)?; req.set_body(req_body); @@ -832,7 +835,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_parameters)?; req.set_body(req_body); @@ -904,7 +907,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -958,7 +961,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.failover_parameters)?; req.set_body(req_body); @@ -1037,7 +1040,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1117,7 +1120,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1198,7 +1201,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -1286,7 +1289,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -1359,7 +1362,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.region_parameter_for_offline)?; req.set_body(req_body); @@ -1420,7 +1423,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.region_parameter_for_online)?; req.set_body(req_body); @@ -1502,7 +1505,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1595,7 +1598,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -1668,7 +1671,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.key_to_regenerate)?; req.set_body(req_body); @@ -1723,7 +1726,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1806,7 +1809,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -1896,7 +1899,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -1981,7 +1984,7 @@ pub mod database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2067,7 +2070,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2083,7 +2086,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2255,7 +2258,7 @@ pub mod database { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -2347,7 +2350,7 @@ pub mod database { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -2427,7 +2430,7 @@ pub mod database { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2591,7 +2594,7 @@ pub mod collection { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -2677,7 +2680,7 @@ pub mod collection { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -2758,7 +2761,7 @@ pub mod collection { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2875,7 +2878,7 @@ pub mod collection_region { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -2993,7 +2996,7 @@ pub mod database_account_region { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3108,7 +3111,7 @@ pub mod percentile_source_target { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3219,7 +3222,7 @@ pub mod percentile_target { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3332,7 +3335,7 @@ pub mod percentile { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3451,7 +3454,7 @@ pub mod collection_partition_region { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3592,7 +3595,7 @@ pub mod collection_partition { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3678,7 +3681,7 @@ pub mod collection_partition { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -3798,7 +3801,7 @@ pub mod partition_key_range_id { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -3921,7 +3924,7 @@ pub mod partition_key_range_id_region { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let filter = &this.filter; req.url_mut().query_pairs_mut().append_pair("$filter", filter); let req_body = azure_core::EMPTY_BODY; @@ -4099,7 +4102,7 @@ pub mod graph_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4182,7 +4185,7 @@ pub mod graph_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4256,7 +4259,7 @@ pub mod graph_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_graph_parameters)?; req.set_body(req_body); @@ -4318,7 +4321,7 @@ pub mod graph_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4686,6 +4689,31 @@ pub mod sql_resources { container_name: container_name.into(), } } + #[doc = "Merges the partitions of a SQL database"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `account_name`: Cosmos DB database account name."] + #[doc = "* `database_name`: Cosmos DB database name."] + #[doc = "* `merge_parameters`: The parameters for the merge operation."] + pub fn sql_database_partition_merge( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + account_name: impl Into, + database_name: impl Into, + merge_parameters: impl Into, + ) -> sql_database_partition_merge::RequestBuilder { + sql_database_partition_merge::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + account_name: account_name.into(), + database_name: database_name.into(), + merge_parameters: merge_parameters.into(), + } + } #[doc = "Merges the partitions of a SQL Container"] #[doc = ""] #[doc = "Arguments:"] @@ -4817,6 +4845,56 @@ pub mod sql_resources { container_name: container_name.into(), } } + #[doc = "Retrieve throughput distribution for an Azure Cosmos DB SQL database"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `account_name`: Cosmos DB database account name."] + #[doc = "* `database_name`: Cosmos DB database name."] + #[doc = "* `retrieve_throughput_parameters`: The parameters to provide for retrieving throughput distribution for the current SQL database."] + pub fn sql_database_retrieve_throughput_distribution( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + account_name: impl Into, + database_name: impl Into, + retrieve_throughput_parameters: impl Into, + ) -> sql_database_retrieve_throughput_distribution::RequestBuilder { + sql_database_retrieve_throughput_distribution::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + account_name: account_name.into(), + database_name: database_name.into(), + retrieve_throughput_parameters: retrieve_throughput_parameters.into(), + } + } + #[doc = "Redistribute throughput for an Azure Cosmos DB SQL database"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `account_name`: Cosmos DB database account name."] + #[doc = "* `database_name`: Cosmos DB database name."] + #[doc = "* `redistribute_throughput_parameters`: The parameters to provide for redistributing throughput for the current SQL database."] + pub fn sql_database_redistribute_throughput( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + account_name: impl Into, + database_name: impl Into, + redistribute_throughput_parameters: impl Into, + ) -> sql_database_redistribute_throughput::RequestBuilder { + sql_database_redistribute_throughput::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + account_name: account_name.into(), + database_name: database_name.into(), + redistribute_throughput_parameters: redistribute_throughput_parameters.into(), + } + } #[doc = "Retrieve throughput distribution for an Azure Cosmos DB SQL container"] #[doc = ""] #[doc = "Arguments:"] @@ -5487,7 +5565,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5570,7 +5648,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5644,7 +5722,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_database_parameters)?; req.set_body(req_body); @@ -5706,7 +5784,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5782,7 +5860,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5849,7 +5927,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -5904,7 +5982,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -5959,7 +6037,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -6037,7 +6115,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6114,7 +6192,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6182,7 +6260,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_client_encryption_key_parameters)?; req.set_body(req_body); @@ -6260,7 +6338,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6337,7 +6415,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6405,7 +6483,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_container_parameters)?; req.set_body(req_body); @@ -6461,7 +6539,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6470,6 +6548,62 @@ pub mod sql_resources { } } } + pub mod sql_database_partition_merge { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) account_name: String, + pub(crate) database_name: String, + pub(crate) merge_parameters: models::MergeParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/databaseAccounts/{}/sqlDatabases/{}/partitionMerge" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . account_name , & this . database_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.merge_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } pub mod list_sql_container_partition_merge { use super::models; pub struct Response(azure_core::Response); @@ -6517,7 +6651,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.merge_parameters)?; req.set_body(req_body); @@ -6595,7 +6729,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6663,7 +6797,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -6719,7 +6853,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -6775,7 +6909,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -6785,6 +6919,118 @@ pub mod sql_resources { } } } + pub mod sql_database_retrieve_throughput_distribution { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) account_name: String, + pub(crate) database_name: String, + pub(crate) retrieve_throughput_parameters: models::RetrieveThroughputParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/databaseAccounts/{}/sqlDatabases/{}/throughputSettings/default/retrieveThroughputDistribution" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . account_name , & this . database_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.retrieve_throughput_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod sql_database_redistribute_throughput { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) account_name: String, + pub(crate) database_name: String, + pub(crate) redistribute_throughput_parameters: models::RedistributeThroughputParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/databaseAccounts/{}/sqlDatabases/{}/throughputSettings/default/redistributeThroughput" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . account_name , & this . database_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.redistribute_throughput_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } pub mod sql_container_retrieve_throughput_distribution { use super::models; pub struct Response(azure_core::Response); @@ -6832,7 +7078,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.retrieve_throughput_parameters)?; req.set_body(req_body); @@ -6889,7 +7135,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.redistribute_throughput_parameters)?; req.set_body(req_body); @@ -6968,7 +7214,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7046,7 +7292,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7115,7 +7361,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_stored_procedure_parameters)?; req.set_body(req_body); @@ -7172,7 +7418,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7250,7 +7496,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7328,7 +7574,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7397,7 +7643,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_user_defined_function_parameters)?; req.set_body(req_body); @@ -7454,7 +7700,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7532,7 +7778,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7610,7 +7856,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7679,7 +7925,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_trigger_parameters)?; req.set_body(req_body); @@ -7736,7 +7982,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7812,7 +8058,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7902,7 +8148,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_role_definition_parameters)?; req.set_body(req_body); @@ -7969,7 +8215,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8051,7 +8297,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8127,7 +8373,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8217,7 +8463,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_sql_role_assignment_parameters)?; req.set_body(req_body); @@ -8284,7 +8530,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8366,7 +8612,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8445,7 +8691,7 @@ pub mod sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.location)?; req.set_body(req_body); @@ -8651,85 +8897,85 @@ pub mod mongo_db_resources { database_name: database_name.into(), } } - #[doc = "Retrieve throughput distribution for an Azure Cosmos DB MongoDB container"] + #[doc = "Retrieve throughput distribution for an Azure Cosmos DB MongoDB database"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `account_name`: Cosmos DB database account name."] #[doc = "* `database_name`: Cosmos DB database name."] - #[doc = "* `collection_name`: Cosmos DB collection name."] - #[doc = "* `retrieve_throughput_parameters`: The parameters to provide for retrieving throughput distribution for the current MongoDB container."] - pub fn mongo_db_container_retrieve_throughput_distribution( + #[doc = "* `retrieve_throughput_parameters`: The parameters to provide for retrieving throughput distribution for the current MongoDB database."] + pub fn mongo_db_database_retrieve_throughput_distribution( &self, subscription_id: impl Into, resource_group_name: impl Into, account_name: impl Into, database_name: impl Into, - collection_name: impl Into, retrieve_throughput_parameters: impl Into, - ) -> mongo_db_container_retrieve_throughput_distribution::RequestBuilder { - mongo_db_container_retrieve_throughput_distribution::RequestBuilder { + ) -> mongo_db_database_retrieve_throughput_distribution::RequestBuilder { + mongo_db_database_retrieve_throughput_distribution::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), account_name: account_name.into(), database_name: database_name.into(), - collection_name: collection_name.into(), retrieve_throughput_parameters: retrieve_throughput_parameters.into(), } } - #[doc = "Redistribute throughput for an Azure Cosmos DB MongoDB container"] + #[doc = "Redistribute throughput for an Azure Cosmos DB MongoDB database"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `account_name`: Cosmos DB database account name."] #[doc = "* `database_name`: Cosmos DB database name."] - #[doc = "* `collection_name`: Cosmos DB collection name."] - #[doc = "* `redistribute_throughput_parameters`: The parameters to provide for redistributing throughput for the current MongoDB container."] - pub fn mongo_db_container_redistribute_throughput( + #[doc = "* `redistribute_throughput_parameters`: The parameters to provide for redistributing throughput for the current MongoDB database."] + pub fn mongo_db_database_redistribute_throughput( &self, subscription_id: impl Into, resource_group_name: impl Into, account_name: impl Into, database_name: impl Into, - collection_name: impl Into, redistribute_throughput_parameters: impl Into, - ) -> mongo_db_container_redistribute_throughput::RequestBuilder { - mongo_db_container_redistribute_throughput::RequestBuilder { + ) -> mongo_db_database_redistribute_throughput::RequestBuilder { + mongo_db_database_redistribute_throughput::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), account_name: account_name.into(), database_name: database_name.into(), - collection_name: collection_name.into(), redistribute_throughput_parameters: redistribute_throughput_parameters.into(), } } - #[doc = "Lists the MongoDB collection under an existing Azure Cosmos DB database account."] + #[doc = "Retrieve throughput distribution for an Azure Cosmos DB MongoDB container"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `account_name`: Cosmos DB database account name."] #[doc = "* `database_name`: Cosmos DB database name."] - pub fn list_mongo_db_collections( + #[doc = "* `collection_name`: Cosmos DB collection name."] + #[doc = "* `retrieve_throughput_parameters`: The parameters to provide for retrieving throughput distribution for the current MongoDB container."] + pub fn mongo_db_container_retrieve_throughput_distribution( &self, subscription_id: impl Into, resource_group_name: impl Into, account_name: impl Into, database_name: impl Into, - ) -> list_mongo_db_collections::RequestBuilder { - list_mongo_db_collections::RequestBuilder { + collection_name: impl Into, + retrieve_throughput_parameters: impl Into, + ) -> mongo_db_container_retrieve_throughput_distribution::RequestBuilder { + mongo_db_container_retrieve_throughput_distribution::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), account_name: account_name.into(), database_name: database_name.into(), + collection_name: collection_name.into(), + retrieve_throughput_parameters: retrieve_throughput_parameters.into(), } } - #[doc = "Gets the MongoDB collection under an existing Azure Cosmos DB database account."] + #[doc = "Redistribute throughput for an Azure Cosmos DB MongoDB container"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -8737,7 +8983,57 @@ pub mod mongo_db_resources { #[doc = "* `account_name`: Cosmos DB database account name."] #[doc = "* `database_name`: Cosmos DB database name."] #[doc = "* `collection_name`: Cosmos DB collection name."] - pub fn get_mongo_db_collection( + #[doc = "* `redistribute_throughput_parameters`: The parameters to provide for redistributing throughput for the current MongoDB container."] + pub fn mongo_db_container_redistribute_throughput( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + account_name: impl Into, + database_name: impl Into, + collection_name: impl Into, + redistribute_throughput_parameters: impl Into, + ) -> mongo_db_container_redistribute_throughput::RequestBuilder { + mongo_db_container_redistribute_throughput::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + account_name: account_name.into(), + database_name: database_name.into(), + collection_name: collection_name.into(), + redistribute_throughput_parameters: redistribute_throughput_parameters.into(), + } + } + #[doc = "Lists the MongoDB collection under an existing Azure Cosmos DB database account."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `account_name`: Cosmos DB database account name."] + #[doc = "* `database_name`: Cosmos DB database name."] + pub fn list_mongo_db_collections( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + account_name: impl Into, + database_name: impl Into, + ) -> list_mongo_db_collections::RequestBuilder { + list_mongo_db_collections::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + account_name: account_name.into(), + database_name: database_name.into(), + } + } + #[doc = "Gets the MongoDB collection under an existing Azure Cosmos DB database account."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `account_name`: Cosmos DB database account name."] + #[doc = "* `database_name`: Cosmos DB database name."] + #[doc = "* `collection_name`: Cosmos DB collection name."] + pub fn get_mongo_db_collection( &self, subscription_id: impl Into, resource_group_name: impl Into, @@ -8807,6 +9103,31 @@ pub mod mongo_db_resources { collection_name: collection_name.into(), } } + #[doc = "Merges the partitions of a MongoDB database"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `account_name`: Cosmos DB database account name."] + #[doc = "* `database_name`: Cosmos DB database name."] + #[doc = "* `merge_parameters`: The parameters for the merge operation."] + pub fn mongo_db_database_partition_merge( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + account_name: impl Into, + database_name: impl Into, + merge_parameters: impl Into, + ) -> mongo_db_database_partition_merge::RequestBuilder { + mongo_db_database_partition_merge::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + account_name: account_name.into(), + database_name: database_name.into(), + merge_parameters: merge_parameters.into(), + } + } #[doc = "Merges the partitions of a MongoDB Collection"] #[doc = ""] #[doc = "Arguments:"] @@ -9216,7 +9537,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9299,7 +9620,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9373,7 +9694,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_mongo_db_database_parameters)?; req.set_body(req_body); @@ -9435,7 +9756,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9511,7 +9832,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9578,7 +9899,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -9633,7 +9954,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -9688,7 +10009,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -9698,6 +10019,118 @@ pub mod mongo_db_resources { } } } + pub mod mongo_db_database_retrieve_throughput_distribution { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) account_name: String, + pub(crate) database_name: String, + pub(crate) retrieve_throughput_parameters: models::RetrieveThroughputParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/databaseAccounts/{}/mongodbDatabases/{}/throughputSettings/default/retrieveThroughputDistribution" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . account_name , & this . database_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.retrieve_throughput_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod mongo_db_database_redistribute_throughput { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) account_name: String, + pub(crate) database_name: String, + pub(crate) redistribute_throughput_parameters: models::RedistributeThroughputParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/databaseAccounts/{}/mongodbDatabases/{}/throughputSettings/default/redistributeThroughput" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . account_name , & this . database_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.redistribute_throughput_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } pub mod mongo_db_container_retrieve_throughput_distribution { use super::models; pub struct Response(azure_core::Response); @@ -9745,7 +10178,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.retrieve_throughput_parameters)?; req.set_body(req_body); @@ -9802,7 +10235,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.redistribute_throughput_parameters)?; req.set_body(req_body); @@ -9880,7 +10313,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9957,7 +10390,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10025,7 +10458,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_mongo_db_collection_parameters)?; req.set_body(req_body); @@ -10081,7 +10514,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10090,6 +10523,62 @@ pub mod mongo_db_resources { } } } + pub mod mongo_db_database_partition_merge { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) account_name: String, + pub(crate) database_name: String, + pub(crate) merge_parameters: models::MergeParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/databaseAccounts/{}/mongodbDatabases/{}/partitionMerge" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . account_name , & this . database_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.merge_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } pub mod list_mongo_db_collection_partition_merge { use super::models; pub struct Response(azure_core::Response); @@ -10137,7 +10626,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.merge_parameters)?; req.set_body(req_body); @@ -10215,7 +10704,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10283,7 +10772,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -10339,7 +10828,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -10395,7 +10884,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -10472,7 +10961,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10562,7 +11051,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_mongo_role_definition_parameters)?; req.set_body(req_body); @@ -10629,7 +11118,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10705,7 +11194,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10781,7 +11270,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10871,7 +11360,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_mongo_user_definition_parameters)?; req.set_body(req_body); @@ -10938,7 +11427,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11014,7 +11503,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11093,7 +11582,7 @@ pub mod mongo_db_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.location)?; req.set_body(req_body); @@ -11398,7 +11887,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11481,7 +11970,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11555,7 +12044,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_table_parameters)?; req.set_body(req_body); @@ -11617,7 +12106,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11693,7 +12182,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11760,7 +12249,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -11815,7 +12304,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -11870,7 +12359,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -11949,7 +12438,7 @@ pub mod table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.location)?; req.set_body(req_body); @@ -12635,7 +13124,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12711,7 +13200,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12778,7 +13267,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_cassandra_keyspace_parameters)?; req.set_body(req_body); @@ -12833,7 +13322,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12909,7 +13398,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12976,7 +13465,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -13031,7 +13520,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -13086,7 +13575,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -13164,7 +13653,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13241,7 +13730,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13309,7 +13798,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_cassandra_table_parameters)?; req.set_body(req_body); @@ -13365,7 +13854,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13442,7 +13931,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13510,7 +13999,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -13566,7 +14055,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -13622,7 +14111,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -13700,7 +14189,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13777,7 +14266,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13845,7 +14334,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_cassandra_view_parameters)?; req.set_body(req_body); @@ -13901,7 +14390,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -13978,7 +14467,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -14046,7 +14535,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -14102,7 +14591,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -14158,7 +14647,7 @@ pub mod cassandra_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -14657,7 +15146,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -14740,7 +15229,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -14814,7 +15303,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_gremlin_database_parameters)?; req.set_body(req_body); @@ -14876,7 +15365,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -14952,7 +15441,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15019,7 +15508,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -15074,7 +15563,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -15129,7 +15618,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -15207,7 +15696,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15284,7 +15773,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15352,7 +15841,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_gremlin_graph_parameters)?; req.set_body(req_body); @@ -15408,7 +15897,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15485,7 +15974,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15553,7 +16042,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.update_throughput_parameters)?; req.set_body(req_body); @@ -15609,7 +16098,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -15665,7 +16154,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -15745,7 +16234,7 @@ pub mod gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.location)?; req.set_body(req_body); @@ -15864,7 +16353,7 @@ pub mod locations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -15943,7 +16432,7 @@ pub mod locations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -16124,7 +16613,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -16200,7 +16689,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -16290,7 +16779,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -16357,7 +16846,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -16577,7 +17066,7 @@ pub mod data_transfer_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -16673,7 +17162,7 @@ pub mod data_transfer_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.job_create_parameters)?; req.set_body(req_body); @@ -16762,7 +17251,7 @@ pub mod data_transfer_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -16851,7 +17340,7 @@ pub mod data_transfer_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -16940,7 +17429,7 @@ pub mod data_transfer_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -17037,7 +17526,7 @@ pub mod data_transfer_jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -17053,7 +17542,7 @@ pub mod data_transfer_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -17376,7 +17865,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -17456,7 +17945,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -17537,7 +18026,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -17632,7 +18121,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -17728,7 +18217,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -17800,7 +18289,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -17883,7 +18372,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -17978,7 +18467,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18061,7 +18550,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18132,7 +18621,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -18192,7 +18681,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -18274,7 +18763,7 @@ pub mod cassandra_clusters { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18487,7 +18976,7 @@ pub mod cassandra_data_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18570,7 +19059,7 @@ pub mod cassandra_data_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18667,7 +19156,7 @@ pub mod cassandra_data_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -18765,7 +19254,7 @@ pub mod cassandra_data_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -18839,7 +19328,7 @@ pub mod cassandra_data_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -18849,6 +19338,1367 @@ pub mod cassandra_data_centers { } } } +pub mod mongo_clusters { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the mongo clusters in a given subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List all the mongo clusters in a given resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Gets information about a mongo cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + } + } + #[doc = "Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + #[doc = "* `parameters`: The required parameters for creating or updating a mongo cluster."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + #[doc = "* `parameters`: The parameters for updating a mongo cluster."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a mongo cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + } + } + #[doc = "Gets information about a mongo cluster firewall rule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + #[doc = "* `firewall_rule_name`: The name of the mongo cluster firewall rule."] + pub fn get_firewall_rule( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + firewall_rule_name: impl Into, + ) -> get_firewall_rule::RequestBuilder { + get_firewall_rule::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + firewall_rule_name: firewall_rule_name.into(), + } + } + #[doc = "Creates a new firewall rule or updates an existing firewall rule on a mongo cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + #[doc = "* `firewall_rule_name`: The name of the mongo cluster firewall rule."] + #[doc = "* `parameters`: The required parameters for creating or updating a firewall rule."] + pub fn create_or_update_firewall_rule( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + firewall_rule_name: impl Into, + parameters: impl Into, + ) -> create_or_update_firewall_rule::RequestBuilder { + create_or_update_firewall_rule::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + firewall_rule_name: firewall_rule_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a mongo cluster firewall rule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + #[doc = "* `firewall_rule_name`: The name of the mongo cluster firewall rule."] + pub fn delete_firewall_rule( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + firewall_rule_name: impl Into, + ) -> delete_firewall_rule::RequestBuilder { + delete_firewall_rule::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + firewall_rule_name: firewall_rule_name.into(), + } + } + #[doc = "List all the firewall rules in a given mongo cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + pub fn list_firewall_rules( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + ) -> list_firewall_rules::RequestBuilder { + list_firewall_rules::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + } + } + #[doc = "Check the availability of name for resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `location`: The name of the Azure region."] + #[doc = "* `parameters`: The required parameters for checking if resource name is available."] + pub fn check_name_availability( + &self, + subscription_id: impl Into, + location: impl Into, + parameters: impl Into, + ) -> check_name_availability::RequestBuilder { + check_name_availability::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + parameters: parameters.into(), + } + } + #[doc = "List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `mongo_cluster_name`: The name of the mongo cluster."] + pub fn list_connection_strings( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + mongo_cluster_name: impl Into, + ) -> list_connection_strings::RequestBuilder { + list_connection_strings::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + mongo_cluster_name: mongo_cluster_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MongoClusterListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DocumentDB/mongoClusters", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MongoClusterListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MongoCluster = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MongoCluster = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + pub(crate) parameters: models::MongoCluster, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MongoCluster = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + pub(crate) parameters: models::MongoClusterUpdate, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_firewall_rule { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirewallRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + pub(crate) firewall_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name, + &this.firewall_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update_firewall_rule { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirewallRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + pub(crate) firewall_rule_name: String, + pub(crate) parameters: models::FirewallRule, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name, + &this.firewall_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_firewall_rule { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + pub(crate) firewall_rule_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name, + &this.firewall_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_firewall_rules { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirewallRuleListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}/firewallRules", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod check_name_availability { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) parameters: models::CheckNameAvailabilityRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DocumentDB/locations/{}/checkMongoClusterNameAvailability", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_connection_strings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ListConnectionStringsResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) mongo_cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DocumentDB/mongoClusters/{}/listConnectionStrings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.mongo_cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} pub mod notebook_workspaces { use super::models; pub struct Client(pub(crate) super::Client); @@ -19081,7 +20931,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19157,7 +21007,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19247,7 +21097,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.notebook_create_update_parameters)?; req.set_body(req_body); @@ -19314,7 +21164,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19390,7 +21240,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -19457,7 +21307,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -19512,7 +21362,7 @@ pub mod notebook_workspaces { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -19642,7 +21492,7 @@ pub mod private_link_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19718,7 +21568,7 @@ pub mod private_link_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19861,7 +21711,7 @@ pub mod restorable_database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -19939,7 +21789,7 @@ pub mod restorable_database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -20020,7 +21870,7 @@ pub mod restorable_database_accounts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -20133,7 +21983,7 @@ pub mod restorable_sql_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -20255,7 +22105,7 @@ pub mod restorable_sql_containers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restorable_sql_database_rid) = &this.restorable_sql_database_rid { req.url_mut() .query_pairs_mut() @@ -20381,7 +22231,7 @@ pub mod restorable_sql_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restore_location) = &this.restore_location { req.url_mut().query_pairs_mut().append_pair("restoreLocation", restore_location); } @@ -20490,7 +22340,7 @@ pub mod restorable_mongodb_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -20612,7 +22462,7 @@ pub mod restorable_mongodb_collections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restorable_mongodb_database_rid) = &this.restorable_mongodb_database_rid { req.url_mut() .query_pairs_mut() @@ -20738,7 +22588,7 @@ pub mod restorable_mongodb_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restore_location) = &this.restore_location { req.url_mut().query_pairs_mut().append_pair("restoreLocation", restore_location); } @@ -20847,7 +22697,7 @@ pub mod restorable_gremlin_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -20969,7 +22819,7 @@ pub mod restorable_gremlin_graphs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restorable_gremlin_database_rid) = &this.restorable_gremlin_database_rid { req.url_mut() .query_pairs_mut() @@ -21095,7 +22945,7 @@ pub mod restorable_gremlin_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restore_location) = &this.restore_location { req.url_mut().query_pairs_mut().append_pair("restoreLocation", restore_location); } @@ -21218,7 +23068,7 @@ pub mod restorable_tables { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(start_time) = &this.start_time { req.url_mut().query_pairs_mut().append_pair("startTime", start_time); } @@ -21339,7 +23189,7 @@ pub mod restorable_table_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(restore_location) = &this.restore_location { req.url_mut().query_pairs_mut().append_pair("restoreLocation", restore_location); } @@ -21523,7 +23373,7 @@ pub mod service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -21606,7 +23456,7 @@ pub mod service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -21703,7 +23553,7 @@ pub mod service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.create_update_parameters)?; req.set_body(req_body); @@ -21777,7 +23627,7 @@ pub mod service { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-02-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) diff --git a/services/mgmt/cosmosdb/src/package_preview_2022_02/models.rs b/services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs similarity index 87% rename from services/mgmt/cosmosdb/src/package_preview_2022_02/models.rs rename to services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs index dce222ee2a..a2d9226c25 100644 --- a/services/mgmt/cosmosdb/src/package_preview_2022_02/models.rs +++ b/services/mgmt/cosmosdb/src/package_preview_2023_03_15/models.rs @@ -48,6 +48,18 @@ impl ArmResourceProperties { Self::default() } } +#[doc = "The metadata related to an access key for a given database account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AccountKeyMetadata { + #[doc = "Generation time in UTC of the key in ISO-8601 format. If the value is missing from the object, it means that the last key regeneration was triggered before 2022-06-18."] + #[serde(rename = "generationTime", default, with = "azure_core::date::rfc3339::option")] + pub generation_time: Option, +} +impl AccountKeyMetadata { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Analytical storage specific properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AnalyticalStorageConfiguration { @@ -230,6 +242,9 @@ pub struct AuthenticationMethodLdapProperties { skip_serializing_if = "Vec::is_empty" )] pub server_certificates: Vec, + #[doc = "Timeout for connecting to the LDAP server in miliseconds. The default is 5000 ms."] + #[serde(rename = "connectionTimeoutInMs", default, skip_serializing_if = "Option::is_none")] + pub connection_timeout_in_ms: Option, } impl AuthenticationMethodLdapProperties { pub fn new() -> Self { @@ -531,6 +546,13 @@ pub struct CassandraClusterPublicStatus { skip_serializing_if = "Vec::is_empty" )] pub connection_errors: Vec, + #[doc = "List relevant information about any errors about cluster, data center and connection error."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, #[doc = "List of the status of each datacenter in this cluster."] #[serde( rename = "dataCenters", @@ -545,6 +567,26 @@ impl CassandraClusterPublicStatus { Self::default() } } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CassandraError { + #[doc = "The code of error that occurred."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The message of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The target resource of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "Additional information about the error."] + #[serde(rename = "additionalErrorInfo", default, skip_serializing_if = "Option::is_none")] + pub additional_error_info: Option, +} +impl CassandraError { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Parameters to create and update Cosmos DB Cassandra keyspace."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CassandraKeyspaceCreateUpdateParameters { @@ -887,6 +929,79 @@ impl Certificate { Self::default() } } +#[doc = "The check availability request body."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityRequest { + #[doc = "The name of the resource for which availability needs to be checked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl CheckNameAvailabilityRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The check availability result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityResponse { + #[doc = "Indicates if the resource name is available."] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "The reason why the given name is not available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Detailed reason why the given name is available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl CheckNameAvailabilityResponse { + pub fn new() -> Self { + Self::default() + } +} +pub mod check_name_availability_response { + use super::*; + #[doc = "The reason why the given name is not available."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Reason")] + pub enum Reason { + Invalid, + AlreadyExists, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Reason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Reason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Reason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Invalid => serializer.serialize_unit_variant("Reason", 0u32, "Invalid"), + Self::AlreadyExists => serializer.serialize_unit_variant("Reason", 1u32, "AlreadyExists"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ClientEncryptionIncludedPath { @@ -1008,15 +1123,15 @@ pub struct ClientEncryptionPolicy { #[doc = "Paths of the item that need encryption along with path-specific settings."] #[serde(rename = "includedPaths")] pub included_paths: Vec, - #[doc = "Version of the client encryption policy definition. Please note, user passed value is ignored. Default policy version is 1."] - #[serde(rename = "policyFormatVersion", default, skip_serializing_if = "Option::is_none")] - pub policy_format_version: Option, + #[doc = "Version of the client encryption policy definition. Supported versions are 1 and 2. Version 2 supports id and partition key path encryption. "] + #[serde(rename = "policyFormatVersion")] + pub policy_format_version: i32, } impl ClientEncryptionPolicy { - pub fn new(included_paths: Vec) -> Self { + pub fn new(included_paths: Vec, policy_format_version: i32) -> Self { Self { included_paths, - policy_format_version: None, + policy_format_version, } } } @@ -1087,7 +1202,7 @@ pub mod cluster_resource { #[doc = "If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set the value to use on this property."] #[serde(rename = "clusterNameOverride", default, skip_serializing_if = "Option::is_none")] pub cluster_name_override: Option, - #[doc = "Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. 'Ldap' is in preview."] + #[doc = "Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'."] #[serde(rename = "authenticationMethod", default, skip_serializing_if = "Option::is_none")] pub authentication_method: Option, #[doc = "Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'."] @@ -1138,7 +1253,7 @@ pub mod cluster_resource { skip_serializing_if = "Vec::is_empty" )] pub seed_nodes: Vec, - #[doc = "Number of hours to wait between taking a backup of the cluster."] + #[doc = "(Deprecated) Number of hours to wait between taking a backup of the cluster."] #[serde(rename = "hoursBetweenBackups", default, skip_serializing_if = "Option::is_none")] pub hours_between_backups: Option, #[doc = "Whether the cluster and associated data centers has been deallocated."] @@ -1147,6 +1262,8 @@ pub mod cluster_resource { #[doc = "Whether Cassandra audit logging is enabled"] #[serde(rename = "cassandraAuditLoggingEnabled", default, skip_serializing_if = "Option::is_none")] pub cassandra_audit_logging_enabled: Option, + #[serde(rename = "provisionError", default, skip_serializing_if = "Option::is_none")] + pub provision_error: Option, } impl Properties { pub fn new() -> Self { @@ -1155,7 +1272,7 @@ pub mod cluster_resource { } pub mod properties { use super::*; - #[doc = "Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. 'Ldap' is in preview."] + #[doc = "Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AuthenticationMethod")] pub enum AuthenticationMethod { @@ -1450,6 +1567,21 @@ pub mod connection_error { } } } +#[doc = "Connection string for the mongo cluster"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectionString { + #[doc = "Value of the connection string"] + #[serde(rename = "connectionString", default, skip_serializing_if = "Option::is_none")] + pub connection_string: Option, + #[doc = "Description of the connection string"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl ConnectionString { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The cassandra connector offer type for the Cosmos DB C* database account."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ConnectorOffer")] @@ -1732,6 +1864,25 @@ impl CosmosCassandraDataTransferDataSourceSink { } #[doc = "A CosmosDB Cassandra API data source/sink"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CosmosMongoDataTransferDataSourceSink { + #[serde(flatten)] + pub data_transfer_data_source_sink: DataTransferDataSourceSink, + #[serde(rename = "databaseName")] + pub database_name: String, + #[serde(rename = "collectionName")] + pub collection_name: String, +} +impl CosmosMongoDataTransferDataSourceSink { + pub fn new(data_transfer_data_source_sink: DataTransferDataSourceSink, database_name: String, collection_name: String) -> Self { + Self { + data_transfer_data_source_sink, + database_name, + collection_name, + } + } +} +#[doc = "A CosmosDB Cassandra API data source/sink"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CosmosSqlDataTransferDataSourceSink { #[serde(flatten)] pub data_transfer_data_source_sink: DataTransferDataSourceSink, @@ -1875,15 +2026,20 @@ pub mod data_center_resource { #[doc = "Disk SKU used for data centers. Default value is P30."] #[serde(rename = "diskSku", default, skip_serializing_if = "Option::is_none")] pub disk_sku: Option, - #[doc = "Number of disk used for data centers. Default value is 4."] + #[doc = "Number of disks attached to each node. Default is 4."] #[serde(rename = "diskCapacity", default, skip_serializing_if = "Option::is_none")] pub disk_capacity: Option, - #[doc = "If the data center has Availability Zone feature, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines."] + #[doc = "If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines."] #[serde(rename = "availabilityZone", default, skip_serializing_if = "Option::is_none")] pub availability_zone: Option, #[doc = "Ldap authentication method properties. This feature is in preview."] #[serde(rename = "authenticationMethodLdapProperties", default, skip_serializing_if = "Option::is_none")] pub authentication_method_ldap_properties: Option, + #[doc = "Whether the data center has been deallocated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deallocated: Option, + #[serde(rename = "provisionError", default, skip_serializing_if = "Option::is_none")] + pub provision_error: Option, } impl Properties { pub fn new() -> Self { @@ -1908,6 +2064,8 @@ pub mod data_transfer_data_source_sink { pub enum Component { #[serde(rename = "CosmosDBCassandra")] CosmosDbCassandra, + #[serde(rename = "CosmosDBMongo")] + CosmosDbMongo, #[serde(rename = "CosmosDBSql")] CosmosDbSql, AzureBlobStorage, @@ -1937,8 +2095,9 @@ pub mod data_transfer_data_source_sink { { match self { Self::CosmosDbCassandra => serializer.serialize_unit_variant("Component", 0u32, "CosmosDBCassandra"), - Self::CosmosDbSql => serializer.serialize_unit_variant("Component", 1u32, "CosmosDBSql"), - Self::AzureBlobStorage => serializer.serialize_unit_variant("Component", 2u32, "AzureBlobStorage"), + Self::CosmosDbMongo => serializer.serialize_unit_variant("Component", 1u32, "CosmosDBMongo"), + Self::CosmosDbSql => serializer.serialize_unit_variant("Component", 2u32, "CosmosDBSql"), + Self::AzureBlobStorage => serializer.serialize_unit_variant("Component", 3u32, "AzureBlobStorage"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -2085,12 +2244,114 @@ pub struct DatabaseAccountConnectionString { #[doc = "Description of the connection string"] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, + #[doc = "Kind of the connection string key"] + #[serde(rename = "keyKind", default, skip_serializing_if = "Option::is_none")] + pub key_kind: Option, + #[doc = "Type of the connection string"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, } impl DatabaseAccountConnectionString { pub fn new() -> Self { Self::default() } } +pub mod database_account_connection_string { + use super::*; + #[doc = "Kind of the connection string key"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "KeyKind")] + pub enum KeyKind { + Primary, + Secondary, + PrimaryReadonly, + SecondaryReadonly, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for KeyKind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for KeyKind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for KeyKind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Primary => serializer.serialize_unit_variant("KeyKind", 0u32, "Primary"), + Self::Secondary => serializer.serialize_unit_variant("KeyKind", 1u32, "Secondary"), + Self::PrimaryReadonly => serializer.serialize_unit_variant("KeyKind", 2u32, "PrimaryReadonly"), + Self::SecondaryReadonly => serializer.serialize_unit_variant("KeyKind", 3u32, "SecondaryReadonly"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Type of the connection string"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Sql, + Table, + #[serde(rename = "MongoDB")] + MongoDb, + Cassandra, + CassandraConnectorMetadata, + Gremlin, + SqlDedicatedGateway, + GremlinV2, + Undefined, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Sql => serializer.serialize_unit_variant("Type", 0u32, "Sql"), + Self::Table => serializer.serialize_unit_variant("Type", 1u32, "Table"), + Self::MongoDb => serializer.serialize_unit_variant("Type", 2u32, "MongoDB"), + Self::Cassandra => serializer.serialize_unit_variant("Type", 3u32, "Cassandra"), + Self::CassandraConnectorMetadata => serializer.serialize_unit_variant("Type", 4u32, "CassandraConnectorMetadata"), + Self::Gremlin => serializer.serialize_unit_variant("Type", 5u32, "Gremlin"), + Self::SqlDedicatedGateway => serializer.serialize_unit_variant("Type", 6u32, "SqlDedicatedGateway"), + Self::GremlinV2 => serializer.serialize_unit_variant("Type", 7u32, "GremlinV2"), + Self::Undefined => serializer.serialize_unit_variant("Type", 8u32, "Undefined"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "Parameters to create and update Cosmos DB database accounts."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DatabaseAccountCreateUpdateParameters { @@ -2270,6 +2531,18 @@ pub struct DatabaseAccountCreateUpdateProperties { #[doc = "Flag to indicate whether to enable MaterializedViews on the Cosmos DB account"] #[serde(rename = "enableMaterializedViews", default, skip_serializing_if = "Option::is_none")] pub enable_materialized_views: Option, + #[doc = "The metadata related to each access key for the given Cosmos DB database account."] + #[serde(rename = "keysMetadata", default, skip_serializing_if = "Option::is_none")] + pub keys_metadata: Option, + #[doc = "Flag to indicate enabling/disabling of Partition Merge feature on the account"] + #[serde(rename = "enablePartitionMerge", default, skip_serializing_if = "Option::is_none")] + pub enable_partition_merge: Option, + #[doc = "Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account"] + #[serde(rename = "enableBurstCapacity", default, skip_serializing_if = "Option::is_none")] + pub enable_burst_capacity: Option, + #[doc = "Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2."] + #[serde(rename = "minimalTlsVersion", default, skip_serializing_if = "Option::is_none")] + pub minimal_tls_version: Option, } impl DatabaseAccountCreateUpdateProperties { pub fn new(locations: Vec, database_account_offer_type: DatabaseAccountOfferType) -> Self { @@ -2303,6 +2576,10 @@ impl DatabaseAccountCreateUpdateProperties { restore_parameters: None, capacity: None, enable_materialized_views: None, + keys_metadata: None, + enable_partition_merge: None, + enable_burst_capacity: None, + minimal_tls_version: None, } } } @@ -2458,6 +2735,18 @@ pub struct DatabaseAccountGetProperties { #[doc = "Flag to indicate whether to enable MaterializedViews on the Cosmos DB account"] #[serde(rename = "enableMaterializedViews", default, skip_serializing_if = "Option::is_none")] pub enable_materialized_views: Option, + #[doc = "The metadata related to each access key for the given Cosmos DB database account."] + #[serde(rename = "keysMetadata", default, skip_serializing_if = "Option::is_none")] + pub keys_metadata: Option, + #[doc = "Flag to indicate enabling/disabling of Partition Merge feature on the account"] + #[serde(rename = "enablePartitionMerge", default, skip_serializing_if = "Option::is_none")] + pub enable_partition_merge: Option, + #[doc = "Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account"] + #[serde(rename = "enableBurstCapacity", default, skip_serializing_if = "Option::is_none")] + pub enable_burst_capacity: Option, + #[doc = "Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2."] + #[serde(rename = "minimalTlsVersion", default, skip_serializing_if = "Option::is_none")] + pub minimal_tls_version: Option, } impl DatabaseAccountGetProperties { pub fn new() -> Self { @@ -2536,6 +2825,27 @@ pub mod database_account_get_results { } } } +#[doc = "The metadata related to each access key for the given Cosmos DB database account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DatabaseAccountKeysMetadata { + #[doc = "The metadata related to an access key for a given database account."] + #[serde(rename = "primaryMasterKey", default, skip_serializing_if = "Option::is_none")] + pub primary_master_key: Option, + #[doc = "The metadata related to an access key for a given database account."] + #[serde(rename = "secondaryMasterKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_master_key: Option, + #[doc = "The metadata related to an access key for a given database account."] + #[serde(rename = "primaryReadonlyMasterKey", default, skip_serializing_if = "Option::is_none")] + pub primary_readonly_master_key: Option, + #[doc = "The metadata related to an access key for a given database account."] + #[serde(rename = "secondaryReadonlyMasterKey", default, skip_serializing_if = "Option::is_none")] + pub secondary_readonly_master_key: Option, +} +impl DatabaseAccountKeysMetadata { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The connection strings for the given database account."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DatabaseAccountListConnectionStringsResult { @@ -2773,6 +3083,18 @@ pub struct DatabaseAccountUpdateProperties { #[doc = "Flag to indicate whether to enable MaterializedViews on the Cosmos DB account"] #[serde(rename = "enableMaterializedViews", default, skip_serializing_if = "Option::is_none")] pub enable_materialized_views: Option, + #[doc = "The metadata related to each access key for the given Cosmos DB database account."] + #[serde(rename = "keysMetadata", default, skip_serializing_if = "Option::is_none")] + pub keys_metadata: Option, + #[doc = "Flag to indicate enabling/disabling of Partition Merge feature on the account"] + #[serde(rename = "enablePartitionMerge", default, skip_serializing_if = "Option::is_none")] + pub enable_partition_merge: Option, + #[doc = "Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account"] + #[serde(rename = "enableBurstCapacity", default, skip_serializing_if = "Option::is_none")] + pub enable_burst_capacity: Option, + #[doc = "Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2."] + #[serde(rename = "minimalTlsVersion", default, skip_serializing_if = "Option::is_none")] + pub minimal_tls_version: Option, } impl DatabaseAccountUpdateProperties { pub fn new() -> Self { @@ -2843,6 +3165,54 @@ pub mod diagnostic_log_settings { False, } } +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Error Response."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorResponse { @@ -2923,6 +3293,69 @@ impl FailoverPolicy { Self::default() } } +#[doc = "Represents a mongo cluster firewall rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FirewallRule { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of a mongo cluster firewall rule."] + pub properties: FirewallRuleProperties, +} +impl FirewallRule { + pub fn new(properties: FirewallRuleProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + } + } +} +#[doc = "A list of firewall rules."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FirewallRuleListResult { + #[doc = "The list of firewall rules in a mongo cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for FirewallRuleListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl FirewallRuleListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a mongo cluster firewall rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FirewallRuleProperties { + #[doc = "The provisioning state of the resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The start IP address of the mongo cluster firewall rule. Must be IPv4 format."] + #[serde(rename = "startIpAddress")] + pub start_ip_address: String, + #[doc = "The end IP address of the mongo cluster firewall rule. Must be IPv4 format."] + #[serde(rename = "endIpAddress")] + pub end_ip_address: String, +} +impl FirewallRuleProperties { + pub fn new(start_ip_address: String, end_ip_address: String) -> Self { + Self { + provisioning_state: None, + start_ip_address, + end_ip_address, + } + } +} #[doc = "Resource for a regional service location."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct GraphApiComputeRegionalServiceResource { @@ -3149,10 +3582,20 @@ impl GremlinDatabaseListResult { pub struct GremlinDatabaseResource { #[doc = "Name of the Cosmos DB Gremlin database"] pub id: String, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, } impl GremlinDatabaseResource { pub fn new(id: String) -> Self { - Self { id } + Self { + id, + restore_parameters: None, + create_mode: None, + } } } #[doc = "Specific Gremlin Databases to restore."] @@ -3274,6 +3717,15 @@ pub struct GremlinGraphResource { #[doc = "The conflict resolution policy for the container."] #[serde(rename = "conflictResolutionPolicy", default, skip_serializing_if = "Option::is_none")] pub conflict_resolution_policy: Option, + #[doc = "Analytical TTL."] + #[serde(rename = "analyticalStorageTtl", default, skip_serializing_if = "Option::is_none")] + pub analytical_storage_ttl: Option, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, } impl GremlinGraphResource { pub fn new(id: String) -> Self { @@ -3284,6 +3736,9 @@ impl GremlinGraphResource { default_ttl: None, unique_key_policy: None, conflict_resolution_policy: None, + analytical_storage_ttl: None, + restore_parameters: None, + create_mode: None, } } } @@ -3597,6 +4052,23 @@ impl ListClusters { Self::default() } } +#[doc = "The connection strings for the given mongo cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListConnectionStringsResult { + #[doc = "An array that contains the connection strings for a mongo cluster."] + #[serde( + rename = "connectionStrings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub connection_strings: Vec, +} +impl ListConnectionStringsResult { + pub fn new() -> Self { + Self::default() + } +} #[doc = "List of managed Cassandra data centers and their properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ListDataCenters { @@ -3685,9 +4157,6 @@ impl LocationListResult { #[doc = "Cosmos DB location metadata"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct LocationProperties { - #[doc = "The current status of location in Azure."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, #[doc = "Flag indicating whether the location supports availability zones or not."] #[serde(rename = "supportsAvailabilityZone", default, skip_serializing_if = "Option::is_none")] pub supports_availability_zone: Option, @@ -3702,12 +4171,75 @@ pub struct LocationProperties { skip_serializing_if = "Vec::is_empty" )] pub backup_storage_redundancies: Vec, + #[doc = "Flag indicating whether the subscription have access in region for Non-Availability Zones."] + #[serde( + rename = "isSubscriptionRegionAccessAllowedForRegular", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_subscription_region_access_allowed_for_regular: Option, + #[doc = "Flag indicating whether the subscription have access in region for Availability Zones(Az)."] + #[serde( + rename = "isSubscriptionRegionAccessAllowedForAz", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_subscription_region_access_allowed_for_az: Option, + #[doc = "Enum to indicate current buildout status of the region."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, } impl LocationProperties { pub fn new() -> Self { Self::default() } } +pub mod location_properties { + use super::*; + #[doc = "Enum to indicate current buildout status of the region."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Uninitialized, + Initializing, + InternallyReady, + Online, + Deleting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Uninitialized => serializer.serialize_unit_variant("Status", 0u32, "Uninitialized"), + Self::Initializing => serializer.serialize_unit_variant("Status", 1u32, "Initializing"), + Self::InternallyReady => serializer.serialize_unit_variant("Status", 2u32, "InternallyReady"), + Self::Online => serializer.serialize_unit_variant("Status", 3u32, "Online"), + Self::Deleting => serializer.serialize_unit_variant("Status", 4u32, "Deleting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "The core properties of ARM resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ManagedCassandraArmResourceProperties { @@ -3965,6 +4497,27 @@ pub mod managed_service_identity { None, } } +#[doc = "Materialized View definition for the container."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MaterializedViewDefinition { + #[doc = "An unique identifier for the source collection. This is a system generated property."] + #[serde(rename = "sourceCollectionRid", default, skip_serializing_if = "Option::is_none")] + pub source_collection_rid: Option, + #[doc = "The name of the source container on which the Materialized View will be created."] + #[serde(rename = "sourceCollectionId")] + pub source_collection_id: String, + #[doc = "The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container."] + pub definition: String, +} +impl MaterializedViewDefinition { + pub fn new(source_collection_id: String, definition: String) -> Self { + Self { + source_collection_rid: None, + source_collection_id, + definition, + } + } +} #[doc = "Resource for a regional service location."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MaterializedViewsBuilderRegionalServiceResource { @@ -4189,44 +4742,286 @@ impl MetricListResult { Self::default() } } -#[doc = "A metric name."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MetricName { - #[doc = "The name of the metric."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The friendly name of the metric."] - #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] - pub localized_value: Option, -} -impl MetricName { - pub fn new() -> Self { - Self::default() +#[doc = "A metric name."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MetricName { + #[doc = "The name of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The friendly name of the metric."] + #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] + pub localized_value: Option, +} +impl MetricName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents metrics values."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MetricValue { + #[doc = "The number of values for the metric."] + #[serde(rename = "_count", default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "The average value of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub average: Option, + #[doc = "The max value of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub maximum: Option, + #[doc = "The min value of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub minimum: Option, + #[doc = "The metric timestamp (ISO-8601 format)."] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub timestamp: Option, + #[doc = "The total value of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option, +} +impl MetricValue { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MinimalTlsVersion")] +pub enum MinimalTlsVersion { + Tls, + Tls11, + Tls12, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MinimalTlsVersion { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MinimalTlsVersion { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MinimalTlsVersion { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Tls => serializer.serialize_unit_variant("MinimalTlsVersion", 0u32, "Tls"), + Self::Tls11 => serializer.serialize_unit_variant("MinimalTlsVersion", 1u32, "Tls11"), + Self::Tls12 => serializer.serialize_unit_variant("MinimalTlsVersion", 2u32, "Tls12"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Represents a mongo cluster resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MongoCluster { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "The properties of a mongo cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MongoCluster { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + } + } +} +#[doc = "A list of mongo clusters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MongoClusterListResult { + #[doc = "The list of mongo clusters"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for MongoClusterListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl MongoClusterListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a mongo cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MongoClusterProperties { + #[doc = "The mode to create a mongo cluster."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, + #[doc = "Parameters used for restore operations"] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "The administrator's login for the mongo cluster."] + #[serde(rename = "administratorLogin", default, skip_serializing_if = "Option::is_none")] + pub administrator_login: Option, + #[doc = "The password of the administrator login."] + #[serde(rename = "administratorLoginPassword", default, skip_serializing_if = "Option::is_none")] + pub administrator_login_password: Option, + #[doc = "The Mongo DB server version. Defaults to the latest available version if not specified."] + #[serde(rename = "serverVersion", default, skip_serializing_if = "Option::is_none")] + pub server_version: Option, + #[doc = "The default mongo connection string for the cluster."] + #[serde(rename = "connectionString", default, skip_serializing_if = "Option::is_none")] + pub connection_string: Option, + #[doc = "Earliest restore timestamp in UTC ISO8601 format."] + #[serde(rename = "earliestRestoreTime", default, skip_serializing_if = "Option::is_none")] + pub earliest_restore_time: Option, + #[doc = "The provisioning state of the resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The status of the resource at the time the operation was called."] + #[serde(rename = "clusterStatus", default, skip_serializing_if = "Option::is_none")] + pub cluster_status: Option, + #[doc = "The list of node group specifications for the cluster. Must include one node group spec with kind = 'Shard'."] + #[serde(rename = "nodeGroupSpecs", default, skip_serializing_if = "Option::is_none")] + pub node_group_specs: Option, +} +impl MongoClusterProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod mongo_cluster_properties { + use super::*; + #[doc = "The mode to create a mongo cluster."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreateMode")] + pub enum CreateMode { + Default, + PointInTimeRestore, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreateMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreateMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreateMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("CreateMode", 0u32, "Default"), + Self::PointInTimeRestore => serializer.serialize_unit_variant("CreateMode", 1u32, "PointInTimeRestore"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for CreateMode { + fn default() -> Self { + Self::Default + } + } +} +#[doc = "Parameters used for restore operations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MongoClusterRestoreParameters { + #[doc = "UTC point in time to restore a mongo cluster"] + #[serde(rename = "pointInTimeUTC", default, with = "azure_core::date::rfc3339::option")] + pub point_in_time_utc: Option, + #[doc = "Resource ID to locate the source cluster to restore"] + #[serde(rename = "sourceResourceId", default, skip_serializing_if = "Option::is_none")] + pub source_resource_id: Option, +} +impl MongoClusterRestoreParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The status of the resource at the time the operation was called."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MongoClusterStatus")] +pub enum MongoClusterStatus { + Ready, + Provisioning, + Updating, + Starting, + Stopping, + Stopped, + Dropping, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MongoClusterStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MongoClusterStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MongoClusterStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Ready => serializer.serialize_unit_variant("MongoClusterStatus", 0u32, "Ready"), + Self::Provisioning => serializer.serialize_unit_variant("MongoClusterStatus", 1u32, "Provisioning"), + Self::Updating => serializer.serialize_unit_variant("MongoClusterStatus", 2u32, "Updating"), + Self::Starting => serializer.serialize_unit_variant("MongoClusterStatus", 3u32, "Starting"), + Self::Stopping => serializer.serialize_unit_variant("MongoClusterStatus", 4u32, "Stopping"), + Self::Stopped => serializer.serialize_unit_variant("MongoClusterStatus", 5u32, "Stopped"), + Self::Dropping => serializer.serialize_unit_variant("MongoClusterStatus", 6u32, "Dropping"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } -#[doc = "Represents metrics values."] +#[doc = "Represents a mongo cluster resource for updates."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MetricValue { - #[doc = "The number of values for the metric."] - #[serde(rename = "_count", default, skip_serializing_if = "Option::is_none")] - pub count: Option, - #[doc = "The average value of the metric."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub average: Option, - #[doc = "The max value of the metric."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub maximum: Option, - #[doc = "The min value of the metric."] +pub struct MongoClusterUpdate { + #[doc = "The properties of a mongo cluster."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub minimum: Option, - #[doc = "The metric timestamp (ISO-8601 format)."] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub timestamp: Option, - #[doc = "The total value of the metric."] + pub properties: Option, + #[doc = "Application-specific metadata in the form of key-value pairs."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option, + pub tags: Option, } -impl MetricValue { +impl MongoClusterUpdate { pub fn new() -> Self { Self::default() } @@ -4328,6 +5123,12 @@ pub struct MongoDbCollectionResource { #[doc = "Analytical TTL."] #[serde(rename = "analyticalStorageTtl", default, skip_serializing_if = "Option::is_none")] pub analytical_storage_ttl: Option, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, } impl MongoDbCollectionResource { pub fn new(id: String) -> Self { @@ -4336,6 +5137,8 @@ impl MongoDbCollectionResource { shard_key: None, indexes: Vec::new(), analytical_storage_ttl: None, + restore_parameters: None, + create_mode: None, } } } @@ -4423,10 +5226,20 @@ impl MongoDbDatabaseListResult { pub struct MongoDbDatabaseResource { #[doc = "Name of the Cosmos DB MongoDB database"] pub id: String, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, } impl MongoDbDatabaseResource { pub fn new(id: String) -> Self { - Self { id } + Self { + id, + restore_parameters: None, + create_mode: None, + } } } #[doc = "Cosmos DB MongoDB collection index key"] @@ -4649,6 +5462,77 @@ pub enum NetworkAclBypass { None, AzureServices, } +#[doc = "The properties of the node group on a cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NodeGroupProperties { + #[doc = "The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example values: 'M30', 'M40'."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024."] + #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] + pub disk_size_gb: Option, + #[doc = "Whether high availability is enabled on the node group."] + #[serde(rename = "enableHa", default, skip_serializing_if = "Option::is_none")] + pub enable_ha: Option, +} +impl NodeGroupProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Specification for a node group."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NodeGroupSpec { + #[serde(flatten)] + pub node_group_properties: NodeGroupProperties, + #[doc = "The kind of a node in the mongo cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[doc = "The number of nodes in the node group."] + #[serde(rename = "nodeCount", default, skip_serializing_if = "Option::is_none")] + pub node_count: Option, +} +impl NodeGroupSpec { + pub fn new() -> Self { + Self::default() + } +} +pub type NodeGroupSpecList = Vec; +#[doc = "The kind of a node in the mongo cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "NodeKind")] +pub enum NodeKind { + Shard, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for NodeKind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for NodeKind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for NodeKind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Shard => serializer.serialize_unit_variant("NodeKind", 0u32, "Shard"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "A notebook workspace resource"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct NotebookWorkspace { @@ -4797,6 +5681,7 @@ pub enum OperationType { Create, Replace, Delete, + Recreate, SystemOperation, #[serde(skip_deserializing)] UnknownValue(String), @@ -4826,7 +5711,8 @@ impl Serialize for OperationType { Self::Create => serializer.serialize_unit_variant("OperationType", 0u32, "Create"), Self::Replace => serializer.serialize_unit_variant("OperationType", 1u32, "Replace"), Self::Delete => serializer.serialize_unit_variant("OperationType", 2u32, "Delete"), - Self::SystemOperation => serializer.serialize_unit_variant("OperationType", 3u32, "SystemOperation"), + Self::Recreate => serializer.serialize_unit_variant("OperationType", 3u32, "Recreate"), + Self::SystemOperation => serializer.serialize_unit_variant("OperationType", 4u32, "SystemOperation"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -5537,6 +6423,17 @@ impl Resource { Self::default() } } +#[doc = "Parameters to indicate the information about the restore."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceRestoreParameters { + #[serde(flatten)] + pub restore_parameters_base: RestoreParametersBase, +} +impl ResourceRestoreParameters { + pub fn new() -> Self { + Self::default() + } +} #[doc = "A Azure Cosmos DB restorable database account."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestorableDatabaseAccountGetResult { @@ -5779,6 +6676,35 @@ impl RestorableGremlinGraphsListResult { Self::default() } } +#[doc = "Specific Databases to restore."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RestorableGremlinResourcesGetResult { + #[doc = "The unique resource identifier of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of Azure resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The name of the gremlin database available for restore."] + #[serde(rename = "databaseName", default, skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[doc = "The names of the graphs available for restore."] + #[serde( + rename = "graphNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub graph_names: Vec, +} +impl RestorableGremlinResourcesGetResult { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The List operation response, that contains the restorable Gremlin resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestorableGremlinResourcesListResult { @@ -5788,7 +6714,7 @@ pub struct RestorableGremlinResourcesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for RestorableGremlinResourcesListResult { type Continuation = String; @@ -5986,6 +6912,35 @@ impl RestorableMongodbDatabasesListResult { Self::default() } } +#[doc = "Specific Databases to restore."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RestorableMongodbResourcesGetResult { + #[doc = "The unique resource identifier of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of Azure resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The name of the database available for restore."] + #[serde(rename = "databaseName", default, skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[doc = "The names of the collections available for restore."] + #[serde( + rename = "collectionNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub collection_names: Vec, +} +impl RestorableMongodbResourcesGetResult { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The List operation response, that contains the restorable MongoDB resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestorableMongodbResourcesListResult { @@ -5995,7 +6950,7 @@ pub struct RestorableMongodbResourcesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for RestorableMongodbResourcesListResult { type Continuation = String; @@ -6232,6 +7187,35 @@ impl RestorableSqlDatabasesListResult { Self::default() } } +#[doc = "Specific Databases to restore."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RestorableSqlResourcesGetResult { + #[doc = "The unique resource identifier of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of Azure resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The name of the database available for restore."] + #[serde(rename = "databaseName", default, skip_serializing_if = "Option::is_none")] + pub database_name: Option, + #[doc = "The names of the collections available for restore."] + #[serde( + rename = "collectionNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub collection_names: Vec, +} +impl RestorableSqlResourcesGetResult { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The List operation response, that contains the restorable SQL resources."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestorableSqlResourcesListResult { @@ -6241,7 +7225,7 @@ pub struct RestorableSqlResourcesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for RestorableSqlResourcesListResult { type Continuation = String; @@ -6314,6 +7298,24 @@ pub mod restorable_table_properties { } } } +#[doc = "Specific Databases to restore."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RestorableTableResourcesGetResult { + #[doc = "The unique resource identifier of the ARM resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the Table."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of Azure resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl RestorableTableResourcesGetResult { + pub fn new() -> Self { + Self::default() + } +} #[doc = "List of restorable table names."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestorableTableResourcesListResult { @@ -6323,7 +7325,7 @@ pub struct RestorableTableResourcesListResult { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, } impl azure_core::Continuable for RestorableTableResourcesListResult { type Continuation = String; @@ -6361,6 +7363,8 @@ impl RestorableTablesListResult { #[doc = "Parameters to indicate the information about the restore."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RestoreParameters { + #[serde(flatten)] + pub restore_parameters_base: RestoreParametersBase, #[doc = "Describes the mode of the restore."] #[serde(rename = "restoreMode", default, skip_serializing_if = "Option::is_none")] pub restore_mode: Option, @@ -6394,6 +7398,9 @@ pub struct RestoreParameters { skip_serializing_if = "Vec::is_empty" )] pub tables_to_restore: Vec, + #[doc = "The source backup location for restore."] + #[serde(rename = "sourceBackupLocation", default, skip_serializing_if = "Option::is_none")] + pub source_backup_location: Option, } impl RestoreParameters { pub fn new() -> Self { @@ -6438,6 +7445,21 @@ pub mod restore_parameters { } } } +#[doc = "Parameters to indicate the information about the restore."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RestoreParametersBase { + #[doc = "The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}"] + #[serde(rename = "restoreSource", default, skip_serializing_if = "Option::is_none")] + pub restore_source: Option, + #[doc = "Time to which the account has to be restored (ISO-8601 format)."] + #[serde(rename = "restoreTimestampInUtc", default, with = "azure_core::date::rfc3339::option")] + pub restore_timestamp_in_utc: Option, +} +impl RestoreParametersBase { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Cosmos DB retrieve throughput parameters object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RetrieveThroughputParameters { @@ -6900,6 +7922,15 @@ pub struct SqlContainerResource { #[doc = "Analytical TTL."] #[serde(rename = "analyticalStorageTtl", default, skip_serializing_if = "Option::is_none")] pub analytical_storage_ttl: Option, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, + #[doc = "Materialized View definition for the container."] + #[serde(rename = "materializedViewDefinition", default, skip_serializing_if = "Option::is_none")] + pub materialized_view_definition: Option, } impl SqlContainerResource { pub fn new(id: String) -> Self { @@ -6912,6 +7943,9 @@ impl SqlContainerResource { conflict_resolution_policy: None, client_encryption_policy: None, analytical_storage_ttl: None, + restore_parameters: None, + create_mode: None, + materialized_view_definition: None, } } } @@ -7025,10 +8059,20 @@ impl SqlDatabaseListResult { pub struct SqlDatabaseResource { #[doc = "Name of the Cosmos DB SQL database"] pub id: String, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, } impl SqlDatabaseResource { pub fn new(id: String) -> Self { - Self { id } + Self { + id, + restore_parameters: None, + create_mode: None, + } } } #[doc = "Resource for a regional service location."] @@ -7687,10 +8731,20 @@ pub type TableName = String; pub struct TableResource { #[doc = "Name of the Cosmos DB table"] pub id: String, + #[doc = "Parameters to indicate the information about the restore."] + #[serde(rename = "restoreParameters", default, skip_serializing_if = "Option::is_none")] + pub restore_parameters: Option, + #[doc = "Enum to indicate the mode of account creation."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, } impl TableResource { pub fn new(id: String) -> Self { - Self { id } + Self { + id, + restore_parameters: None, + create_mode: None, + } } } #[doc = "Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with \"defaultExperience\": \"Cassandra\". Current \"defaultExperience\" values also include \"Table\", \"Graph\", \"DocumentDB\", and \"MongoDB\"."] @@ -7789,6 +8843,26 @@ impl ThroughputSettingsUpdateProperties { Self { resource } } } +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} #[doc = "The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UniqueKey { diff --git a/services/mgmt/costmanagement/Cargo.toml b/services/mgmt/costmanagement/Cargo.toml index 8c9ad242f2..2e75592bb4 100644 --- a/services/mgmt/costmanagement/Cargo.toml +++ b/services/mgmt/costmanagement/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2022-08", "enable_reqwest"] +default = ["package-preview-2023-04", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-04" = [] "package-preview-2022-08" = [] "package-preview-2022-06" = [] "package-preview-2022-04" = [] -"package-preview-2022-02" = [] -"package-preview-2020-12" = [] \ No newline at end of file +"package-preview-2022-02" = [] \ No newline at end of file diff --git a/services/mgmt/costmanagement/README.md b/services/mgmt/costmanagement/README.md index bab66fa4ef..cb4f2e3105 100644 --- a/services/mgmt/costmanagement/README.md +++ b/services/mgmt/costmanagement/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cost-manag To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2022-08`. +The default tag is `package-preview-2023-04`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-04` has 55 operations from 1 API versions: `2023-04-01-preview`. Use crate feature `package-preview-2023-04` to enable. The operations will be in the `package_preview_2023_04` module. - `package-preview-2022-08` has 21 operations from 1 API versions: `2022-08-01-preview`. Use crate feature `package-preview-2022-08` to enable. The operations will be in the `package_preview_2022_08` module. - `package-preview-2022-06` has 39 operations from 2 API versions: `2021-10-01`, `2022-06-01-preview`. Use crate feature `package-preview-2022-06` to enable. The operations will be in the `package_preview_2022_06` module. - `package-preview-2022-04` has 39 operations from 2 API versions: `2021-10-01`, `2022-04-01-preview`. Use crate feature `package-preview-2022-04` to enable. The operations will be in the `package_preview_2022_04` module. -- `package-preview-2022-02` has 3 operations from 1 API versions: `2022-02-01-preview`. Use crate feature `package-preview-2022-02` to enable. The operations will be in the `package_preview_2022_02` module. -- `package-preview-2020-12` has 28 operations from 2 API versions: `2020-06-01`, `2020-12-01-preview`. Use crate feature `package-preview-2020-12` to enable. The operations will be in the `package_preview_2020_12` module. \ No newline at end of file +- `package-preview-2022-02` has 3 operations from 1 API versions: `2022-02-01-preview`. Use crate feature `package-preview-2022-02` to enable. The operations will be in the `package_preview_2022_02` module. \ No newline at end of file diff --git a/services/mgmt/costmanagement/src/lib.rs b/services/mgmt/costmanagement/src/lib.rs index df5c785a95..1fdd65c35a 100644 --- a/services/mgmt/costmanagement/src/lib.rs +++ b/services/mgmt/costmanagement/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-04")] +pub mod package_preview_2023_04; +#[cfg(all(feature = "package-preview-2023-04", not(feature = "no-default-tag")))] +pub use package_preview_2023_04::*; #[cfg(feature = "package-preview-2022-08")] pub mod package_preview_2022_08; #[cfg(all(feature = "package-preview-2022-08", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_preview_2022_04::*; pub mod package_preview_2022_02; #[cfg(all(feature = "package-preview-2022-02", not(feature = "no-default-tag")))] pub use package_preview_2022_02::*; -#[cfg(feature = "package-preview-2020-12")] -pub mod package_preview_2020_12; -#[cfg(all(feature = "package-preview-2020-12", not(feature = "no-default-tag")))] -pub use package_preview_2020_12::*; diff --git a/services/mgmt/costmanagement/src/package_preview_2020_12/mod.rs b/services/mgmt/costmanagement/src/package_preview_2020_12/mod.rs deleted file mode 100644 index 5988e03cc7..0000000000 --- a/services/mgmt/costmanagement/src/package_preview_2020_12/mod.rs +++ /dev/null @@ -1,3131 +0,0 @@ -#![allow(unused_mut)] -#![allow(unused_variables)] -#![allow(unused_imports)] -#![allow(clippy::redundant_clone)] -pub mod models; -#[derive(Clone)] -pub struct Client { - endpoint: String, - credential: std::sync::Arc, - scopes: Vec, - pipeline: azure_core::Pipeline, -} -#[derive(Clone)] -pub struct ClientBuilder { - credential: std::sync::Arc, - endpoint: Option, - scopes: Option>, - options: azure_core::ClientOptions, -} -pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; -impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: std::sync::Arc) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); - Client::new(endpoint, self.credential, scopes, self.options) - } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { - self.credential.as_ref() - } - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { - let mut context = azure_core::Context::default(); - self.pipeline.send(&mut context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: std::sync::Arc) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into, - credential: std::sync::Arc, - scopes: Vec, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn alerts_client(&self) -> alerts::Client { - alerts::Client(self.clone()) - } - pub fn dimensions_client(&self) -> dimensions::Client { - dimensions::Client(self.clone()) - } - pub fn exports_client(&self) -> exports::Client { - exports::Client(self.clone()) - } - pub fn forecast_client(&self) -> forecast::Client { - forecast::Client(self.clone()) - } - pub fn generate_detailed_cost_report_client(&self) -> generate_detailed_cost_report::Client { - generate_detailed_cost_report::Client(self.clone()) - } - pub fn generate_detailed_cost_report_operation_results_client(&self) -> generate_detailed_cost_report_operation_results::Client { - generate_detailed_cost_report_operation_results::Client(self.clone()) - } - pub fn generate_detailed_cost_report_operation_status_client(&self) -> generate_detailed_cost_report_operation_status::Client { - generate_detailed_cost_report_operation_status::Client(self.clone()) - } - pub fn operations_client(&self) -> operations::Client { - operations::Client(self.clone()) - } - pub fn query_client(&self) -> query::Client { - query::Client(self.clone()) - } - pub fn views_client(&self) -> views::Client { - views::Client(self.clone()) - } -} -pub mod exports { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "The operation to list all exports at the given scope."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - pub fn list(&self, scope: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - expand: None, - } - } - #[doc = "The operation to get the export for the defined scope by export name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `export_name`: Export Name."] - pub fn get(&self, scope: impl Into, export_name: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - export_name: export_name.into(), - expand: None, - } - } - #[doc = "The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `export_name`: Export Name."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Export operation."] - pub fn create_or_update( - &self, - scope: impl Into, - export_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - export_name: export_name.into(), - parameters: parameters.into(), - } - } - #[doc = "The operation to delete a export."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `export_name`: Export Name."] - pub fn delete(&self, scope: impl Into, export_name: impl Into) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - export_name: export_name.into(), - } - } - #[doc = "The operation to execute an export."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `export_name`: Export Name."] - pub fn execute(&self, scope: impl Into, export_name: impl Into) -> execute::RequestBuilder { - execute::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - export_name: export_name.into(), - } - } - #[doc = "The operation to get the execution history of an export for the defined scope and export name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `export_name`: Export Name."] - pub fn get_execution_history( - &self, - scope: impl Into, - export_name: impl Into, - ) -> get_execution_history::RequestBuilder { - get_execution_history::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - export_name: export_name.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExportListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) expand: Option, - } - impl RequestBuilder { - #[doc = "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last execution of each export."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/exports", - this.client.endpoint(), - &this.scope - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Export = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) export_name: String, - pub(crate) expand: Option, - } - impl RequestBuilder { - #[doc = "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 executions of the export."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/exports/{}", - this.client.endpoint(), - &this.scope, - &this.export_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("$expand", expand); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Export = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) export_name: String, - pub(crate) parameters: models::Export, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/exports/{}", - this.client.endpoint(), - &this.scope, - &this.export_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) export_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/exports/{}", - this.client.endpoint(), - &this.scope, - &this.export_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod execute { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) export_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/exports/{}/run", - this.client.endpoint(), - &this.scope, - &this.export_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod get_execution_history { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ExportExecutionListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) export_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/exports/{}/runHistory", - this.client.endpoint(), - &this.scope, - &this.export_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod generate_detailed_cost_report { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `parameters`: Parameters supplied to the Create detailed cost report operation."] - pub fn create_operation( - &self, - scope: impl Into, - parameters: impl Into, - ) -> create_operation::RequestBuilder { - create_operation::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - parameters: parameters.into(), - } - } - } - pub mod create_operation { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GenerateDetailedCostReportOperationResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "The URL to check the result of the asynchronous operation."] - pub fn location(&self) -> azure_core::Result<&str> { - self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) - } - #[doc = "The URL to check the status of the asynchronous operation."] - pub fn azure_consumption_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-consumption-asyncoperation")) - } - #[doc = "The URL to check the status of the asynchronous operation."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - #[doc = "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds."] - pub fn retry_after(&self) -> azure_core::Result { - self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) parameters: models::GenerateDetailedCostReportDefinition, - } - impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/generateDetailedCostReport", - this.client.endpoint(), - &this.scope - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod generate_detailed_cost_report_operation_results { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `operation_id`: The target operation Id."] - #[doc = "* `scope`: The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - pub fn get(&self, operation_id: impl Into, scope: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - operation_id: operation_id.into(), - scope: scope.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GenerateDetailedCostReportOperationResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) operation_id: String, - pub(crate) scope: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/operationResults/{}", - this.client.endpoint(), - &this.scope, - &this.operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod generate_detailed_cost_report_operation_status { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `operation_id`: The target operation Id."] - #[doc = "* `scope`: The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - pub fn get(&self, operation_id: impl Into, scope: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - operation_id: operation_id.into(), - scope: scope.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GenerateDetailedCostReportOperationStatuses = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) operation_id: String, - pub(crate) scope: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/operationStatus/{}", - this.client.endpoint(), - &this.scope, - &this.operation_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod views { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all views by tenant and object."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - #[doc = "Lists all views at the given scope."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] - pub fn list_by_scope(&self, scope: impl Into) -> list_by_scope::RequestBuilder { - list_by_scope::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - } - } - #[doc = "Gets the view by view name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `view_name`: View name"] - pub fn get(&self, view_name: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - view_name: view_name.into(), - } - } - #[doc = "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `view_name`: View name"] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate View operation."] - pub fn create_or_update( - &self, - view_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - view_name: view_name.into(), - parameters: parameters.into(), - } - } - #[doc = "The operation to delete a view."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `view_name`: View name"] - pub fn delete(&self, view_name: impl Into) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - view_name: view_name.into(), - } - } - #[doc = "Gets the view for the defined scope by view name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] - #[doc = "* `view_name`: View name"] - pub fn get_by_scope(&self, scope: impl Into, view_name: impl Into) -> get_by_scope::RequestBuilder { - get_by_scope::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - view_name: view_name.into(), - } - } - #[doc = "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] - #[doc = "* `view_name`: View name"] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate View operation."] - pub fn create_or_update_by_scope( - &self, - scope: impl Into, - view_name: impl Into, - parameters: impl Into, - ) -> create_or_update_by_scope::RequestBuilder { - create_or_update_by_scope::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - view_name: view_name.into(), - parameters: parameters.into(), - } - } - #[doc = "The operation to delete a view."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] - #[doc = "* `view_name`: View name"] - pub fn delete_by_scope(&self, scope: impl Into, view_name: impl Into) -> delete_by_scope::RequestBuilder { - delete_by_scope::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - view_name: view_name.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ViewListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = - azure_core::Url::parse(&format!("{}/providers/Microsoft.CostManagement/views", this.client.endpoint(),))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } - pub mod list_by_scope { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ViewListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/views", - this.client.endpoint(), - &this.scope - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::View = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) view_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/views/{}", - this.client.endpoint(), - &this.view_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::View = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) view_name: String, - pub(crate) parameters: models::View, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/views/{}", - this.client.endpoint(), - &this.view_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) view_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/views/{}", - this.client.endpoint(), - &this.view_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod get_by_scope { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::View = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) view_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/views/{}", - this.client.endpoint(), - &this.scope, - &this.view_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update_by_scope { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::View = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) view_name: String, - pub(crate) parameters: models::View, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/views/{}", - this.client.endpoint(), - &this.scope, - &this.view_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete_by_scope { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) view_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/views/{}", - this.client.endpoint(), - &this.scope, - &this.view_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod alerts { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the alerts for scope defined."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - pub fn list(&self, scope: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - } - } - #[doc = "Gets the alert for the scope by alert ID."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `alert_id`: Alert ID"] - pub fn get(&self, scope: impl Into, alert_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - alert_id: alert_id.into(), - } - } - #[doc = "Dismisses the specified alert"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `alert_id`: Alert ID"] - #[doc = "* `parameters`: Parameters supplied to the Dismiss Alert operation."] - pub fn dismiss( - &self, - scope: impl Into, - alert_id: impl Into, - parameters: impl Into, - ) -> dismiss::RequestBuilder { - dismiss::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - alert_id: alert_id.into(), - parameters: parameters.into(), - } - } - #[doc = "Lists the Alerts for external cloud provider type defined."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] - #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] - pub fn list_external( - &self, - external_cloud_provider_type: impl Into, - external_cloud_provider_id: impl Into, - ) -> list_external::RequestBuilder { - list_external::RequestBuilder { - client: self.0.clone(), - external_cloud_provider_type: external_cloud_provider_type.into(), - external_cloud_provider_id: external_cloud_provider_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AlertsResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/alerts", - this.client.endpoint(), - &this.scope - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Alert = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) alert_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/alerts/{}", - this.client.endpoint(), - &this.scope, - &this.alert_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod dismiss { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Alert = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) alert_id: String, - pub(crate) parameters: models::DismissAlertPayload, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/alerts/{}", - this.client.endpoint(), - &this.scope, - &this.alert_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list_external { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::AlertsResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) external_cloud_provider_type: String, - pub(crate) external_cloud_provider_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/{}/{}/alerts", - this.client.endpoint(), - &this.external_cloud_provider_type, - &this.external_cloud_provider_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod forecast { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the forecast charges for scope defined."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Forecast Config operation."] - pub fn usage(&self, scope: impl Into, parameters: impl Into) -> usage::RequestBuilder { - usage::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - parameters: parameters.into(), - filter: None, - } - } - #[doc = "Lists the forecast charges for external cloud provider type defined."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] - #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Forecast Config operation."] - pub fn external_cloud_provider_usage( - &self, - external_cloud_provider_type: impl Into, - external_cloud_provider_id: impl Into, - parameters: impl Into, - ) -> external_cloud_provider_usage::RequestBuilder { - external_cloud_provider_usage::RequestBuilder { - client: self.0.clone(), - external_cloud_provider_type: external_cloud_provider_type.into(), - external_cloud_provider_id: external_cloud_provider_id.into(), - parameters: parameters.into(), - filter: None, - } - } - } - pub mod usage { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) parameters: models::ForecastDefinition, - pub(crate) filter: Option, - } - impl RequestBuilder { - #[doc = "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/forecast", - this.client.endpoint(), - &this.scope - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod external_cloud_provider_usage { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) external_cloud_provider_type: String, - pub(crate) external_cloud_provider_id: String, - pub(crate) parameters: models::ForecastDefinition, - pub(crate) filter: Option, - } - impl RequestBuilder { - #[doc = "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/{}/{}/forecast", - this.client.endpoint(), - &this.external_cloud_provider_type, - &this.external_cloud_provider_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod dimensions { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists the dimensions by the defined scope."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - pub fn list(&self, scope: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - filter: None, - expand: None, - skiptoken: None, - top: None, - } - } - #[doc = "Lists the dimensions by the external cloud provider type."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] - #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] - pub fn by_external_cloud_provider_type( - &self, - external_cloud_provider_type: impl Into, - external_cloud_provider_id: impl Into, - ) -> by_external_cloud_provider_type::RequestBuilder { - by_external_cloud_provider_type::RequestBuilder { - client: self.0.clone(), - external_cloud_provider_type: external_cloud_provider_type.into(), - external_cloud_provider_id: external_cloud_provider_id.into(), - filter: None, - expand: None, - skiptoken: None, - top: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DimensionsListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) filter: Option, - pub(crate) expand: Option, - pub(crate) skiptoken: Option, - pub(crate) top: Option, - } - impl RequestBuilder { - #[doc = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."] - pub fn skiptoken(mut self, skiptoken: impl Into) -> Self { - self.skiptoken = Some(skiptoken.into()); - self - } - #[doc = "May be used to limit the number of results to the most recent N dimension data."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/dimensions", - this.client.endpoint(), - &this.scope - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("$expand", expand); - } - if let Some(skiptoken) = &this.skiptoken { - req.url_mut().query_pairs_mut().append_pair("$skiptoken", skiptoken); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod by_external_cloud_provider_type { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DimensionsListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) external_cloud_provider_type: String, - pub(crate) external_cloud_provider_id: String, - pub(crate) filter: Option, - pub(crate) expand: Option, - pub(crate) skiptoken: Option, - pub(crate) top: Option, - } - impl RequestBuilder { - #[doc = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions."] - pub fn expand(mut self, expand: impl Into) -> Self { - self.expand = Some(expand.into()); - self - } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."] - pub fn skiptoken(mut self, skiptoken: impl Into) -> Self { - self.skiptoken = Some(skiptoken.into()); - self - } - #[doc = "May be used to limit the number of results to the most recent N dimension data."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/{}/{}/dimensions", - this.client.endpoint(), - &this.external_cloud_provider_type, - &this.external_cloud_provider_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(expand) = &this.expand { - req.url_mut().query_pairs_mut().append_pair("$expand", expand); - } - if let Some(skiptoken) = &this.skiptoken { - req.url_mut().query_pairs_mut().append_pair("$skiptoken", skiptoken); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod query { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Query the usage data for scope defined."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Query Config operation."] - pub fn usage(&self, scope: impl Into, parameters: impl Into) -> usage::RequestBuilder { - usage::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - parameters: parameters.into(), - } - } - #[doc = "Query the usage data for external cloud provider type defined."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] - #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] - #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Query Config operation."] - pub fn usage_by_external_cloud_provider_type( - &self, - external_cloud_provider_type: impl Into, - external_cloud_provider_id: impl Into, - parameters: impl Into, - ) -> usage_by_external_cloud_provider_type::RequestBuilder { - usage_by_external_cloud_provider_type::RequestBuilder { - client: self.0.clone(), - external_cloud_provider_type: external_cloud_provider_type.into(), - external_cloud_provider_id: external_cloud_provider_id.into(), - parameters: parameters.into(), - } - } - } - pub mod usage { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - pub(crate) parameters: models::QueryDefinition, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.CostManagement/query", - this.client.endpoint(), - &this.scope - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod usage_by_external_cloud_provider_type { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::QueryResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) external_cloud_provider_type: String, - pub(crate) external_cloud_provider_id: String, - pub(crate) parameters: models::QueryDefinition, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.CostManagement/{}/{}/query", - this.client.endpoint(), - &this.external_cloud_provider_type, - &this.external_cloud_provider_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod operations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all of the available cost management REST API operations."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = - azure_core::Url::parse(&format!("{}/providers/Microsoft.CostManagement/operations", this.client.endpoint(),))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } -} diff --git a/services/mgmt/costmanagement/src/package_preview_2020_12/models.rs b/services/mgmt/costmanagement/src/package_preview_2020_12/models.rs deleted file mode 100644 index 0836704c73..0000000000 --- a/services/mgmt/costmanagement/src/package_preview_2020_12/models.rs +++ /dev/null @@ -1,2939 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "An individual alert."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Alert { - #[serde(flatten)] - pub resource: Resource, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Alert { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AlertProperties { - #[doc = "defines the type of alert"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition: Option, - #[doc = "Alert description"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Source of alert"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Alert details"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, - #[doc = "related budget"] - #[serde(rename = "costEntityId", default, skip_serializing_if = "Option::is_none")] - pub cost_entity_id: Option, - #[doc = "alert status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "dateTime in which alert was created"] - #[serde(rename = "creationTime", default, skip_serializing_if = "Option::is_none")] - pub creation_time: Option, - #[doc = "dateTime in which alert was closed"] - #[serde(rename = "closeTime", default, skip_serializing_if = "Option::is_none")] - pub close_time: Option, - #[doc = "dateTime in which alert was last modified"] - #[serde(rename = "modificationTime", default, skip_serializing_if = "Option::is_none")] - pub modification_time: Option, - #[doc = ""] - #[serde(rename = "statusModificationUserName", default, skip_serializing_if = "Option::is_none")] - pub status_modification_user_name: Option, - #[doc = "dateTime in which the alert status was last modified"] - #[serde(rename = "statusModificationTime", default, skip_serializing_if = "Option::is_none")] - pub status_modification_time: Option, -} -impl AlertProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod alert_properties { - use super::*; - #[doc = "defines the type of alert"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Definition { - #[doc = "type of alert"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Alert category"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[doc = "Criteria that triggered alert"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub criteria: Option, - } - impl Definition { - pub fn new() -> Self { - Self::default() - } - } - pub mod definition { - use super::*; - #[doc = "type of alert"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Budget, - Invoice, - Credit, - Quota, - General, - #[serde(rename = "xCloud")] - XCloud, - BudgetForecast, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Budget => serializer.serialize_unit_variant("Type", 0u32, "Budget"), - Self::Invoice => serializer.serialize_unit_variant("Type", 1u32, "Invoice"), - Self::Credit => serializer.serialize_unit_variant("Type", 2u32, "Credit"), - Self::Quota => serializer.serialize_unit_variant("Type", 3u32, "Quota"), - Self::General => serializer.serialize_unit_variant("Type", 4u32, "General"), - Self::XCloud => serializer.serialize_unit_variant("Type", 5u32, "xCloud"), - Self::BudgetForecast => serializer.serialize_unit_variant("Type", 6u32, "BudgetForecast"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Alert category"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Category")] - pub enum Category { - Cost, - Usage, - Billing, - System, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Category { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Category { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Category { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Cost => serializer.serialize_unit_variant("Category", 0u32, "Cost"), - Self::Usage => serializer.serialize_unit_variant("Category", 1u32, "Usage"), - Self::Billing => serializer.serialize_unit_variant("Category", 2u32, "Billing"), - Self::System => serializer.serialize_unit_variant("Category", 3u32, "System"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Criteria that triggered alert"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Criteria")] - pub enum Criteria { - CostThresholdExceeded, - UsageThresholdExceeded, - CreditThresholdApproaching, - CreditThresholdReached, - QuotaThresholdApproaching, - QuotaThresholdReached, - MultiCurrency, - ForecastCostThresholdExceeded, - ForecastUsageThresholdExceeded, - InvoiceDueDateApproaching, - InvoiceDueDateReached, - CrossCloudNewDataAvailable, - CrossCloudCollectionError, - GeneralThresholdError, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Criteria { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Criteria { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Criteria { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CostThresholdExceeded => serializer.serialize_unit_variant("Criteria", 0u32, "CostThresholdExceeded"), - Self::UsageThresholdExceeded => serializer.serialize_unit_variant("Criteria", 1u32, "UsageThresholdExceeded"), - Self::CreditThresholdApproaching => serializer.serialize_unit_variant("Criteria", 2u32, "CreditThresholdApproaching"), - Self::CreditThresholdReached => serializer.serialize_unit_variant("Criteria", 3u32, "CreditThresholdReached"), - Self::QuotaThresholdApproaching => serializer.serialize_unit_variant("Criteria", 4u32, "QuotaThresholdApproaching"), - Self::QuotaThresholdReached => serializer.serialize_unit_variant("Criteria", 5u32, "QuotaThresholdReached"), - Self::MultiCurrency => serializer.serialize_unit_variant("Criteria", 6u32, "MultiCurrency"), - Self::ForecastCostThresholdExceeded => { - serializer.serialize_unit_variant("Criteria", 7u32, "ForecastCostThresholdExceeded") - } - Self::ForecastUsageThresholdExceeded => { - serializer.serialize_unit_variant("Criteria", 8u32, "ForecastUsageThresholdExceeded") - } - Self::InvoiceDueDateApproaching => serializer.serialize_unit_variant("Criteria", 9u32, "InvoiceDueDateApproaching"), - Self::InvoiceDueDateReached => serializer.serialize_unit_variant("Criteria", 10u32, "InvoiceDueDateReached"), - Self::CrossCloudNewDataAvailable => serializer.serialize_unit_variant("Criteria", 11u32, "CrossCloudNewDataAvailable"), - Self::CrossCloudCollectionError => serializer.serialize_unit_variant("Criteria", 12u32, "CrossCloudCollectionError"), - Self::GeneralThresholdError => serializer.serialize_unit_variant("Criteria", 13u32, "GeneralThresholdError"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - #[doc = "Source of alert"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Source")] - pub enum Source { - Preset, - User, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Source { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Source { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Source { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Preset => serializer.serialize_unit_variant("Source", 0u32, "Preset"), - Self::User => serializer.serialize_unit_variant("Source", 1u32, "User"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Alert details"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Details { - #[doc = "Type of timegrain cadence"] - #[serde(rename = "timeGrainType", default, skip_serializing_if = "Option::is_none")] - pub time_grain_type: Option, - #[doc = "datetime of periodStartDate"] - #[serde(rename = "periodStartDate", default, skip_serializing_if = "Option::is_none")] - pub period_start_date: Option, - #[doc = "notificationId that triggered this alert"] - #[serde(rename = "triggeredBy", default, skip_serializing_if = "Option::is_none")] - pub triggered_by: Option, - #[doc = "array of resourceGroups to filter by"] - #[serde( - rename = "resourceGroupFilter", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub resource_group_filter: Vec, - #[doc = "array of resources to filter by"] - #[serde( - rename = "resourceFilter", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub resource_filter: Vec, - #[doc = "array of meters to filter by"] - #[serde( - rename = "meterFilter", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub meter_filter: Vec, - #[doc = "tags to filter by"] - #[serde(rename = "tagFilter", default, skip_serializing_if = "Option::is_none")] - pub tag_filter: Option, - #[doc = "notification threshold percentage as a decimal which activated this alert"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub threshold: Option, - #[doc = "operator used to compare currentSpend with amount"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operator: Option, - #[doc = "budget threshold amount"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[doc = "unit of currency being used"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "current spend"] - #[serde(rename = "currentSpend", default, skip_serializing_if = "Option::is_none")] - pub current_spend: Option, - #[doc = "list of emails to contact"] - #[serde( - rename = "contactEmails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub contact_emails: Vec, - #[doc = "list of action groups to broadcast to"] - #[serde( - rename = "contactGroups", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub contact_groups: Vec, - #[doc = "list of contact roles"] - #[serde( - rename = "contactRoles", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub contact_roles: Vec, - #[doc = "overriding alert"] - #[serde(rename = "overridingAlert", default, skip_serializing_if = "Option::is_none")] - pub overriding_alert: Option, - } - impl Details { - pub fn new() -> Self { - Self::default() - } - } - pub mod details { - use super::*; - #[doc = "Type of timegrain cadence"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "TimeGrainType")] - pub enum TimeGrainType { - None, - Monthly, - Quarterly, - Annually, - BillingMonth, - BillingQuarter, - BillingAnnual, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for TimeGrainType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for TimeGrainType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for TimeGrainType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("TimeGrainType", 0u32, "None"), - Self::Monthly => serializer.serialize_unit_variant("TimeGrainType", 1u32, "Monthly"), - Self::Quarterly => serializer.serialize_unit_variant("TimeGrainType", 2u32, "Quarterly"), - Self::Annually => serializer.serialize_unit_variant("TimeGrainType", 3u32, "Annually"), - Self::BillingMonth => serializer.serialize_unit_variant("TimeGrainType", 4u32, "BillingMonth"), - Self::BillingQuarter => serializer.serialize_unit_variant("TimeGrainType", 5u32, "BillingQuarter"), - Self::BillingAnnual => serializer.serialize_unit_variant("TimeGrainType", 6u32, "BillingAnnual"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "operator used to compare currentSpend with amount"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Operator")] - pub enum Operator { - None, - EqualTo, - GreaterThan, - GreaterThanOrEqualTo, - LessThan, - LessThanOrEqualTo, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Operator { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Operator { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Operator { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("Operator", 0u32, "None"), - Self::EqualTo => serializer.serialize_unit_variant("Operator", 1u32, "EqualTo"), - Self::GreaterThan => serializer.serialize_unit_variant("Operator", 2u32, "GreaterThan"), - Self::GreaterThanOrEqualTo => serializer.serialize_unit_variant("Operator", 3u32, "GreaterThanOrEqualTo"), - Self::LessThan => serializer.serialize_unit_variant("Operator", 4u32, "LessThan"), - Self::LessThanOrEqualTo => serializer.serialize_unit_variant("Operator", 5u32, "LessThanOrEqualTo"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - #[doc = "alert status"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - None, - Active, - Overridden, - Resolved, - Dismissed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("Status", 0u32, "None"), - Self::Active => serializer.serialize_unit_variant("Status", 1u32, "Active"), - Self::Overridden => serializer.serialize_unit_variant("Status", 2u32, "Overridden"), - Self::Resolved => serializer.serialize_unit_variant("Status", 3u32, "Resolved"), - Self::Dismissed => serializer.serialize_unit_variant("Status", 4u32, "Dismissed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Result of alerts."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AlertsResult { - #[doc = "List of alerts."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to get the next set of alerts results if there are any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl AlertsResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The common properties of the export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommonExportProperties { - #[doc = "The format of the export being delivered. Currently only 'Csv' is supported."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub format: Option, - #[doc = "The delivery information associated with a export."] - #[serde(rename = "deliveryInfo")] - pub delivery_info: ExportDeliveryInfo, - #[doc = "The definition of an export."] - pub definition: ExportDefinition, - #[doc = "Result of listing the execution history of an export."] - #[serde(rename = "runHistory", default, skip_serializing_if = "Option::is_none")] - pub run_history: Option, - #[doc = "If the export has an active schedule, provides an estimate of the next execution time."] - #[serde(rename = "nextRunTimeEstimate", default, with = "azure_core::date::rfc3339::option")] - pub next_run_time_estimate: Option, -} -impl CommonExportProperties { - pub fn new(delivery_info: ExportDeliveryInfo, definition: ExportDefinition) -> Self { - Self { - format: None, - delivery_info, - definition, - run_history: None, - next_run_time_estimate: None, - } - } -} -pub mod common_export_properties { - use super::*; - #[doc = "The format of the export being delivered. Currently only 'Csv' is supported."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Format")] - pub enum Format { - Csv, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Format { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Format { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Format { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Csv => serializer.serialize_unit_variant("Format", 0u32, "Csv"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Dimension { - #[serde(flatten)] - pub resource: Resource, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Dimension { - pub fn new() -> Self { - Self::default() - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DimensionProperties { - #[doc = "Dimension description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Filter enabled."] - #[serde(rename = "filterEnabled", default, skip_serializing_if = "Option::is_none")] - pub filter_enabled: Option, - #[doc = "Grouping enabled."] - #[serde(rename = "groupingEnabled", default, skip_serializing_if = "Option::is_none")] - pub grouping_enabled: Option, - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub data: Vec, - #[doc = "Total number of data for the dimension."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total: Option, - #[doc = "Dimension category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[doc = "Usage start."] - #[serde(rename = "usageStart", default, with = "azure_core::date::rfc3339::option")] - pub usage_start: Option, - #[doc = "Usage end."] - #[serde(rename = "usageEnd", default, with = "azure_core::date::rfc3339::option")] - pub usage_end: Option, - #[doc = "The link (url) to the next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl DimensionProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Result of listing dimensions. It contains a list of available dimensions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DimensionsListResult { - #[doc = "The list of dimensions."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DimensionsListResult { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl DimensionsListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The request payload to update an alert"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DismissAlertPayload { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DismissAlertPayload { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The URL to download the generated report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DownloadUrl { - #[doc = "The URL to download the generated report."] - #[serde(rename = "downloadUrl", default, skip_serializing_if = "Option::is_none")] - pub download_url: Option, - #[doc = "The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z."] - #[serde(rename = "validTill", default, with = "azure_core::date::rfc3339::option")] - pub valid_till: Option, -} -impl DownloadUrl { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The details of the error."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorDetails { - #[doc = "Error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Error message indicating why the operation failed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl ErrorDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The details of the error."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An export resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Export { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of the export."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Export { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The definition for data in the export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportDataset { - #[doc = "The granularity of rows in the export. Currently only 'Daily' is supported."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub granularity: Option, - #[doc = "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, -} -impl ExportDataset { - pub fn new() -> Self { - Self::default() - } -} -pub mod export_dataset { - use super::*; - #[doc = "The granularity of rows in the export. Currently only 'Daily' is supported."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Granularity")] - pub enum Granularity { - Daily, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Granularity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Granularity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Granularity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportDatasetConfiguration { - #[doc = "Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples)."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub columns: Vec, -} -impl ExportDatasetConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The definition of an export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportDefinition { - #[doc = "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations."] - #[serde(rename = "type")] - pub type_: export_definition::Type, - #[doc = "The time frame for pulling data for the export. If custom, then a specific time period must be provided."] - pub timeframe: export_definition::Timeframe, - #[doc = "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months."] - #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] - pub time_period: Option, - #[doc = "The definition for data in the export."] - #[serde(rename = "dataSet", default, skip_serializing_if = "Option::is_none")] - pub data_set: Option, -} -impl ExportDefinition { - pub fn new(type_: export_definition::Type, timeframe: export_definition::Timeframe) -> Self { - Self { - type_, - timeframe, - time_period: None, - data_set: None, - } - } -} -pub mod export_definition { - use super::*; - #[doc = "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Usage, - ActualCost, - AmortizedCost, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), - Self::ActualCost => serializer.serialize_unit_variant("Type", 1u32, "ActualCost"), - Self::AmortizedCost => serializer.serialize_unit_variant("Type", 2u32, "AmortizedCost"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The time frame for pulling data for the export. If custom, then a specific time period must be provided."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Timeframe")] - pub enum Timeframe { - MonthToDate, - BillingMonthToDate, - TheLastMonth, - TheLastBillingMonth, - WeekToDate, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Timeframe { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Timeframe { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Timeframe { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "MonthToDate"), - Self::BillingMonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "BillingMonthToDate"), - Self::TheLastMonth => serializer.serialize_unit_variant("Timeframe", 2u32, "TheLastMonth"), - Self::TheLastBillingMonth => serializer.serialize_unit_variant("Timeframe", 3u32, "TheLastBillingMonth"), - Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 4u32, "WeekToDate"), - Self::Custom => serializer.serialize_unit_variant("Timeframe", 5u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Azure Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key )."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportDeliveryDestination { - #[doc = "The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[doc = "The name of the container where exports will be uploaded. If the container does not exist it will be created."] - pub container: String, - #[doc = "The name of the directory where exports will be uploaded."] - #[serde(rename = "rootFolderPath", default, skip_serializing_if = "Option::is_none")] - pub root_folder_path: Option, - #[doc = "A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified."] - #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] - pub sas_token: Option, - #[doc = "The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId."] - #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] - pub storage_account: Option, -} -impl ExportDeliveryDestination { - pub fn new(container: String) -> Self { - Self { - resource_id: None, - container, - root_folder_path: None, - sas_token: None, - storage_account: None, - } - } -} -#[doc = "The delivery information associated with a export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportDeliveryInfo { - #[doc = "This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Azure Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key )."] - pub destination: ExportDeliveryDestination, -} -impl ExportDeliveryInfo { - pub fn new(destination: ExportDeliveryDestination) -> Self { - Self { destination } - } -} -#[doc = "An export execution."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportExecution { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of the export execution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ExportExecution { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Result of listing the execution history of an export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportExecutionListResult { - #[doc = "A list of export executions."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl ExportExecutionListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of the export execution."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportExecutionProperties { - #[doc = "The type of the export execution."] - #[serde(rename = "executionType", default, skip_serializing_if = "Option::is_none")] - pub execution_type: Option, - #[doc = "The last known status of the export execution."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'."] - #[serde(rename = "submittedBy", default, skip_serializing_if = "Option::is_none")] - pub submitted_by: Option, - #[doc = "The time when export was queued to be executed."] - #[serde(rename = "submittedTime", default, with = "azure_core::date::rfc3339::option")] - pub submitted_time: Option, - #[doc = "The time when export was picked up to be executed."] - #[serde(rename = "processingStartTime", default, with = "azure_core::date::rfc3339::option")] - pub processing_start_time: Option, - #[doc = "The time when the export execution finished."] - #[serde(rename = "processingEndTime", default, with = "azure_core::date::rfc3339::option")] - pub processing_end_time: Option, - #[doc = "The name of the exported file."] - #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] - pub file_name: Option, - #[doc = "The common properties of the export."] - #[serde(rename = "runSettings", default, skip_serializing_if = "Option::is_none")] - pub run_settings: Option, - #[doc = "The details of the error."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl ExportExecutionProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod export_execution_properties { - use super::*; - #[doc = "The type of the export execution."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ExecutionType")] - pub enum ExecutionType { - OnDemand, - Scheduled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ExecutionType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ExecutionType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ExecutionType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::OnDemand => serializer.serialize_unit_variant("ExecutionType", 0u32, "OnDemand"), - Self::Scheduled => serializer.serialize_unit_variant("ExecutionType", 1u32, "Scheduled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The last known status of the export execution."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Queued, - InProgress, - Completed, - Failed, - Timeout, - NewDataNotAvailable, - DataNotAvailable, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Queued => serializer.serialize_unit_variant("Status", 0u32, "Queued"), - Self::InProgress => serializer.serialize_unit_variant("Status", 1u32, "InProgress"), - Self::Completed => serializer.serialize_unit_variant("Status", 2u32, "Completed"), - Self::Failed => serializer.serialize_unit_variant("Status", 3u32, "Failed"), - Self::Timeout => serializer.serialize_unit_variant("Status", 4u32, "Timeout"), - Self::NewDataNotAvailable => serializer.serialize_unit_variant("Status", 5u32, "NewDataNotAvailable"), - Self::DataNotAvailable => serializer.serialize_unit_variant("Status", 6u32, "DataNotAvailable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Result of listing exports. It contains a list of available exports in the scope provided."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportListResult { - #[doc = "The list of exports."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl ExportListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of the export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportProperties { - #[serde(flatten)] - pub common_export_properties: CommonExportProperties, - #[doc = "The schedule associated with the export."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub schedule: Option, -} -impl ExportProperties { - pub fn new(common_export_properties: CommonExportProperties) -> Self { - Self { - common_export_properties, - schedule: None, - } - } -} -#[doc = "The start and end date for recurrence schedule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportRecurrencePeriod { - #[doc = "The start date of recurrence."] - #[serde(with = "azure_core::date::rfc3339")] - pub from: time::OffsetDateTime, - #[doc = "The end date of recurrence."] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub to: Option, -} -impl ExportRecurrencePeriod { - pub fn new(from: time::OffsetDateTime) -> Self { - Self { from, to: None } - } -} -#[doc = "The schedule associated with the export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExportSchedule { - #[doc = "The status of the export's schedule. If 'Inactive', the export's schedule is paused."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The schedule recurrence."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub recurrence: Option, - #[doc = "The start and end date for recurrence schedule."] - #[serde(rename = "recurrencePeriod", default, skip_serializing_if = "Option::is_none")] - pub recurrence_period: Option, -} -impl ExportSchedule { - pub fn new() -> Self { - Self::default() - } -} -pub mod export_schedule { - use super::*; - #[doc = "The status of the export's schedule. If 'Inactive', the export's schedule is paused."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Active, - Inactive, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Active => serializer.serialize_unit_variant("Status", 0u32, "Active"), - Self::Inactive => serializer.serialize_unit_variant("Status", 1u32, "Inactive"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The schedule recurrence."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Recurrence")] - pub enum Recurrence { - Daily, - Weekly, - Monthly, - Annually, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Recurrence { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Recurrence { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Recurrence { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Daily => serializer.serialize_unit_variant("Recurrence", 0u32, "Daily"), - Self::Weekly => serializer.serialize_unit_variant("Recurrence", 1u32, "Weekly"), - Self::Monthly => serializer.serialize_unit_variant("Recurrence", 2u32, "Monthly"), - Self::Annually => serializer.serialize_unit_variant("Recurrence", 3u32, "Annually"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExportTimePeriod { - #[doc = "The start date for export data."] - #[serde(with = "azure_core::date::rfc3339")] - pub from: time::OffsetDateTime, - #[doc = "The end date for export data."] - #[serde(with = "azure_core::date::rfc3339")] - pub to: time::OffsetDateTime, -} -impl ExportTimePeriod { - pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { - Self { from, to } - } -} -#[doc = "The definition of data present in the forecast."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ForecastDataset { - #[doc = "The granularity of rows in the forecast."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub granularity: Option, - #[doc = "The configuration of dataset in the query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - #[doc = "Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub aggregation: Option, - #[doc = "The filter expression to be used in the export."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, -} -impl ForecastDataset { - pub fn new() -> Self { - Self::default() - } -} -pub mod forecast_dataset { - use super::*; - #[doc = "The granularity of rows in the forecast."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Granularity")] - pub enum Granularity { - Daily, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Granularity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Granularity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Granularity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The definition of a forecast."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ForecastDefinition { - #[doc = "The type of the forecast."] - #[serde(rename = "type")] - pub type_: forecast_definition::Type, - #[doc = "The time frame for pulling data for the forecast. If custom, then a specific time period must be provided."] - pub timeframe: forecast_definition::Timeframe, - #[doc = "The start and end date for pulling data for the query."] - #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] - pub time_period: Option, - #[doc = "The definition of data present in the forecast."] - pub dataset: ForecastDataset, - #[doc = "a boolean determining if actualCost will be included"] - #[serde(rename = "includeActualCost", default, skip_serializing_if = "Option::is_none")] - pub include_actual_cost: Option, - #[doc = "a boolean determining if FreshPartialCost will be included"] - #[serde(rename = "includeFreshPartialCost", default, skip_serializing_if = "Option::is_none")] - pub include_fresh_partial_cost: Option, -} -impl ForecastDefinition { - pub fn new(type_: forecast_definition::Type, timeframe: forecast_definition::Timeframe, dataset: ForecastDataset) -> Self { - Self { - type_, - timeframe, - time_period: None, - dataset, - include_actual_cost: None, - include_fresh_partial_cost: None, - } - } -} -pub mod forecast_definition { - use super::*; - #[doc = "The type of the forecast."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Usage, - ActualCost, - AmortizedCost, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), - Self::ActualCost => serializer.serialize_unit_variant("Type", 1u32, "ActualCost"), - Self::AmortizedCost => serializer.serialize_unit_variant("Type", 2u32, "AmortizedCost"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The time frame for pulling data for the forecast. If custom, then a specific time period must be provided."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Timeframe")] - pub enum Timeframe { - MonthToDate, - BillingMonthToDate, - TheLastMonth, - TheLastBillingMonth, - WeekToDate, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Timeframe { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Timeframe { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Timeframe { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "MonthToDate"), - Self::BillingMonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "BillingMonthToDate"), - Self::TheLastMonth => serializer.serialize_unit_variant("Timeframe", 2u32, "TheLastMonth"), - Self::TheLastBillingMonth => serializer.serialize_unit_variant("Timeframe", 3u32, "TheLastBillingMonth"), - Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 4u32, "WeekToDate"), - Self::Custom => serializer.serialize_unit_variant("Timeframe", 5u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The definition of a cost detailed report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GenerateDetailedCostReportDefinition { - #[doc = "The type of the detailed report. By default ActualCost is provided"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub metric: Option, - #[doc = "The start and end date for pulling data for the cost detailed report."] - #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] - pub time_period: Option, - #[doc = "Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided."] - #[serde(rename = "billingPeriod", default, skip_serializing_if = "Option::is_none")] - pub billing_period: Option, - #[doc = "Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided."] - #[serde(rename = "invoiceId", default, skip_serializing_if = "Option::is_none")] - pub invoice_id: Option, - #[doc = "Customer Id for Modern (Invoice Id and billing profile is also required for this)."] - #[serde(rename = "customerId", default, skip_serializing_if = "Option::is_none")] - pub customer_id: Option, -} -impl GenerateDetailedCostReportDefinition { - pub fn new() -> Self { - Self::default() - } -} -pub mod generate_detailed_cost_report_definition { - use super::*; - #[doc = "The type of the detailed report. By default ActualCost is provided"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Metric")] - pub enum Metric { - ActualCost, - AmortizedCost, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Metric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Metric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Metric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ActualCost => serializer.serialize_unit_variant("Metric", 0u32, "ActualCost"), - Self::AmortizedCost => serializer.serialize_unit_variant("Metric", 1u32, "AmortizedCost"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature instead. \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GenerateDetailedCostReportErrorResponse { - #[doc = "The details of the error."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl GenerateDetailedCostReportErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The result of the long running operation for cost detailed report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GenerateDetailedCostReportOperationResult { - #[doc = "The id of the long running operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the long running operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the long running operation."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The URL to download the generated report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl GenerateDetailedCostReportOperationResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The status of the long running operation for cost detailed report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GenerateDetailedCostReportOperationStatuses { - #[doc = "The id of the long running operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the long running operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The status of the long running operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The type of the long running operation."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The details of the error."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, - #[doc = "The URL to download the generated report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl GenerateDetailedCostReportOperationStatuses { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The start and end date for pulling data for the cost detailed report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GenerateDetailedCostReportTimePeriod { - #[doc = "The start date to pull data from. example format 2020-03-15"] - pub start: String, - #[doc = "The end date to pull data to. example format 2020-03-15"] - pub end: String, -} -impl GenerateDetailedCostReportTimePeriod { - pub fn new(start: String, end: String) -> Self { - Self { start, end } - } -} -#[doc = "Each KPI must contain a 'type' and 'enabled' key."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KpiProperties { - #[doc = "KPI type (Forecast, Budget)."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "ID of resource related to metric (budget)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "show the KPI in the UI?"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} -impl KpiProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod kpi_properties { - use super::*; - #[doc = "KPI type (Forecast, Budget)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Forecast, - Budget, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Forecast => serializer.serialize_unit_variant("Type", 0u32, "Forecast"), - Self::Budget => serializer.serialize_unit_variant("Type", 1u32, "Budget"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "A Cost management REST API operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Operation { - #[doc = "Operation name: {provider}/{resource}/{operation}."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The object that represents the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, -} -impl Operation { - pub fn new() -> Self { - Self::default() - } -} -pub mod operation { - use super::*; - #[doc = "The object that represents the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Display { - #[doc = "Service provider: Microsoft.CostManagement."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[doc = "Resource on which the operation is performed: Dimensions, Query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "Operation type: Read, write, delete, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, - } - impl Display { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OperationListResult { - #[doc = "List of cost management operations supported by the Microsoft.CostManagement resource provider."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to get the next set of operation list results if there are any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for OperationListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl OperationListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Each pivot must contain a 'type' and 'name'."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PivotProperties { - #[doc = "Data type to show in view."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Data field to show in view."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, -} -impl PivotProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod pivot_properties { - use super::*; - #[doc = "Data type to show in view."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Dimension, - TagKey, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Dimension => serializer.serialize_unit_variant("Type", 0u32, "Dimension"), - Self::TagKey => serializer.serialize_unit_variant("Type", 1u32, "TagKey"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The Resource model definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProxyResource { - #[doc = "Resource Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not."] - #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] - pub e_tag: Option, -} -impl ProxyResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The aggregation expression to be used in the query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryAggregation { - #[doc = "The name of the column to aggregate."] - pub name: String, - #[doc = "The name of the aggregation function to use."] - pub function: query_aggregation::Function, -} -impl QueryAggregation { - pub fn new(name: String, function: query_aggregation::Function) -> Self { - Self { name, function } - } -} -pub mod query_aggregation { - use super::*; - #[doc = "The name of the aggregation function to use."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Function")] - pub enum Function { - Sum, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Function { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Function { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Function { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Sum => serializer.serialize_unit_variant("Function", 0u32, "Sum"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryColumn { - #[doc = "The name of column."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of column."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl QueryColumn { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The type of the column in the export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "QueryColumnType")] -pub enum QueryColumnType { - Tag, - Dimension, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for QueryColumnType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for QueryColumnType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for QueryColumnType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Tag => serializer.serialize_unit_variant("QueryColumnType", 0u32, "Tag"), - Self::Dimension => serializer.serialize_unit_variant("QueryColumnType", 1u32, "Dimension"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The comparison expression to be used in the query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryComparisonExpression { - #[doc = "The name of the column to use in comparison."] - pub name: String, - #[doc = "The operator to use for comparison."] - pub operator: query_comparison_expression::Operator, - #[doc = "Array of values to use for comparison"] - pub values: Vec, -} -impl QueryComparisonExpression { - pub fn new(name: String, operator: query_comparison_expression::Operator, values: Vec) -> Self { - Self { name, operator, values } - } -} -pub mod query_comparison_expression { - use super::*; - #[doc = "The operator to use for comparison."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Operator")] - pub enum Operator { - In, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Operator { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Operator { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Operator { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::In => serializer.serialize_unit_variant("Operator", 0u32, "In"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The definition of data present in the query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryDataset { - #[doc = "The granularity of rows in the query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub granularity: Option, - #[doc = "The configuration of dataset in the query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - #[doc = "Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub aggregation: Option, - #[doc = "Array of group by expression to use in the query. Query can have up to 2 group by clauses."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub grouping: Vec, - #[doc = "The filter expression to be used in the export."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, -} -impl QueryDataset { - pub fn new() -> Self { - Self::default() - } -} -pub mod query_dataset { - use super::*; - #[doc = "The granularity of rows in the query."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Granularity")] - pub enum Granularity { - Daily, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Granularity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Granularity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Granularity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The configuration of dataset in the query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryDatasetConfiguration { - #[doc = "Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub columns: Vec, -} -impl QueryDatasetConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The definition of a query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryDefinition { - #[doc = "The type of the query."] - #[serde(rename = "type")] - pub type_: query_definition::Type, - #[doc = "The time frame for pulling data for the query. If custom, then a specific time period must be provided."] - pub timeframe: query_definition::Timeframe, - #[doc = "The start and end date for pulling data for the query."] - #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] - pub time_period: Option, - #[doc = "The definition of data present in the query."] - pub dataset: QueryDataset, -} -impl QueryDefinition { - pub fn new(type_: query_definition::Type, timeframe: query_definition::Timeframe, dataset: QueryDataset) -> Self { - Self { - type_, - timeframe, - time_period: None, - dataset, - } - } -} -pub mod query_definition { - use super::*; - #[doc = "The type of the query."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Usage, - ActualCost, - AmortizedCost, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), - Self::ActualCost => serializer.serialize_unit_variant("Type", 1u32, "ActualCost"), - Self::AmortizedCost => serializer.serialize_unit_variant("Type", 2u32, "AmortizedCost"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The time frame for pulling data for the query. If custom, then a specific time period must be provided."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Timeframe")] - pub enum Timeframe { - MonthToDate, - BillingMonthToDate, - TheLastMonth, - TheLastBillingMonth, - WeekToDate, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Timeframe { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Timeframe { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Timeframe { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "MonthToDate"), - Self::BillingMonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "BillingMonthToDate"), - Self::TheLastMonth => serializer.serialize_unit_variant("Timeframe", 2u32, "TheLastMonth"), - Self::TheLastBillingMonth => serializer.serialize_unit_variant("Timeframe", 3u32, "TheLastBillingMonth"), - Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 4u32, "WeekToDate"), - Self::Custom => serializer.serialize_unit_variant("Timeframe", 5u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The filter expression to be used in the export."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryFilter { - #[doc = "The logical \"AND\" expression. Must have at least 2 items."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub and: Vec, - #[doc = "The logical \"OR\" expression. Must have at least 2 items."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub or: Vec, - #[doc = "The filter expression to be used in the export."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub not: Box>, - #[doc = "The comparison expression to be used in the query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dimension: Option, - #[doc = "The comparison expression to be used in the query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag: Option, -} -impl QueryFilter { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The group by expression to be used in the query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryGrouping { - #[doc = "The type of the column in the export."] - #[serde(rename = "type")] - pub type_: QueryColumnType, - #[doc = "The name of the column to group."] - pub name: String, -} -impl QueryGrouping { - pub fn new(type_: QueryColumnType, name: String) -> Self { - Self { type_, name } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryProperties { - #[doc = "The link (url) to the next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, - #[doc = "Array of columns"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub columns: Vec, - #[doc = "Array of rows"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub rows: Vec>, -} -impl QueryProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Result of query. It contains all columns listed under groupings and aggregation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryResult { - #[serde(flatten)] - pub resource: Resource, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl QueryResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The start and end date for pulling data for the query."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct QueryTimePeriod { - #[doc = "The start date to pull data from."] - #[serde(with = "azure_core::date::rfc3339")] - pub from: time::OffsetDateTime, - #[doc = "The end date to pull data to."] - #[serde(with = "azure_core::date::rfc3339")] - pub to: time::OffsetDateTime, -} -impl QueryTimePeriod { - pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { - Self { from, to } - } -} -#[doc = "The aggregation expression to be used in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReportConfigAggregation { - #[doc = "The name of the column to aggregate."] - pub name: String, - #[doc = "The name of the aggregation function to use."] - pub function: report_config_aggregation::Function, -} -impl ReportConfigAggregation { - pub fn new(name: String, function: report_config_aggregation::Function) -> Self { - Self { name, function } - } -} -pub mod report_config_aggregation { - use super::*; - #[doc = "The name of the aggregation function to use."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Function")] - pub enum Function { - Sum, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Function { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Function { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Function { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Sum => serializer.serialize_unit_variant("Function", 0u32, "Sum"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The type of the column in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ReportConfigColumnType")] -pub enum ReportConfigColumnType { - Tag, - Dimension, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ReportConfigColumnType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ReportConfigColumnType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ReportConfigColumnType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Tag => serializer.serialize_unit_variant("ReportConfigColumnType", 0u32, "Tag"), - Self::Dimension => serializer.serialize_unit_variant("ReportConfigColumnType", 1u32, "Dimension"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The comparison expression to be used in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReportConfigComparisonExpression { - #[doc = "The name of the column to use in comparison."] - pub name: String, - #[doc = "The operator to use for comparison."] - pub operator: report_config_comparison_expression::Operator, - #[doc = "Array of values to use for comparison"] - pub values: Vec, -} -impl ReportConfigComparisonExpression { - pub fn new(name: String, operator: report_config_comparison_expression::Operator, values: Vec) -> Self { - Self { name, operator, values } - } -} -pub mod report_config_comparison_expression { - use super::*; - #[doc = "The operator to use for comparison."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Operator")] - pub enum Operator { - In, - Contains, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Operator { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Operator { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Operator { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::In => serializer.serialize_unit_variant("Operator", 0u32, "In"), - Self::Contains => serializer.serialize_unit_variant("Operator", 1u32, "Contains"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The definition of data present in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ReportConfigDataset { - #[doc = "The granularity of rows in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub granularity: Option, - #[doc = "The configuration of dataset in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - #[doc = "Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub aggregation: Option, - #[doc = "Array of group by expression to use in the report. Report can have up to 2 group by clauses."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub grouping: Vec, - #[doc = "Array of order by expression to use in the report."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub sorting: Vec, - #[doc = "The filter expression to be used in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub filter: Option, -} -impl ReportConfigDataset { - pub fn new() -> Self { - Self::default() - } -} -pub mod report_config_dataset { - use super::*; - #[doc = "The granularity of rows in the report."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Granularity")] - pub enum Granularity { - Daily, - Monthly, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Granularity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Granularity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Granularity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), - Self::Monthly => serializer.serialize_unit_variant("Granularity", 1u32, "Monthly"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The configuration of dataset in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ReportConfigDatasetConfiguration { - #[doc = "Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub columns: Vec, -} -impl ReportConfigDatasetConfiguration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The definition of a report config."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReportConfigDefinition { - #[doc = "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates."] - #[serde(rename = "type")] - pub type_: report_config_definition::Type, - #[doc = "The time frame for pulling data for the report. If custom, then a specific time period must be provided."] - pub timeframe: report_config_definition::Timeframe, - #[doc = "The start and end date for pulling data for the report."] - #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] - pub time_period: Option, - #[doc = "The definition of data present in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dataset: Option, -} -impl ReportConfigDefinition { - pub fn new(type_: report_config_definition::Type, timeframe: report_config_definition::Timeframe) -> Self { - Self { - type_, - timeframe, - time_period: None, - dataset: None, - } - } -} -pub mod report_config_definition { - use super::*; - #[doc = "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Usage, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The time frame for pulling data for the report. If custom, then a specific time period must be provided."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Timeframe")] - pub enum Timeframe { - WeekToDate, - MonthToDate, - YearToDate, - Custom, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Timeframe { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Timeframe { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Timeframe { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "WeekToDate"), - Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "MonthToDate"), - Self::YearToDate => serializer.serialize_unit_variant("Timeframe", 2u32, "YearToDate"), - Self::Custom => serializer.serialize_unit_variant("Timeframe", 3u32, "Custom"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The filter expression to be used in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ReportConfigFilter { - #[doc = "The logical \"AND\" expression. Must have at least 2 items."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub and: Vec, - #[doc = "The logical \"OR\" expression. Must have at least 2 items."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub or: Vec, - #[doc = "The filter expression to be used in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub not: Box>, - #[doc = "The comparison expression to be used in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dimension: Option, - #[doc = "The comparison expression to be used in the report."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag: Option, -} -impl ReportConfigFilter { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The group by expression to be used in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReportConfigGrouping { - #[doc = "The type of the column in the report."] - #[serde(rename = "type")] - pub type_: ReportConfigColumnType, - #[doc = "The name of the column to group. This version supports subscription lowest possible grain."] - pub name: String, -} -impl ReportConfigGrouping { - pub fn new(type_: ReportConfigColumnType, name: String) -> Self { - Self { type_, name } - } -} -#[doc = "The order by expression to be used in the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReportConfigSorting { - #[doc = "Direction of sort."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub direction: Option, - #[doc = "The name of the column to sort."] - pub name: String, -} -impl ReportConfigSorting { - pub fn new(name: String) -> Self { - Self { direction: None, name } - } -} -pub mod report_config_sorting { - use super::*; - #[doc = "Direction of sort."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Direction { - Ascending, - Descending, - } -} -#[doc = "The start and end date for pulling data for the report."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReportConfigTimePeriod { - #[doc = "The start date to pull data from."] - #[serde(with = "azure_core::date::rfc3339")] - pub from: time::OffsetDateTime, - #[doc = "The end date to pull data to."] - #[serde(with = "azure_core::date::rfc3339")] - pub to: time::OffsetDateTime, -} -impl ReportConfigTimePeriod { - pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { - Self { from, to } - } -} -#[doc = "The Resource model definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Resource Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The status of the long running operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Status { - #[doc = "The status of the long running operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl Status { - pub fn new() -> Self { - Self::default() - } -} -pub mod status { - use super::*; - #[doc = "The status of the long running operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - InProgress, - Completed, - Failed, - Queued, - NoDataFound, - ReadyToDownload, - TimedOut, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::InProgress => serializer.serialize_unit_variant("Status", 0u32, "InProgress"), - Self::Completed => serializer.serialize_unit_variant("Status", 1u32, "Completed"), - Self::Failed => serializer.serialize_unit_variant("Status", 2u32, "Failed"), - Self::Queued => serializer.serialize_unit_variant("Status", 3u32, "Queued"), - Self::NoDataFound => serializer.serialize_unit_variant("Status", 4u32, "NoDataFound"), - Self::ReadyToDownload => serializer.serialize_unit_variant("Status", 5u32, "ReadyToDownload"), - Self::TimedOut => serializer.serialize_unit_variant("Status", 6u32, "TimedOut"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "States and configurations of Cost Analysis."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct View { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of the view."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl View { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Result of listing views. It contains a list of available views."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ViewListResult { - #[doc = "The list of views."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The link (url) to the next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ViewListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ViewListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of the view."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ViewProperties { - #[doc = "User input name of the view. Required."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, - #[doc = "Date the user created this view."] - #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] - pub created_on: Option, - #[doc = "Date when the user last modified this view."] - #[serde(rename = "modifiedOn", default, with = "azure_core::date::rfc3339::option")] - pub modified_on: Option, - #[doc = "The definition of a report config."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, - #[doc = "Chart type of the main view in Cost Analysis. Required."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub chart: Option, - #[doc = "Show costs accumulated over time."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub accumulated: Option, - #[doc = "Metric to use when displaying costs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub metric: Option, - #[doc = "List of KPIs to show in Cost Analysis UI."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub kpis: Vec, - #[doc = "Configuration of 3 sub-views in the Cost Analysis UI."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub pivots: Vec, -} -impl ViewProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod view_properties { - use super::*; - #[doc = "Chart type of the main view in Cost Analysis. Required."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Chart")] - pub enum Chart { - Area, - Line, - StackedColumn, - GroupedColumn, - Table, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Chart { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Chart { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Chart { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Area => serializer.serialize_unit_variant("Chart", 0u32, "Area"), - Self::Line => serializer.serialize_unit_variant("Chart", 1u32, "Line"), - Self::StackedColumn => serializer.serialize_unit_variant("Chart", 2u32, "StackedColumn"), - Self::GroupedColumn => serializer.serialize_unit_variant("Chart", 3u32, "GroupedColumn"), - Self::Table => serializer.serialize_unit_variant("Chart", 4u32, "Table"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Show costs accumulated over time."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Accumulated")] - pub enum Accumulated { - #[serde(rename = "true")] - True, - #[serde(rename = "false")] - False, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Accumulated { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Accumulated { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Accumulated { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::True => serializer.serialize_unit_variant("Accumulated", 0u32, "true"), - Self::False => serializer.serialize_unit_variant("Accumulated", 1u32, "false"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Metric to use when displaying costs."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Metric")] - pub enum Metric { - ActualCost, - AmortizedCost, - #[serde(rename = "AHUB")] - Ahub, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Metric { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Metric { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Metric { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ActualCost => serializer.serialize_unit_variant("Metric", 0u32, "ActualCost"), - Self::AmortizedCost => serializer.serialize_unit_variant("Metric", 1u32, "AmortizedCost"), - Self::Ahub => serializer.serialize_unit_variant("Metric", 2u32, "AHUB"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/costmanagement/src/package_preview_2022_04/mod.rs b/services/mgmt/costmanagement/src/package_preview_2022_04/mod.rs index e2757c8bfc..d6886b019e 100644 --- a/services/mgmt/costmanagement/src/package_preview_2022_04/mod.rs +++ b/services/mgmt/costmanagement/src/package_preview_2022_04/mod.rs @@ -3227,7 +3227,7 @@ pub mod generate_reservation_details_report { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] + #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `billing_account_id`: Enrollment ID (Legacy BillingAccount ID)"] @@ -3246,7 +3246,7 @@ pub mod generate_reservation_details_report { end_date: end_date.into(), } } - #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] + #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `billing_account_id`: BillingAccount ID"] diff --git a/services/mgmt/costmanagement/src/package_preview_2022_06/mod.rs b/services/mgmt/costmanagement/src/package_preview_2022_06/mod.rs index 82731e9f75..d9a94513fd 100644 --- a/services/mgmt/costmanagement/src/package_preview_2022_06/mod.rs +++ b/services/mgmt/costmanagement/src/package_preview_2022_06/mod.rs @@ -3227,7 +3227,7 @@ pub mod generate_reservation_details_report { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] + #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `billing_account_id`: Enrollment ID (Legacy BillingAccount ID)"] @@ -3246,7 +3246,7 @@ pub mod generate_reservation_details_report { end_date: end_date.into(), } } - #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] + #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `billing_account_id`: BillingAccount ID"] diff --git a/services/mgmt/costmanagement/src/package_preview_2022_08/mod.rs b/services/mgmt/costmanagement/src/package_preview_2022_08/mod.rs index df1e79f6d3..04bf280fb3 100644 --- a/services/mgmt/costmanagement/src/package_preview_2022_08/mod.rs +++ b/services/mgmt/costmanagement/src/package_preview_2022_08/mod.rs @@ -2091,7 +2091,7 @@ pub mod generate_reservation_details_report { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] + #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `billing_account_id`: Enrollment ID (Legacy BillingAccount ID)"] @@ -2110,7 +2110,7 @@ pub mod generate_reservation_details_report { end_date: end_date.into(), } } - #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] + #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `billing_account_id`: BillingAccount ID"] diff --git a/services/mgmt/costmanagement/src/package_preview_2023_04/mod.rs b/services/mgmt/costmanagement/src/package_preview_2023_04/mod.rs new file mode 100644 index 0000000000..c1aaeb7c97 --- /dev/null +++ b/services/mgmt/costmanagement/src/package_preview_2023_04/mod.rs @@ -0,0 +1,6090 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn alerts_client(&self) -> alerts::Client { + alerts::Client(self.clone()) + } + pub fn benefit_recommendations_client(&self) -> benefit_recommendations::Client { + benefit_recommendations::Client(self.clone()) + } + pub fn benefit_utilization_summaries_client(&self) -> benefit_utilization_summaries::Client { + benefit_utilization_summaries::Client(self.clone()) + } + pub fn budgets_client(&self) -> budgets::Client { + budgets::Client(self.clone()) + } + pub fn dimensions_client(&self) -> dimensions::Client { + dimensions::Client(self.clone()) + } + pub fn exports_client(&self) -> exports::Client { + exports::Client(self.clone()) + } + pub fn forecast_client(&self) -> forecast::Client { + forecast::Client(self.clone()) + } + pub fn generate_cost_details_report_client(&self) -> generate_cost_details_report::Client { + generate_cost_details_report::Client(self.clone()) + } + pub fn generate_detailed_cost_report_client(&self) -> generate_detailed_cost_report::Client { + generate_detailed_cost_report::Client(self.clone()) + } + pub fn generate_detailed_cost_report_operation_results_client(&self) -> generate_detailed_cost_report_operation_results::Client { + generate_detailed_cost_report_operation_results::Client(self.clone()) + } + pub fn generate_detailed_cost_report_operation_status_client(&self) -> generate_detailed_cost_report_operation_status::Client { + generate_detailed_cost_report_operation_status::Client(self.clone()) + } + pub fn generate_reservation_details_report_client(&self) -> generate_reservation_details_report::Client { + generate_reservation_details_report::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn price_sheet_client(&self) -> price_sheet::Client { + price_sheet::Client(self.clone()) + } + pub fn query_client(&self) -> query::Client { + query::Client(self.clone()) + } + pub fn scheduled_actions_client(&self) -> scheduled_actions::Client { + scheduled_actions::Client(self.clone()) + } + pub fn views_client(&self) -> views::Client { + views::Client(self.clone()) + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available cost management REST API operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.CostManagement/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod benefit_recommendations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of recommendations for purchasing savings plan."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_scope`: The scope associated with benefit recommendation operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for enterprise agreement scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billing profile scope"] + pub fn list(&self, billing_scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + billing_scope: billing_scope.into(), + filter: None, + orderby: None, + expand: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BenefitRecommendationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_scope: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "May be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default. There is no need to use this clause."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "May be used to expand the properties by: properties/usage, properties/allRecommendationDetails"] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/benefitRecommendations", + this.client.endpoint(), + &this.billing_scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod benefit_utilization_summaries { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists savings plan utilization summaries for the enterprise agreement scope. Supported at grain values: 'Daily' and 'Monthly'."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_account_id`: Billing account ID"] + pub fn list_by_billing_account_id(&self, billing_account_id: impl Into) -> list_by_billing_account_id::RequestBuilder { + list_by_billing_account_id::RequestBuilder { + client: self.0.clone(), + billing_account_id: billing_account_id.into(), + grain_parameter: None, + filter: None, + } + } + #[doc = "Lists savings plan utilization summaries for billing profile. Supported at grain values: 'Daily' and 'Monthly'."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_account_id`: Billing account ID"] + #[doc = "* `billing_profile_id`: Billing profile ID."] + pub fn list_by_billing_profile_id( + &self, + billing_account_id: impl Into, + billing_profile_id: impl Into, + ) -> list_by_billing_profile_id::RequestBuilder { + list_by_billing_profile_id::RequestBuilder { + client: self.0.clone(), + billing_account_id: billing_account_id.into(), + billing_profile_id: billing_profile_id.into(), + grain_parameter: None, + filter: None, + } + } + #[doc = "Lists the savings plan utilization summaries for daily or monthly grain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `savings_plan_order_id`: Savings plan order ID."] + pub fn list_by_savings_plan_order(&self, savings_plan_order_id: impl Into) -> list_by_savings_plan_order::RequestBuilder { + list_by_savings_plan_order::RequestBuilder { + client: self.0.clone(), + savings_plan_order_id: savings_plan_order_id.into(), + filter: None, + grain_parameter: None, + } + } + #[doc = "Lists the savings plan utilization summaries for daily or monthly grain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `savings_plan_order_id`: Savings plan order ID."] + #[doc = "* `savings_plan_id`: Savings plan ID."] + pub fn list_by_savings_plan_id( + &self, + savings_plan_order_id: impl Into, + savings_plan_id: impl Into, + ) -> list_by_savings_plan_id::RequestBuilder { + list_by_savings_plan_id::RequestBuilder { + client: self.0.clone(), + savings_plan_order_id: savings_plan_order_id.into(), + savings_plan_id: savings_plan_id.into(), + filter: None, + grain_parameter: None, + } + } + } + pub mod list_by_billing_account_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BenefitUtilizationSummariesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_account_id: String, + pub(crate) grain_parameter: Option, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "Grain."] + pub fn grain_parameter(mut self, grain_parameter: impl Into) -> Self { + self.grain_parameter = Some(grain_parameter.into()); + self + } + #[doc = "Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.Billing/billingAccounts/{}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" , this . client . endpoint () , & this . billing_account_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(grain_parameter) = &this.grain_parameter { + req.url_mut().query_pairs_mut().append_pair("grainParameter", grain_parameter); + } + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_billing_profile_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BenefitUtilizationSummariesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_account_id: String, + pub(crate) billing_profile_id: String, + pub(crate) grain_parameter: Option, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "Grain."] + pub fn grain_parameter(mut self, grain_parameter: impl Into) -> Self { + self.grain_parameter = Some(grain_parameter.into()); + self + } + #[doc = "Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.Billing/billingAccounts/{}/billingProfiles/{}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" , this . client . endpoint () , & this . billing_account_id , & this . billing_profile_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(grain_parameter) = &this.grain_parameter { + req.url_mut().query_pairs_mut().append_pair("grainParameter", grain_parameter); + } + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_savings_plan_order { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BenefitUtilizationSummariesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) savings_plan_order_id: String, + pub(crate) filter: Option, + pub(crate) grain_parameter: Option, + } + impl RequestBuilder { + #[doc = "Supports filtering by properties/usageDate."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Grain."] + pub fn grain_parameter(mut self, grain_parameter: impl Into) -> Self { + self.grain_parameter = Some(grain_parameter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.BillingBenefits/savingsPlanOrders/{}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" , this . client . endpoint () , & this . savings_plan_order_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(grain_parameter) = &this.grain_parameter { + req.url_mut().query_pairs_mut().append_pair("grainParameter", grain_parameter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_savings_plan_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BenefitUtilizationSummariesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) savings_plan_order_id: String, + pub(crate) savings_plan_id: String, + pub(crate) filter: Option, + pub(crate) grain_parameter: Option, + } + impl RequestBuilder { + #[doc = "Supports filtering by properties/usageDate."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Grain."] + pub fn grain_parameter(mut self, grain_parameter: impl Into) -> Self { + self.grain_parameter = Some(grain_parameter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.BillingBenefits/savingsPlanOrders/{}/savingsPlans/{}/providers/Microsoft.CostManagement/benefitUtilizationSummaries" , this . client . endpoint () , & this . savings_plan_order_id , & this . savings_plan_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(grain_parameter) = &this.grain_parameter { + req.url_mut().query_pairs_mut().append_pair("grainParameter", grain_parameter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod budgets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all budgets for the defined scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with budget operations.\n\n Supported scopes for **CategoryType: Cost**\n\n Azure RBAC Scopes:\n- '/subscriptions/{subscriptionId}/' for subscription scope\n- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope\n- '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope\n\n EA (Enterprise Agreement) Scopes:\n\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n\n MCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)\n\n Supported scopes for **CategoryType: ReservationUtilization**\n\n EA (Enterprise Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope\n\nMCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)"] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + filter: None, + } + } + #[doc = "Gets the budget for the scope by budget name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with budget operations.\n\n Supported scopes for **CategoryType: Cost**\n\n Azure RBAC Scopes:\n- '/subscriptions/{subscriptionId}/' for subscription scope\n- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope\n- '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope\n\n EA (Enterprise Agreement) Scopes:\n\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n\n MCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)\n\n Supported scopes for **CategoryType: ReservationUtilization**\n\n EA (Enterprise Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope\n\nMCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)"] + #[doc = "* `budget_name`: Budget Name."] + pub fn get(&self, scope: impl Into, budget_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + budget_name: budget_name.into(), + } + } + #[doc = "The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with budget operations.\n\n Supported scopes for **CategoryType: Cost**\n\n Azure RBAC Scopes:\n- '/subscriptions/{subscriptionId}/' for subscription scope\n- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope\n- '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope\n\n EA (Enterprise Agreement) Scopes:\n\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n\n MCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)\n\n Supported scopes for **CategoryType: ReservationUtilization**\n\n EA (Enterprise Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope\n\nMCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)"] + #[doc = "* `budget_name`: Budget Name."] + #[doc = "* `parameters`: Parameters supplied to the Create Budget operation."] + pub fn create_or_update( + &self, + scope: impl Into, + budget_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + budget_name: budget_name.into(), + parameters: parameters.into(), + } + } + #[doc = "The operation to delete a budget."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with budget operations.\n\n Supported scopes for **CategoryType: Cost**\n\n Azure RBAC Scopes:\n- '/subscriptions/{subscriptionId}/' for subscription scope\n- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope\n- '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope\n\n EA (Enterprise Agreement) Scopes:\n\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n\n MCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)\n\n Supported scopes for **CategoryType: ReservationUtilization**\n\n EA (Enterprise Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope\n\nMCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope (non-CSP only)\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)"] + #[doc = "* `budget_name`: Budget Name."] + pub fn delete(&self, scope: impl Into, budget_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + budget_name: budget_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BudgetsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' only."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/budgets", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Budget = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) budget_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/budgets/{}", + this.client.endpoint(), + &this.scope, + &this.budget_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Budget = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) budget_name: String, + pub(crate) parameters: models::Budget, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/budgets/{}", + this.client.endpoint(), + &this.scope, + &this.budget_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) budget_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/budgets/{}", + this.client.endpoint(), + &this.scope, + &this.budget_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod exports { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The operation to list all exports at the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + expand: None, + } + } + #[doc = "The operation to get the export for the defined scope by export name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `export_name`: Export Name."] + pub fn get(&self, scope: impl Into, export_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + export_name: export_name.into(), + expand: None, + } + } + #[doc = "The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `export_name`: Export Name."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Export operation."] + pub fn create_or_update( + &self, + scope: impl Into, + export_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + export_name: export_name.into(), + parameters: parameters.into(), + } + } + #[doc = "The operation to delete a export."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `export_name`: Export Name."] + pub fn delete(&self, scope: impl Into, export_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + export_name: export_name.into(), + } + } + #[doc = "The operation to run an export."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `export_name`: Export Name."] + pub fn execute(&self, scope: impl Into, export_name: impl Into) -> execute::RequestBuilder { + execute::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + export_name: export_name.into(), + } + } + #[doc = "The operation to get the run history of an export for the defined scope and export name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `export_name`: Export Name."] + pub fn get_execution_history( + &self, + scope: impl Into, + export_name: impl Into, + ) -> get_execution_history::RequestBuilder { + get_execution_history::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + export_name: export_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExportListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last run of each export."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/exports", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Export = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) export_name: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 runs of the export."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/exports/{}", + this.client.endpoint(), + &this.scope, + &this.export_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Export = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) export_name: String, + pub(crate) parameters: models::Export, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/exports/{}", + this.client.endpoint(), + &this.scope, + &this.export_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) export_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/exports/{}", + this.client.endpoint(), + &this.scope, + &this.export_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) export_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/exports/{}/run", + this.client.endpoint(), + &this.scope, + &this.export_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_execution_history { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExportExecutionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) export_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/exports/{}/runHistory", + this.client.endpoint(), + &this.scope, + &this.export_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod generate_cost_details_report { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202 with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll to get the result of the report generation. The 'Retry-After' provides the duration to wait before polling for the generated report. A call to poll the report operation will provide a 202 response with a 'Location' header if the operation is still in progress. Once the report generation operation completes, the polling endpoint will provide a 200 response along with details on the report blob(s) that are available for download. The details on the file(s) available for download will be available in the polling response body."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes."] + #[doc = "* `parameters`: Parameters supplied to the Create cost details operation."] + pub fn create_operation( + &self, + scope: impl Into, + parameters: impl Into, + ) -> create_operation::RequestBuilder { + create_operation::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + parameters: parameters.into(), + } + } + #[doc = "Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes."] + #[doc = "* `operation_id`: The target operation Id."] + pub fn get_operation_results( + &self, + scope: impl Into, + operation_id: impl Into, + ) -> get_operation_results::RequestBuilder { + get_operation_results::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + operation_id: operation_id.into(), + } + } + } + pub mod create_operation { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CostDetailsOperationResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "The URL to check the result of the asynchronous operation."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) parameters: models::GenerateCostDetailsReportRequestDefinition, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/generateCostDetailsReport", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_operation_results { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CostDetailsOperationResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/costDetailsOperationResults/{}", + this.client.endpoint(), + &this.scope, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod generate_detailed_cost_report { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Generates the detailed cost report for provided date range, billing period(only enterprise customers) or Invoice ID asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes."] + #[doc = "* `parameters`: Parameters supplied to the Create detailed cost report operation."] + pub fn create_operation( + &self, + scope: impl Into, + parameters: impl Into, + ) -> create_operation::RequestBuilder { + create_operation::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + parameters: parameters.into(), + } + } + } + pub mod create_operation { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GenerateDetailedCostReportOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "The URL to check the result of the asynchronous operation."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "The URL to check the status of the asynchronous operation."] + pub fn azure_consumption_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-consumption-asyncoperation")) + } + #[doc = "The URL to check the status of the asynchronous operation."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + #[doc = "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) parameters: models::GenerateDetailedCostReportDefinition, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/generateDetailedCostReport", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod generate_detailed_cost_report_operation_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the result of the specified operation. The link with this operationId is provided as a response header of the initial request."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `operation_id`: The target operation Id."] + #[doc = "* `scope`: The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes."] + pub fn get(&self, operation_id: impl Into, scope: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + operation_id: operation_id.into(), + scope: scope.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GenerateDetailedCostReportOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) operation_id: String, + pub(crate) scope: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/operationResults/{}", + this.client.endpoint(), + &this.scope, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod generate_detailed_cost_report_operation_status { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `operation_id`: The target operation Id."] + #[doc = "* `scope`: The ARM Resource ID for subscription, resource group, billing account, or other billing scopes. For details, see https://aka.ms/costmgmt/scopes."] + pub fn get(&self, operation_id: impl Into, scope: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + operation_id: operation_id.into(), + scope: scope.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GenerateDetailedCostReportOperationStatuses = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) operation_id: String, + pub(crate) scope: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/operationStatus/{}", + this.client.endpoint(), + &this.scope, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod views { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all views by tenant and object."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "Lists all views at the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] + pub fn list_by_scope(&self, scope: impl Into) -> list_by_scope::RequestBuilder { + list_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Gets the view by view name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `view_name`: View name"] + pub fn get(&self, view_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + view_name: view_name.into(), + } + } + #[doc = "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `view_name`: View name"] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate View operation."] + pub fn create_or_update( + &self, + view_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + view_name: view_name.into(), + parameters: parameters.into(), + } + } + #[doc = "The operation to delete a view."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `view_name`: View name"] + pub fn delete(&self, view_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + view_name: view_name.into(), + } + } + #[doc = "Gets the view for the defined scope by view name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] + #[doc = "* `view_name`: View name"] + pub fn get_by_scope(&self, scope: impl Into, view_name: impl Into) -> get_by_scope::RequestBuilder { + get_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + view_name: view_name.into(), + } + } + #[doc = "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] + #[doc = "* `view_name`: View name"] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate View operation."] + pub fn create_or_update_by_scope( + &self, + scope: impl Into, + view_name: impl Into, + parameters: impl Into, + ) -> create_or_update_by_scope::RequestBuilder { + create_or_update_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + view_name: view_name.into(), + parameters: parameters.into(), + } + } + #[doc = "The operation to delete a view."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope."] + #[doc = "* `view_name`: View name"] + pub fn delete_by_scope(&self, scope: impl Into, view_name: impl Into) -> delete_by_scope::RequestBuilder { + delete_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + view_name: view_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ViewListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.CostManagement/views", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ViewListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/views", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::View = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) view_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/views/{}", + this.client.endpoint(), + &this.view_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::View = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) view_name: String, + pub(crate) parameters: models::View, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/views/{}", + this.client.endpoint(), + &this.view_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) view_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/views/{}", + this.client.endpoint(), + &this.view_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::View = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) view_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/views/{}", + this.client.endpoint(), + &this.scope, + &this.view_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::View = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) view_name: String, + pub(crate) parameters: models::View, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/views/{}", + this.client.endpoint(), + &this.scope, + &this.view_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_by_scope { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) view_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/views/{}", + this.client.endpoint(), + &this.scope, + &this.view_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod alerts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the alerts for scope defined."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Gets the alert for the scope by alert ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `alert_id`: Alert ID"] + pub fn get(&self, scope: impl Into, alert_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + alert_id: alert_id.into(), + } + } + #[doc = "Dismisses the specified alert"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `alert_id`: Alert ID"] + #[doc = "* `parameters`: Parameters supplied to the Dismiss Alert operation."] + pub fn dismiss( + &self, + scope: impl Into, + alert_id: impl Into, + parameters: impl Into, + ) -> dismiss::RequestBuilder { + dismiss::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + alert_id: alert_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Lists the Alerts for external cloud provider type defined."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] + #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] + pub fn list_external( + &self, + external_cloud_provider_type: impl Into, + external_cloud_provider_id: impl Into, + ) -> list_external::RequestBuilder { + list_external::RequestBuilder { + client: self.0.clone(), + external_cloud_provider_type: external_cloud_provider_type.into(), + external_cloud_provider_id: external_cloud_provider_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/alerts", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) alert_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/alerts/{}", + this.client.endpoint(), + &this.scope, + &this.alert_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod dismiss { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) alert_id: String, + pub(crate) parameters: models::DismissAlertPayload, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/alerts/{}", + this.client.endpoint(), + &this.scope, + &this.alert_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_external { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) external_cloud_provider_type: String, + pub(crate) external_cloud_provider_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/{}/{}/alerts", + this.client.endpoint(), + &this.external_cloud_provider_type, + &this.external_cloud_provider_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod forecast { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the forecast charges for scope defined."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Forecast Config operation."] + pub fn usage(&self, scope: impl Into, parameters: impl Into) -> usage::RequestBuilder { + usage::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + parameters: parameters.into(), + filter: None, + } + } + #[doc = "Lists the forecast charges for external cloud provider type defined."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] + #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Forecast Config operation."] + pub fn external_cloud_provider_usage( + &self, + external_cloud_provider_type: impl Into, + external_cloud_provider_id: impl Into, + parameters: impl Into, + ) -> external_cloud_provider_usage::RequestBuilder { + external_cloud_provider_usage::RequestBuilder { + client: self.0.clone(), + external_cloud_provider_type: external_cloud_provider_type.into(), + external_cloud_provider_id: external_cloud_provider_id.into(), + parameters: parameters.into(), + filter: None, + } + } + } + pub mod usage { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ForecastResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) parameters: models::ForecastDefinition, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/forecast", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod external_cloud_provider_usage { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ForecastResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) external_cloud_provider_type: String, + pub(crate) external_cloud_provider_id: String, + pub(crate) parameters: models::ForecastDefinition, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/{}/{}/forecast", + this.client.endpoint(), + &this.external_cloud_provider_type, + &this.external_cloud_provider_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod dimensions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the dimensions by the defined scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + filter: None, + expand: None, + skiptoken: None, + top: None, + } + } + #[doc = "Lists the dimensions by the external cloud provider type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] + #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] + pub fn by_external_cloud_provider_type( + &self, + external_cloud_provider_type: impl Into, + external_cloud_provider_id: impl Into, + ) -> by_external_cloud_provider_type::RequestBuilder { + by_external_cloud_provider_type::RequestBuilder { + client: self.0.clone(), + external_cloud_provider_type: external_cloud_provider_type.into(), + external_cloud_provider_id: external_cloud_provider_id.into(), + filter: None, + expand: None, + skiptoken: None, + top: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DimensionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) filter: Option, + pub(crate) expand: Option, + pub(crate) skiptoken: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."] + pub fn skiptoken(mut self, skiptoken: impl Into) -> Self { + self.skiptoken = Some(skiptoken.into()); + self + } + #[doc = "May be used to limit the number of results to the most recent N dimension data."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/dimensions", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + if let Some(skiptoken) = &this.skiptoken { + req.url_mut().query_pairs_mut().append_pair("$skiptoken", skiptoken); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod by_external_cloud_provider_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DimensionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) external_cloud_provider_type: String, + pub(crate) external_cloud_provider_id: String, + pub(crate) filter: Option, + pub(crate) expand: Option, + pub(crate) skiptoken: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."] + pub fn skiptoken(mut self, skiptoken: impl Into) -> Self { + self.skiptoken = Some(skiptoken.into()); + self + } + #[doc = "May be used to limit the number of results to the most recent N dimension data."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/{}/{}/dimensions", + this.client.endpoint(), + &this.external_cloud_provider_type, + &this.external_cloud_provider_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + if let Some(skiptoken) = &this.skiptoken { + req.url_mut().query_pairs_mut().append_pair("$skiptoken", skiptoken); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod query { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query the usage data for scope defined."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Query Config operation."] + pub fn usage(&self, scope: impl Into, parameters: impl Into) -> usage::RequestBuilder { + usage::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + parameters: parameters.into(), + } + } + #[doc = "Query the usage data for external cloud provider type defined."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `external_cloud_provider_type`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account."] + #[doc = "* `external_cloud_provider_id`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate Query Config operation."] + pub fn usage_by_external_cloud_provider_type( + &self, + external_cloud_provider_type: impl Into, + external_cloud_provider_id: impl Into, + parameters: impl Into, + ) -> usage_by_external_cloud_provider_type::RequestBuilder { + usage_by_external_cloud_provider_type::RequestBuilder { + client: self.0.clone(), + external_cloud_provider_type: external_cloud_provider_type.into(), + external_cloud_provider_id: external_cloud_provider_id.into(), + parameters: parameters.into(), + } + } + } + pub mod usage { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) parameters: models::QueryDefinition, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/query", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod usage_by_external_cloud_provider_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::QueryResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) external_cloud_provider_type: String, + pub(crate) external_cloud_provider_id: String, + pub(crate) parameters: models::QueryDefinition, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/{}/{}/query", + this.client.endpoint(), + &this.external_cloud_provider_type, + &this.external_cloud_provider_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod generate_reservation_details_report { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Generates the reservations details report for provided date range asynchronously based on enrollment id. The Reservation usage details can be viewed only by certain enterprise roles. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_account_id`: Enrollment ID (Legacy BillingAccount ID)"] + #[doc = "* `start_date`: Start Date"] + #[doc = "* `end_date`: End Date"] + pub fn by_billing_account_id( + &self, + billing_account_id: impl Into, + start_date: impl Into, + end_date: impl Into, + ) -> by_billing_account_id::RequestBuilder { + by_billing_account_id::RequestBuilder { + client: self.0.clone(), + billing_account_id: billing_account_id.into(), + start_date: start_date.into(), + end_date: end_date.into(), + } + } + #[doc = "Generates the reservations details report for provided date range asynchronously by billing profile. The Reservation usage details can be viewed by only certain enterprise roles by default. For more details on the roles see, https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_account_id`: Billing account ID"] + #[doc = "* `billing_profile_id`: Billing profile ID."] + #[doc = "* `start_date`: Start Date"] + #[doc = "* `end_date`: End Date"] + pub fn by_billing_profile_id( + &self, + billing_account_id: impl Into, + billing_profile_id: impl Into, + start_date: impl Into, + end_date: impl Into, + ) -> by_billing_profile_id::RequestBuilder { + by_billing_profile_id::RequestBuilder { + client: self.0.clone(), + billing_account_id: billing_account_id.into(), + billing_profile_id: billing_profile_id.into(), + start_date: start_date.into(), + end_date: end_date.into(), + } + } + } + pub mod by_billing_account_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "The URL to check the status of the asynchronous operation."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_account_id: String, + pub(crate) start_date: String, + pub(crate) end_date: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.Billing/billingAccounts/{}/providers/Microsoft.CostManagement/generateReservationDetailsReport" , this . client . endpoint () , & this . billing_account_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let start_date = &this.start_date; + req.url_mut().query_pairs_mut().append_pair("startDate", start_date); + let end_date = &this.end_date; + req.url_mut().query_pairs_mut().append_pair("endDate", end_date); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod by_billing_profile_id { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "The URL to check the status of the asynchronous operation."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_account_id: String, + pub(crate) billing_profile_id: String, + pub(crate) start_date: String, + pub(crate) end_date: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.Billing/billingAccounts/{}/billingProfiles/{}/providers/Microsoft.CostManagement/generateReservationDetailsReport" , this . client . endpoint () , & this . billing_account_id , & this . billing_profile_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let start_date = &this.start_date; + req.url_mut().query_pairs_mut().append_pair("startDate", start_date); + let end_date = &this.end_date; + req.url_mut().query_pairs_mut().append_pair("endDate", end_date); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod price_sheet { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_account_name`: The ID that uniquely identifies a billing account."] + #[doc = "* `billing_profile_name`: The ID that uniquely identifies a billing profile."] + #[doc = "* `invoice_name`: The ID that uniquely identifies an invoice."] + pub fn download( + &self, + billing_account_name: impl Into, + billing_profile_name: impl Into, + invoice_name: impl Into, + ) -> download::RequestBuilder { + download::RequestBuilder { + client: self.0.clone(), + billing_account_name: billing_account_name.into(), + billing_profile_name: billing_profile_name.into(), + invoice_name: invoice_name.into(), + } + } + #[doc = "Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated from a single csv file to a Zip file containing multiple csv files, each with max 200k records."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `billing_account_name`: The ID that uniquely identifies a billing account."] + #[doc = "* `billing_profile_name`: The ID that uniquely identifies a billing profile."] + pub fn download_by_billing_profile( + &self, + billing_account_name: impl Into, + billing_profile_name: impl Into, + ) -> download_by_billing_profile::RequestBuilder { + download_by_billing_profile::RequestBuilder { + client: self.0.clone(), + billing_account_name: billing_account_name.into(), + billing_profile_name: billing_profile_name.into(), + } + } + } + pub mod download { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_account_name: String, + pub(crate) billing_profile_name: String, + pub(crate) invoice_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.Billing/billingAccounts/{}/billingProfiles/{}/invoices/{}/providers/Microsoft.CostManagement/pricesheets/default/download" , this . client . endpoint () , & this . billing_account_name , & this . billing_profile_name , & this . invoice_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod download_by_billing_profile { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) billing_account_name: String, + pub(crate) billing_profile_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/providers/Microsoft.Billing/billingAccounts/{}/billingProfiles/{}/providers/Microsoft.CostManagement/pricesheets/default/download" , this . client . endpoint () , & this . billing_account_name , & this . billing_profile_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod scheduled_actions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all private scheduled actions."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + filter: None, + } + } + #[doc = "List all shared scheduled actions within the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope."] + pub fn list_by_scope(&self, scope: impl Into) -> list_by_scope::RequestBuilder { + list_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + filter: None, + } + } + #[doc = "Get the private scheduled action by name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `name`: Scheduled action name."] + pub fn get(&self, name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + name: name.into(), + } + } + #[doc = "Create or update a private scheduled action."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `name`: Scheduled action name."] + #[doc = "* `scheduled_action`: Scheduled action to be created or updated."] + pub fn create_or_update( + &self, + name: impl Into, + scheduled_action: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + name: name.into(), + scheduled_action: scheduled_action.into(), + if_match: None, + } + } + #[doc = "Delete a private scheduled action."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `name`: Scheduled action name."] + pub fn delete(&self, name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + name: name.into(), + } + } + #[doc = "Get the shared scheduled action from the given scope by name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope."] + #[doc = "* `name`: Scheduled action name."] + pub fn get_by_scope(&self, scope: impl Into, name: impl Into) -> get_by_scope::RequestBuilder { + get_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + name: name.into(), + } + } + #[doc = "Create or update a shared scheduled action within the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope."] + #[doc = "* `name`: Scheduled action name."] + #[doc = "* `scheduled_action`: Scheduled action to be created or updated."] + pub fn create_or_update_by_scope( + &self, + scope: impl Into, + name: impl Into, + scheduled_action: impl Into, + ) -> create_or_update_by_scope::RequestBuilder { + create_or_update_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + name: name.into(), + scheduled_action: scheduled_action.into(), + if_match: None, + } + } + #[doc = "Delete a scheduled action within the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope."] + #[doc = "* `name`: Scheduled action name."] + pub fn delete_by_scope(&self, scope: impl Into, name: impl Into) -> delete_by_scope::RequestBuilder { + delete_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + name: name.into(), + } + } + #[doc = "Processes a private scheduled action."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `name`: Scheduled action name."] + pub fn run(&self, name: impl Into) -> run::RequestBuilder { + run::RequestBuilder { + client: self.0.clone(), + name: name.into(), + } + } + #[doc = "Runs a shared scheduled action within the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope."] + #[doc = "* `name`: Scheduled action name."] + pub fn run_by_scope(&self, scope: impl Into, name: impl Into) -> run_by_scope::RequestBuilder { + run_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + name: name.into(), + } + } + #[doc = "Checks availability and correctness of the name for a scheduled action."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `check_name_availability_request`: Scheduled action to be created or updated."] + pub fn check_name_availability( + &self, + check_name_availability_request: impl Into, + ) -> check_name_availability::RequestBuilder { + check_name_availability::RequestBuilder { + client: self.0.clone(), + check_name_availability_request: check_name_availability_request.into(), + } + } + #[doc = "Checks availability and correctness of the name for a scheduled action within the given scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope."] + #[doc = "* `check_name_availability_request`: Scheduled action to be created or updated."] + pub fn check_name_availability_by_scope( + &self, + scope: impl Into, + check_name_availability_request: impl Into, + ) -> check_name_availability_by_scope::RequestBuilder { + check_name_availability_by_scope::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + check_name_availability_request: check_name_availability_request.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduledActionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/scheduledActions", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduledActionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/scheduledActions", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduledAction = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/scheduledActions/{}", + this.client.endpoint(), + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduledAction = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) name: String, + pub(crate) scheduled_action: models::ScheduledAction, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/scheduledActions/{}", + this.client.endpoint(), + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.scheduled_action)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/scheduledActions/{}", + this.client.endpoint(), + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduledAction = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/scheduledActions/{}", + this.client.endpoint(), + &this.scope, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScheduledAction = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) name: String, + pub(crate) scheduled_action: models::ScheduledAction, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "ETag of the Entity. Not required when creating an entity, but required when updating an entity."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/scheduledActions/{}", + this.client.endpoint(), + &this.scope, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.scheduled_action)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_by_scope { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/scheduledActions/{}", + this.client.endpoint(), + &this.scope, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod run { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/scheduledActions/{}/execute", + this.client.endpoint(), + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod run_by_scope { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/scheduledActions/{}/execute", + this.client.endpoint(), + &this.scope, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod check_name_availability { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) check_name_availability_request: models::CheckNameAvailabilityRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.CostManagement/checkNameAvailability", + this.client.endpoint(), + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.check_name_availability_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod check_name_availability_by_scope { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) check_name_availability_request: models::CheckNameAvailabilityRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.CostManagement/checkNameAvailability", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.check_name_availability_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs b/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs new file mode 100644 index 0000000000..3d31f49da0 --- /dev/null +++ b/services/mgmt/costmanagement/src/package_preview_2023_04/models.rs @@ -0,0 +1,5579 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "An individual alert."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Alert { + #[serde(flatten)] + pub cost_management_proxy_resource: CostManagementProxyResource, + #[doc = "Alert properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Alert { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Alert properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertProperties { + #[doc = "defines the type of alert"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option, + #[doc = "Alert description"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Source of alert"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "Alert details"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub details: Option, + #[doc = "related budget"] + #[serde(rename = "costEntityId", default, skip_serializing_if = "Option::is_none")] + pub cost_entity_id: Option, + #[doc = "alert status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "dateTime in which alert was created"] + #[serde(rename = "creationTime", default, skip_serializing_if = "Option::is_none")] + pub creation_time: Option, + #[doc = "dateTime in which alert was closed"] + #[serde(rename = "closeTime", default, skip_serializing_if = "Option::is_none")] + pub close_time: Option, + #[doc = "dateTime in which alert was last modified"] + #[serde(rename = "modificationTime", default, skip_serializing_if = "Option::is_none")] + pub modification_time: Option, + #[doc = "User who last modified the alert"] + #[serde(rename = "statusModificationUserName", default, skip_serializing_if = "Option::is_none")] + pub status_modification_user_name: Option, + #[doc = "dateTime in which the alert status was last modified"] + #[serde(rename = "statusModificationTime", default, skip_serializing_if = "Option::is_none")] + pub status_modification_time: Option, +} +impl AlertProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod alert_properties { + use super::*; + #[doc = "defines the type of alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Definition { + #[doc = "type of alert"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Alert category"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Criteria that triggered alert"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub criteria: Option, + } + impl Definition { + pub fn new() -> Self { + Self::default() + } + } + pub mod definition { + use super::*; + #[doc = "type of alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Budget, + Invoice, + Credit, + Quota, + General, + #[serde(rename = "xCloud")] + XCloud, + BudgetForecast, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Budget => serializer.serialize_unit_variant("Type", 0u32, "Budget"), + Self::Invoice => serializer.serialize_unit_variant("Type", 1u32, "Invoice"), + Self::Credit => serializer.serialize_unit_variant("Type", 2u32, "Credit"), + Self::Quota => serializer.serialize_unit_variant("Type", 3u32, "Quota"), + Self::General => serializer.serialize_unit_variant("Type", 4u32, "General"), + Self::XCloud => serializer.serialize_unit_variant("Type", 5u32, "xCloud"), + Self::BudgetForecast => serializer.serialize_unit_variant("Type", 6u32, "BudgetForecast"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Alert category"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Category")] + pub enum Category { + Cost, + Usage, + Billing, + System, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Category { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Category { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Category { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Cost => serializer.serialize_unit_variant("Category", 0u32, "Cost"), + Self::Usage => serializer.serialize_unit_variant("Category", 1u32, "Usage"), + Self::Billing => serializer.serialize_unit_variant("Category", 2u32, "Billing"), + Self::System => serializer.serialize_unit_variant("Category", 3u32, "System"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Criteria that triggered alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Criteria")] + pub enum Criteria { + CostThresholdExceeded, + UsageThresholdExceeded, + CreditThresholdApproaching, + CreditThresholdReached, + QuotaThresholdApproaching, + QuotaThresholdReached, + MultiCurrency, + ForecastCostThresholdExceeded, + ForecastUsageThresholdExceeded, + InvoiceDueDateApproaching, + InvoiceDueDateReached, + CrossCloudNewDataAvailable, + CrossCloudCollectionError, + GeneralThresholdError, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Criteria { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Criteria { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Criteria { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CostThresholdExceeded => serializer.serialize_unit_variant("Criteria", 0u32, "CostThresholdExceeded"), + Self::UsageThresholdExceeded => serializer.serialize_unit_variant("Criteria", 1u32, "UsageThresholdExceeded"), + Self::CreditThresholdApproaching => serializer.serialize_unit_variant("Criteria", 2u32, "CreditThresholdApproaching"), + Self::CreditThresholdReached => serializer.serialize_unit_variant("Criteria", 3u32, "CreditThresholdReached"), + Self::QuotaThresholdApproaching => serializer.serialize_unit_variant("Criteria", 4u32, "QuotaThresholdApproaching"), + Self::QuotaThresholdReached => serializer.serialize_unit_variant("Criteria", 5u32, "QuotaThresholdReached"), + Self::MultiCurrency => serializer.serialize_unit_variant("Criteria", 6u32, "MultiCurrency"), + Self::ForecastCostThresholdExceeded => { + serializer.serialize_unit_variant("Criteria", 7u32, "ForecastCostThresholdExceeded") + } + Self::ForecastUsageThresholdExceeded => { + serializer.serialize_unit_variant("Criteria", 8u32, "ForecastUsageThresholdExceeded") + } + Self::InvoiceDueDateApproaching => serializer.serialize_unit_variant("Criteria", 9u32, "InvoiceDueDateApproaching"), + Self::InvoiceDueDateReached => serializer.serialize_unit_variant("Criteria", 10u32, "InvoiceDueDateReached"), + Self::CrossCloudNewDataAvailable => serializer.serialize_unit_variant("Criteria", 11u32, "CrossCloudNewDataAvailable"), + Self::CrossCloudCollectionError => serializer.serialize_unit_variant("Criteria", 12u32, "CrossCloudCollectionError"), + Self::GeneralThresholdError => serializer.serialize_unit_variant("Criteria", 13u32, "GeneralThresholdError"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "Source of alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Source")] + pub enum Source { + Preset, + User, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Source { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Source { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Source { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Preset => serializer.serialize_unit_variant("Source", 0u32, "Preset"), + Self::User => serializer.serialize_unit_variant("Source", 1u32, "User"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Alert details"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Details { + #[doc = "Type of timegrain cadence"] + #[serde(rename = "timeGrainType", default, skip_serializing_if = "Option::is_none")] + pub time_grain_type: Option, + #[doc = "datetime of periodStartDate"] + #[serde(rename = "periodStartDate", default, skip_serializing_if = "Option::is_none")] + pub period_start_date: Option, + #[doc = "notificationId that triggered this alert"] + #[serde(rename = "triggeredBy", default, skip_serializing_if = "Option::is_none")] + pub triggered_by: Option, + #[doc = "array of resourceGroups to filter by"] + #[serde( + rename = "resourceGroupFilter", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_group_filter: Vec, + #[doc = "array of resources to filter by"] + #[serde( + rename = "resourceFilter", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_filter: Vec, + #[doc = "array of meters to filter by"] + #[serde( + rename = "meterFilter", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub meter_filter: Vec, + #[doc = "tags to filter by"] + #[serde(rename = "tagFilter", default, skip_serializing_if = "Option::is_none")] + pub tag_filter: Option, + #[doc = "notification threshold percentage as a decimal which activated this alert"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub threshold: Option, + #[doc = "operator used to compare currentSpend with amount"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + #[doc = "budget threshold amount"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[doc = "unit of currency being used"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "current spend"] + #[serde(rename = "currentSpend", default, skip_serializing_if = "Option::is_none")] + pub current_spend: Option, + #[doc = "list of emails to contact"] + #[serde( + rename = "contactEmails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub contact_emails: Vec, + #[doc = "list of action groups to broadcast to"] + #[serde( + rename = "contactGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub contact_groups: Vec, + #[doc = "list of contact roles"] + #[serde( + rename = "contactRoles", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub contact_roles: Vec, + #[doc = "overriding alert"] + #[serde(rename = "overridingAlert", default, skip_serializing_if = "Option::is_none")] + pub overriding_alert: Option, + #[doc = "department name"] + #[serde(rename = "departmentName", default, skip_serializing_if = "Option::is_none")] + pub department_name: Option, + #[doc = "company name"] + #[serde(rename = "companyName", default, skip_serializing_if = "Option::is_none")] + pub company_name: Option, + #[doc = "enrollment number"] + #[serde(rename = "enrollmentNumber", default, skip_serializing_if = "Option::is_none")] + pub enrollment_number: Option, + #[doc = "datetime of enrollmentStartDate"] + #[serde(rename = "enrollmentStartDate", default, skip_serializing_if = "Option::is_none")] + pub enrollment_start_date: Option, + #[doc = "datetime of enrollmentEndDate"] + #[serde(rename = "enrollmentEndDate", default, skip_serializing_if = "Option::is_none")] + pub enrollment_end_date: Option, + #[doc = "invoicing threshold"] + #[serde(rename = "invoicingThreshold", default, skip_serializing_if = "Option::is_none")] + pub invoicing_threshold: Option, + } + impl Details { + pub fn new() -> Self { + Self::default() + } + } + pub mod details { + use super::*; + #[doc = "Type of timegrain cadence"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "TimeGrainType")] + pub enum TimeGrainType { + None, + Monthly, + Quarterly, + Annually, + BillingMonth, + BillingQuarter, + BillingAnnual, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for TimeGrainType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for TimeGrainType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for TimeGrainType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("TimeGrainType", 0u32, "None"), + Self::Monthly => serializer.serialize_unit_variant("TimeGrainType", 1u32, "Monthly"), + Self::Quarterly => serializer.serialize_unit_variant("TimeGrainType", 2u32, "Quarterly"), + Self::Annually => serializer.serialize_unit_variant("TimeGrainType", 3u32, "Annually"), + Self::BillingMonth => serializer.serialize_unit_variant("TimeGrainType", 4u32, "BillingMonth"), + Self::BillingQuarter => serializer.serialize_unit_variant("TimeGrainType", 5u32, "BillingQuarter"), + Self::BillingAnnual => serializer.serialize_unit_variant("TimeGrainType", 6u32, "BillingAnnual"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "operator used to compare currentSpend with amount"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + None, + EqualTo, + GreaterThan, + GreaterThanOrEqualTo, + LessThan, + LessThanOrEqualTo, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("Operator", 0u32, "None"), + Self::EqualTo => serializer.serialize_unit_variant("Operator", 1u32, "EqualTo"), + Self::GreaterThan => serializer.serialize_unit_variant("Operator", 2u32, "GreaterThan"), + Self::GreaterThanOrEqualTo => serializer.serialize_unit_variant("Operator", 3u32, "GreaterThanOrEqualTo"), + Self::LessThan => serializer.serialize_unit_variant("Operator", 4u32, "LessThan"), + Self::LessThanOrEqualTo => serializer.serialize_unit_variant("Operator", 5u32, "LessThanOrEqualTo"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "alert status"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + None, + Active, + Overridden, + Resolved, + Dismissed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("Status", 0u32, "None"), + Self::Active => serializer.serialize_unit_variant("Status", 1u32, "Active"), + Self::Overridden => serializer.serialize_unit_variant("Status", 2u32, "Overridden"), + Self::Resolved => serializer.serialize_unit_variant("Status", 3u32, "Resolved"), + Self::Dismissed => serializer.serialize_unit_variant("Status", 4u32, "Dismissed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of alerts."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertsResult { + #[doc = "List of alerts."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of alerts results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl AlertsResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Kind/type of the benefit."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "BenefitKind")] +pub enum BenefitKind { + IncludedQuantity, + Reservation, + SavingsPlan, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for BenefitKind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for BenefitKind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for BenefitKind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IncludedQuantity => serializer.serialize_unit_variant("BenefitKind", 0u32, "IncludedQuantity"), + Self::Reservation => serializer.serialize_unit_variant("BenefitKind", 1u32, "Reservation"), + Self::SavingsPlan => serializer.serialize_unit_variant("BenefitKind", 2u32, "SavingsPlan"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The benefit resource model definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenefitResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Kind/type of the benefit."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl BenefitResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of benefit utilization summaries."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenefitUtilizationSummariesListResult { + #[doc = "The list of benefit utilization summaries."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (URL) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for BenefitUtilizationSummariesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl BenefitUtilizationSummariesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Benefit utilization summary resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BenefitUtilizationSummary { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Kind/type of the benefit."] + pub kind: BenefitKind, +} +impl BenefitUtilizationSummary { + pub fn new(kind: BenefitKind) -> Self { + Self { + resource: Resource::default(), + kind, + } + } +} +#[doc = "The properties of a benefit utilization summary."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenefitUtilizationSummaryProperties { + #[doc = "ARM SKU name. For example, 'Compute_Savings_Plan' for savings plan."] + #[serde(rename = "armSkuName", default, skip_serializing_if = "Option::is_none")] + pub arm_sku_name: Option, + #[doc = "The benefit ID is the identifier of the benefit."] + #[serde(rename = "benefitId", default, skip_serializing_if = "Option::is_none")] + pub benefit_id: Option, + #[doc = "The benefit order ID is the identifier for a benefit purchase."] + #[serde(rename = "benefitOrderId", default, skip_serializing_if = "Option::is_none")] + pub benefit_order_id: Option, + #[doc = "Kind/type of the benefit."] + #[serde(rename = "benefitType", default, skip_serializing_if = "Option::is_none")] + pub benefit_type: Option, + #[doc = "Date corresponding to the utilization summary record. If the grain of data is monthly, value for this field will be first day of the month."] + #[serde(rename = "usageDate", default, with = "azure_core::date::rfc3339::option")] + pub usage_date: Option, +} +impl BenefitUtilizationSummaryProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The blob information generated by this operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BlobInfo { + #[doc = "Link to the blob to download file."] + #[serde(rename = "blobLink", default, skip_serializing_if = "Option::is_none")] + pub blob_link: Option, + #[doc = "Bytes in the blob."] + #[serde(rename = "byteCount", default, skip_serializing_if = "Option::is_none")] + pub byte_count: Option, +} +impl BlobInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A budget resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Budget { + #[serde(flatten)] + pub cost_management_proxy_resource: CostManagementProxyResource, + #[doc = "The properties of the budget."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Budget { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The comparison expression to be used in the budgets."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetComparisonExpression { + #[doc = "The name of the column to use in comparison."] + pub name: String, + #[doc = "The operator to use for comparison."] + pub operator: budget_comparison_expression::Operator, + #[doc = "Array of values to use for comparison"] + pub values: Vec, +} +impl BudgetComparisonExpression { + pub fn new(name: String, operator: budget_comparison_expression::Operator, values: Vec) -> Self { + Self { name, operator, values } + } +} +pub mod budget_comparison_expression { + use super::*; + #[doc = "The operator to use for comparison."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + In, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::In => serializer.serialize_unit_variant("Operator", 0u32, "In"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "May be used to filter budgets by user-specified dimensions and/or tags.\n\n Supported for CategoryType(s): Cost, ReservationUtilization."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BudgetFilter { + #[doc = "The logical \"AND\" expression. Must have at least 2 items.\n\n Supported for CategoryType(s): Cost."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub and: Vec, + #[doc = "The comparison expression to be used in the budgets."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dimensions: Option, + #[doc = "The comparison expression to be used in the budgets."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl BudgetFilter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Dimensions or Tags to filter a budget by.\n\n Supported for CategoryType(s): Cost, ReservationUtilization."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BudgetFilterProperties { + #[doc = "The comparison expression to be used in the budgets."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dimensions: Option, + #[doc = "The comparison expression to be used in the budgets."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl BudgetFilterProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the budget."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetProperties { + #[doc = "The category of the budget.\n- 'Cost' defines a Budget.\n- 'ReservationUtilization' defines a Reservation Utilization Alert Rule."] + pub category: budget_properties::Category, + #[doc = "The total amount of cost to track with the budget.\n\n Supported for CategoryType(s): Cost.\n\n Required for CategoryType(s): Cost."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[doc = "The time covered by a budget. Tracking of the amount will be reset based on the time grain.\n\nSupported for CategoryType(s): Cost, ReservationUtilization.\n\n Supported timeGrainTypes for **CategoryType: Cost**\n\n- Monthly\n- Quarterly\n- Annually\n- BillingMonth*\n- BillingQuarter*\n- BillingAnnual*\n\n *only supported for Web Direct customers.\n\n Supported timeGrainTypes for **CategoryType: ReservationUtilization**\n- Last7Days\n- Last30Days\n\n Required for CategoryType(s): Cost, ReservationUtilization."] + #[serde(rename = "timeGrain")] + pub time_grain: budget_properties::TimeGrain, + #[doc = "The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Required for CategoryType(s): Cost, ReservationUtilization."] + #[serde(rename = "timePeriod")] + pub time_period: BudgetTimePeriod, + #[doc = "May be used to filter budgets by user-specified dimensions and/or tags.\n\n Supported for CategoryType(s): Cost, ReservationUtilization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, + #[doc = "The current amount of cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost."] + #[serde(rename = "currentSpend", default, skip_serializing_if = "Option::is_none")] + pub current_spend: Option, + #[doc = "Dictionary of notifications associated with the budget.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n- Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.\n- Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub notifications: Option, + #[doc = "The forecasted cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost."] + #[serde(rename = "forecastSpend", default, skip_serializing_if = "Option::is_none")] + pub forecast_spend: Option, +} +impl BudgetProperties { + pub fn new(category: budget_properties::Category, time_grain: budget_properties::TimeGrain, time_period: BudgetTimePeriod) -> Self { + Self { + category, + amount: None, + time_grain, + time_period, + filter: None, + current_spend: None, + notifications: None, + forecast_spend: None, + } + } +} +pub mod budget_properties { + use super::*; + #[doc = "The category of the budget.\n- 'Cost' defines a Budget.\n- 'ReservationUtilization' defines a Reservation Utilization Alert Rule."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Category")] + pub enum Category { + Cost, + ReservationUtilization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Category { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Category { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Category { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Cost => serializer.serialize_unit_variant("Category", 0u32, "Cost"), + Self::ReservationUtilization => serializer.serialize_unit_variant("Category", 1u32, "ReservationUtilization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The time covered by a budget. Tracking of the amount will be reset based on the time grain.\n\nSupported for CategoryType(s): Cost, ReservationUtilization.\n\n Supported timeGrainTypes for **CategoryType: Cost**\n\n- Monthly\n- Quarterly\n- Annually\n- BillingMonth*\n- BillingQuarter*\n- BillingAnnual*\n\n *only supported for Web Direct customers.\n\n Supported timeGrainTypes for **CategoryType: ReservationUtilization**\n- Last7Days\n- Last30Days\n\n Required for CategoryType(s): Cost, ReservationUtilization."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "TimeGrain")] + pub enum TimeGrain { + Monthly, + Quarterly, + Annually, + BillingMonth, + BillingQuarter, + BillingAnnual, + Last7Days, + Last30Days, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for TimeGrain { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for TimeGrain { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for TimeGrain { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Monthly => serializer.serialize_unit_variant("TimeGrain", 0u32, "Monthly"), + Self::Quarterly => serializer.serialize_unit_variant("TimeGrain", 1u32, "Quarterly"), + Self::Annually => serializer.serialize_unit_variant("TimeGrain", 2u32, "Annually"), + Self::BillingMonth => serializer.serialize_unit_variant("TimeGrain", 3u32, "BillingMonth"), + Self::BillingQuarter => serializer.serialize_unit_variant("TimeGrain", 4u32, "BillingQuarter"), + Self::BillingAnnual => serializer.serialize_unit_variant("TimeGrain", 5u32, "BillingAnnual"), + Self::Last7Days => serializer.serialize_unit_variant("TimeGrain", 6u32, "Last7Days"), + Self::Last30Days => serializer.serialize_unit_variant("TimeGrain", 7u32, "Last30Days"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Required for CategoryType(s): Cost, ReservationUtilization."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetTimePeriod { + #[doc = "The start date for the budget.\n\n- Constraints for **CategoryType: Cost** - Must be first of the month and should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start date should be selected within the timegrain period.\n\n- Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current date and less than the end date."] + #[serde(rename = "startDate", with = "azure_core::date::rfc3339")] + pub start_date: time::OffsetDateTime, + #[doc = "The end date for the budget.\n\n- Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to 10 years from the start date.\n\n- Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3 years after the start date."] + #[serde(rename = "endDate", default, with = "azure_core::date::rfc3339::option")] + pub end_date: Option, +} +impl BudgetTimePeriod { + pub fn new(start_date: time::OffsetDateTime) -> Self { + Self { + start_date, + end_date: None, + } + } +} +#[doc = "Result of listing budgets. It contains a list of available budgets in the scope provided."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BudgetsListResult { + #[doc = "The list of budgets."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results.\r\nIt's null for now, added for future use."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for BudgetsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl BudgetsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The check availability request body."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityRequest { + #[doc = "The name of the resource for which availability needs to be checked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl CheckNameAvailabilityRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The check availability result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityResponse { + #[doc = "Indicates if the resource name is available."] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "The reason why the given name is not available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Detailed reason why the given name is available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl CheckNameAvailabilityResponse { + pub fn new() -> Self { + Self::default() + } +} +pub mod check_name_availability_response { + use super::*; + #[doc = "The reason why the given name is not available."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Reason")] + pub enum Reason { + Invalid, + AlreadyExists, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Reason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Reason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Reason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Invalid => serializer.serialize_unit_variant("Reason", 0u32, "Invalid"), + Self::AlreadyExists => serializer.serialize_unit_variant("Reason", 1u32, "AlreadyExists"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The common properties of the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CommonExportProperties { + #[doc = "The format of the export being delivered. Currently only 'Csv' is supported."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub format: Option, + #[doc = "The delivery information associated with a export."] + #[serde(rename = "deliveryInfo")] + pub delivery_info: ExportDeliveryInfo, + #[doc = "The definition of an export."] + pub definition: ExportDefinition, + #[doc = "Result of listing the run history of an export."] + #[serde(rename = "runHistory", default, skip_serializing_if = "Option::is_none")] + pub run_history: Option, + #[doc = "If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. Note: this option is currently available only for Microsoft Customer Agreement commerce scopes."] + #[serde(rename = "partitionData", default, skip_serializing_if = "Option::is_none")] + pub partition_data: Option, + #[doc = "If the export has an active schedule, provides an estimate of the next run time."] + #[serde(rename = "nextRunTimeEstimate", default, with = "azure_core::date::rfc3339::option")] + pub next_run_time_estimate: Option, +} +impl CommonExportProperties { + pub fn new(delivery_info: ExportDeliveryInfo, definition: ExportDefinition) -> Self { + Self { + format: None, + delivery_info, + definition, + run_history: None, + partition_data: None, + next_run_time_estimate: None, + } + } +} +pub mod common_export_properties { + use super::*; + #[doc = "The format of the export being delivered. Currently only 'Csv' is supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Format")] + pub enum Format { + Csv, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Format { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Format { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Format { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Csv => serializer.serialize_unit_variant("Format", 0u32, "Csv"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The result of the long running operation for cost details Api."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CostDetailsOperationResults { + #[doc = "The id of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the long running operation."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The status of the cost details operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The manifest of the report generated by the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub manifest: Option, + #[doc = "The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z."] + #[serde(rename = "validTill", default, with = "azure_core::date::rfc3339::option")] + pub valid_till: Option, + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl CostDetailsOperationResults { + pub fn new() -> Self { + Self::default() + } +} +pub mod cost_details_operation_results { + use super::*; + #[doc = "The status of the cost details operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Completed, + NoDataFound, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Completed => serializer.serialize_unit_variant("Status", 0u32, "Completed"), + Self::NoDataFound => serializer.serialize_unit_variant("Status", 1u32, "NoDataFound"), + Self::Failed => serializer.serialize_unit_variant("Status", 2u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CostDetailsTimePeriod { + #[doc = "The start date to pull data from. example format 2020-03-15"] + pub start: String, + #[doc = "The end date to pull data to. example format 2020-03-15"] + pub end: String, +} +impl CostDetailsTimePeriod { + pub fn new(start: String, end: String) -> Self { + Self { start, end } + } +} +#[doc = "A Cost management REST API operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CostManagementOperation { + #[serde(flatten)] + pub operation: Operation, + #[doc = "Operation id: {provider}/{resource}/{operation}."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl CostManagementOperation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Resource model definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CostManagementProxyResource { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not."] + #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] + pub e_tag: Option, +} +impl CostManagementProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Resource model definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CostManagementResource { + #[doc = "Resource Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "SKU of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "ETag of the resource."] + #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] + pub e_tag: Option, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl CostManagementResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The current amount of cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CurrentSpend { + #[doc = "The total amount of cost which is being tracked by the budget."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[doc = "The unit of measure for the budget amount."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl CurrentSpend { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Days of Week."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "DaysOfWeek")] +pub enum DaysOfWeek { + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, + Sunday, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for DaysOfWeek { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for DaysOfWeek { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for DaysOfWeek { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Monday => serializer.serialize_unit_variant("DaysOfWeek", 0u32, "Monday"), + Self::Tuesday => serializer.serialize_unit_variant("DaysOfWeek", 1u32, "Tuesday"), + Self::Wednesday => serializer.serialize_unit_variant("DaysOfWeek", 2u32, "Wednesday"), + Self::Thursday => serializer.serialize_unit_variant("DaysOfWeek", 3u32, "Thursday"), + Self::Friday => serializer.serialize_unit_variant("DaysOfWeek", 4u32, "Friday"), + Self::Saturday => serializer.serialize_unit_variant("DaysOfWeek", 5u32, "Saturday"), + Self::Sunday => serializer.serialize_unit_variant("DaysOfWeek", 6u32, "Sunday"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "List of Dimension."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Dimension { + #[serde(flatten)] + pub cost_management_resource: CostManagementResource, + #[doc = "Dimension properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Dimension { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Dimension properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DimensionProperties { + #[doc = "Dimension description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Filter enabled."] + #[serde(rename = "filterEnabled", default, skip_serializing_if = "Option::is_none")] + pub filter_enabled: Option, + #[doc = "Grouping enabled."] + #[serde(rename = "groupingEnabled", default, skip_serializing_if = "Option::is_none")] + pub grouping_enabled: Option, + #[doc = "Dimension data."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub data: Vec, + #[doc = "Total number of data for the dimension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option, + #[doc = "Dimension category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Usage start."] + #[serde(rename = "usageStart", default, with = "azure_core::date::rfc3339::option")] + pub usage_start: Option, + #[doc = "Usage end."] + #[serde(rename = "usageEnd", default, with = "azure_core::date::rfc3339::option")] + pub usage_end: Option, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl DimensionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of listing dimensions. It contains a list of available dimensions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DimensionsListResult { + #[doc = "The list of dimensions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for DimensionsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl DimensionsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The request payload to update an alert"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DismissAlertPayload { + #[doc = "Alert properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DismissAlertPayload { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The URL to download the generated report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DownloadUrl { + #[doc = "The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z."] + #[serde(rename = "expiryTime", default, with = "azure_core::date::rfc3339::option")] + pub expiry_time: Option, + #[doc = "The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z."] + #[serde(rename = "validTill", default, with = "azure_core::date::rfc3339::option")] + pub valid_till: Option, + #[doc = "The URL to download the generated report."] + #[serde(rename = "downloadUrl", default, skip_serializing_if = "Option::is_none")] + pub download_url: Option, +} +impl DownloadUrl { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The details of the error."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetails { + #[doc = "Error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Error message indicating why the operation failed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl ErrorDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The details of the error."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetailsWithNestedDetails { + #[serde(flatten)] + pub error_details: ErrorDetails, + #[doc = "The additional details of the error."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl ErrorDetailsWithNestedDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponseWithNestedDetails { + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponseWithNestedDetails { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponseWithNestedDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An export resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Export { + #[serde(flatten)] + pub cost_management_proxy_resource: CostManagementProxyResource, + #[doc = "The properties of the export."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Export { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition for data in the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportDataset { + #[doc = "The granularity of rows in the export. Currently only 'Daily' is supported."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub granularity: Option, + #[doc = "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, +} +impl ExportDataset { + pub fn new() -> Self { + Self::default() + } +} +pub mod export_dataset { + use super::*; + #[doc = "The granularity of rows in the export. Currently only 'Daily' is supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Granularity")] + pub enum Granularity { + Daily, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Granularity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Granularity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Granularity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportDatasetConfiguration { + #[doc = "Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples)."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub columns: Vec, +} +impl ExportDatasetConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition of an export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportDefinition { + #[doc = "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations."] + #[serde(rename = "type")] + pub type_: export_definition::Type, + #[doc = "The time frame for pulling data for the export. If custom, then a specific time period must be provided."] + pub timeframe: export_definition::Timeframe, + #[doc = "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months."] + #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] + pub time_period: Option, + #[doc = "The definition for data in the export."] + #[serde(rename = "dataSet", default, skip_serializing_if = "Option::is_none")] + pub data_set: Option, +} +impl ExportDefinition { + pub fn new(type_: export_definition::Type, timeframe: export_definition::Timeframe) -> Self { + Self { + type_, + timeframe, + time_period: None, + data_set: None, + } + } +} +pub mod export_definition { + use super::*; + #[doc = "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Usage, + ActualCost, + AmortizedCost, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), + Self::ActualCost => serializer.serialize_unit_variant("Type", 1u32, "ActualCost"), + Self::AmortizedCost => serializer.serialize_unit_variant("Type", 2u32, "AmortizedCost"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The time frame for pulling data for the export. If custom, then a specific time period must be provided."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Timeframe")] + pub enum Timeframe { + MonthToDate, + BillingMonthToDate, + TheLastMonth, + TheLastBillingMonth, + WeekToDate, + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Timeframe { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Timeframe { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Timeframe { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "MonthToDate"), + Self::BillingMonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "BillingMonthToDate"), + Self::TheLastMonth => serializer.serialize_unit_variant("Timeframe", 2u32, "TheLastMonth"), + Self::TheLastBillingMonth => serializer.serialize_unit_variant("Timeframe", 3u32, "TheLastBillingMonth"), + Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 4u32, "WeekToDate"), + Self::Custom => serializer.serialize_unit_variant("Timeframe", 5u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key )."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportDeliveryDestination { + #[doc = "The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The name of the container where exports will be uploaded. If the container does not exist it will be created."] + pub container: String, + #[doc = "The name of the directory where exports will be uploaded."] + #[serde(rename = "rootFolderPath", default, skip_serializing_if = "Option::is_none")] + pub root_folder_path: Option, + #[doc = "A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified instead of resourceId. Note: the value returned by the API for this property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. To update this value a new SAS token must be specified."] + #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] + pub sas_token: Option, + #[doc = "The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken can be specified instead of resourceId."] + #[serde(rename = "storageAccount", default, skip_serializing_if = "Option::is_none")] + pub storage_account: Option, +} +impl ExportDeliveryDestination { + pub fn new(container: String) -> Self { + Self { + resource_id: None, + container, + root_folder_path: None, + sas_token: None, + storage_account: None, + } + } +} +#[doc = "The delivery information associated with a export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportDeliveryInfo { + #[doc = "This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key )."] + pub destination: ExportDeliveryDestination, +} +impl ExportDeliveryInfo { + pub fn new(destination: ExportDeliveryDestination) -> Self { + Self { destination } + } +} +#[doc = "Result of listing the run history of an export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportExecutionListResult { + #[doc = "A list of export runs."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ExportExecutionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of listing exports. It contains a list of available exports in the scope provided."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportListResult { + #[doc = "The list of exports."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ExportListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportProperties { + #[serde(flatten)] + pub common_export_properties: CommonExportProperties, + #[doc = "The schedule associated with the export."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub schedule: Option, +} +impl ExportProperties { + pub fn new(common_export_properties: CommonExportProperties) -> Self { + Self { + common_export_properties, + schedule: None, + } + } +} +#[doc = "The start and end date for recurrence schedule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportRecurrencePeriod { + #[doc = "The start date of recurrence."] + #[serde(with = "azure_core::date::rfc3339")] + pub from: time::OffsetDateTime, + #[doc = "The end date of recurrence."] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub to: Option, +} +impl ExportRecurrencePeriod { + pub fn new(from: time::OffsetDateTime) -> Self { + Self { from, to: None } + } +} +#[doc = "An export run."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportRun { + #[serde(flatten)] + pub cost_management_proxy_resource: CostManagementProxyResource, + #[doc = "The properties of the export run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ExportRun { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the export run."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportRunProperties { + #[doc = "The type of the export run."] + #[serde(rename = "executionType", default, skip_serializing_if = "Option::is_none")] + pub execution_type: Option, + #[doc = "The last known status of the export run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The identifier for the entity that triggered the export. For on-demand runs it is the user email. For scheduled runs it is 'System'."] + #[serde(rename = "submittedBy", default, skip_serializing_if = "Option::is_none")] + pub submitted_by: Option, + #[doc = "The time when export was queued to be run."] + #[serde(rename = "submittedTime", default, with = "azure_core::date::rfc3339::option")] + pub submitted_time: Option, + #[doc = "The time when export was picked up to be run."] + #[serde(rename = "processingStartTime", default, with = "azure_core::date::rfc3339::option")] + pub processing_start_time: Option, + #[doc = "The time when the export run finished."] + #[serde(rename = "processingEndTime", default, with = "azure_core::date::rfc3339::option")] + pub processing_end_time: Option, + #[doc = "The name of the exported file."] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option, + #[doc = "The common properties of the export."] + #[serde(rename = "runSettings", default, skip_serializing_if = "Option::is_none")] + pub run_settings: Option, + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl ExportRunProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod export_run_properties { + use super::*; + #[doc = "The type of the export run."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ExecutionType")] + pub enum ExecutionType { + OnDemand, + Scheduled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ExecutionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ExecutionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ExecutionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OnDemand => serializer.serialize_unit_variant("ExecutionType", 0u32, "OnDemand"), + Self::Scheduled => serializer.serialize_unit_variant("ExecutionType", 1u32, "Scheduled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The last known status of the export run."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Queued, + InProgress, + Completed, + Failed, + Timeout, + NewDataNotAvailable, + DataNotAvailable, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Queued => serializer.serialize_unit_variant("Status", 0u32, "Queued"), + Self::InProgress => serializer.serialize_unit_variant("Status", 1u32, "InProgress"), + Self::Completed => serializer.serialize_unit_variant("Status", 2u32, "Completed"), + Self::Failed => serializer.serialize_unit_variant("Status", 3u32, "Failed"), + Self::Timeout => serializer.serialize_unit_variant("Status", 4u32, "Timeout"), + Self::NewDataNotAvailable => serializer.serialize_unit_variant("Status", 5u32, "NewDataNotAvailable"), + Self::DataNotAvailable => serializer.serialize_unit_variant("Status", 6u32, "DataNotAvailable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The schedule associated with the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExportSchedule { + #[doc = "The status of the export's schedule. If 'Inactive', the export's schedule is paused."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The schedule recurrence."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recurrence: Option, + #[doc = "The start and end date for recurrence schedule."] + #[serde(rename = "recurrencePeriod", default, skip_serializing_if = "Option::is_none")] + pub recurrence_period: Option, +} +impl ExportSchedule { + pub fn new() -> Self { + Self::default() + } +} +pub mod export_schedule { + use super::*; + #[doc = "The status of the export's schedule. If 'Inactive', the export's schedule is paused."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Active, + Inactive, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Active => serializer.serialize_unit_variant("Status", 0u32, "Active"), + Self::Inactive => serializer.serialize_unit_variant("Status", 1u32, "Inactive"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The schedule recurrence."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Recurrence")] + pub enum Recurrence { + Daily, + Weekly, + Monthly, + Annually, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Recurrence { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Recurrence { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Recurrence { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("Recurrence", 0u32, "Daily"), + Self::Weekly => serializer.serialize_unit_variant("Recurrence", 1u32, "Weekly"), + Self::Monthly => serializer.serialize_unit_variant("Recurrence", 2u32, "Monthly"), + Self::Annually => serializer.serialize_unit_variant("Recurrence", 3u32, "Annually"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExportTimePeriod { + #[doc = "The start date for export data."] + #[serde(with = "azure_core::date::rfc3339")] + pub from: time::OffsetDateTime, + #[doc = "The end date for export data."] + #[serde(with = "azure_core::date::rfc3339")] + pub to: time::OffsetDateTime, +} +impl ExportTimePeriod { + pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { + Self { from, to } + } +} +#[doc = "Destination of the view data. This is optional. Currently only CSV format is supported."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FileDestination { + #[doc = "Destination of the view data. Currently only CSV format is supported."] + #[serde( + rename = "fileFormats", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub file_formats: Vec, +} +impl FileDestination { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Destination of the view data. Currently only CSV format is supported."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "FileFormat")] +pub enum FileFormat { + Csv, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for FileFormat { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for FileFormat { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for FileFormat { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Csv => serializer.serialize_unit_variant("FileFormat", 0u32, "Csv"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The aggregation expression to be used in the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ForecastAggregation { + #[doc = "The name of the column to aggregate."] + pub name: forecast_aggregation::Name, + #[doc = "The name of the aggregation function to use."] + pub function: forecast_aggregation::Function, +} +impl ForecastAggregation { + pub fn new(name: forecast_aggregation::Name, function: forecast_aggregation::Function) -> Self { + Self { name, function } + } +} +pub mod forecast_aggregation { + use super::*; + #[doc = "The name of the column to aggregate."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Name")] + pub enum Name { + #[serde(rename = "PreTaxCostUSD")] + PreTaxCostUsd, + Cost, + #[serde(rename = "CostUSD")] + CostUsd, + PreTaxCost, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Name { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Name { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Name { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PreTaxCostUsd => serializer.serialize_unit_variant("Name", 0u32, "PreTaxCostUSD"), + Self::Cost => serializer.serialize_unit_variant("Name", 1u32, "Cost"), + Self::CostUsd => serializer.serialize_unit_variant("Name", 2u32, "CostUSD"), + Self::PreTaxCost => serializer.serialize_unit_variant("Name", 3u32, "PreTaxCost"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The name of the aggregation function to use."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Function")] + pub enum Function { + Sum, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Function { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Function { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Function { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Sum => serializer.serialize_unit_variant("Function", 0u32, "Sum"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Forecast column properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ForecastColumn { + #[doc = "The name of column."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of column."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl ForecastColumn { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The comparison expression to be used in the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ForecastComparisonExpression { + #[doc = "The name of the column to use in comparison."] + pub name: String, + #[doc = "The operator to use for comparison."] + pub operator: forecast_comparison_expression::Operator, + #[doc = "Array of values to use for comparison"] + pub values: Vec, +} +impl ForecastComparisonExpression { + pub fn new(name: String, operator: forecast_comparison_expression::Operator, values: Vec) -> Self { + Self { name, operator, values } + } +} +pub mod forecast_comparison_expression { + use super::*; + #[doc = "The operator to use for comparison."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + In, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::In => serializer.serialize_unit_variant("Operator", 0u32, "In"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The definition of data present in the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ForecastDataset { + #[doc = "The granularity of rows in the forecast."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub granularity: Option, + #[doc = "The configuration of dataset in the forecast."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + #[doc = "Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses."] + pub aggregation: serde_json::Value, + #[doc = "The filter expression to be used in the export."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, +} +impl ForecastDataset { + pub fn new(aggregation: serde_json::Value) -> Self { + Self { + granularity: None, + configuration: None, + aggregation, + filter: None, + } + } +} +#[doc = "The configuration of dataset in the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ForecastDatasetConfiguration { + #[doc = "Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then forecast includes all columns."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub columns: Vec, +} +impl ForecastDatasetConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition of a forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ForecastDefinition { + #[doc = "The type of the forecast."] + #[serde(rename = "type")] + pub type_: ForecastType, + #[doc = "The time frame for pulling data for the forecast."] + pub timeframe: ForecastTimeframe, + #[doc = "Has time period for pulling data for the forecast."] + #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] + pub time_period: Option, + #[doc = "The definition of data present in the forecast."] + pub dataset: ForecastDataset, + #[doc = "A boolean determining if actualCost will be included."] + #[serde(rename = "includeActualCost", default, skip_serializing_if = "Option::is_none")] + pub include_actual_cost: Option, + #[doc = "A boolean determining if FreshPartialCost will be included."] + #[serde(rename = "includeFreshPartialCost", default, skip_serializing_if = "Option::is_none")] + pub include_fresh_partial_cost: Option, +} +impl ForecastDefinition { + pub fn new(type_: ForecastType, timeframe: ForecastTimeframe, dataset: ForecastDataset) -> Self { + Self { + type_, + timeframe, + time_period: None, + dataset, + include_actual_cost: None, + include_fresh_partial_cost: None, + } + } +} +#[doc = "The filter expression to be used in the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ForecastFilter { + #[doc = "The logical \"AND\" expression. Must have at least 2 items."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub and: Vec, + #[doc = "The logical \"OR\" expression. Must have at least 2 items."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub or: Vec, + #[doc = "The comparison expression to be used in the forecast."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dimensions: Option, + #[doc = "The comparison expression to be used in the forecast."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl ForecastFilter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Forecast properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ForecastProperties { + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of columns"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub columns: Vec, + #[doc = "Array of rows"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rows: Vec>, +} +impl ForecastProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of forecast. It contains all columns listed under groupings and aggregation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ForecastResult { + #[serde(flatten)] + pub cost_management_resource: CostManagementResource, + #[doc = "Forecast properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ForecastResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The forecasted cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ForecastSpend { + #[doc = "The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[doc = "The unit of measure for the budget amount."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl ForecastSpend { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Has time period for pulling data for the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ForecastTimePeriod { + #[doc = "The start date to pull data from."] + #[serde(with = "azure_core::date::rfc3339")] + pub from: time::OffsetDateTime, + #[doc = "The end date to pull data to."] + #[serde(with = "azure_core::date::rfc3339")] + pub to: time::OffsetDateTime, +} +impl ForecastTimePeriod { + pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { + Self { from, to } + } +} +#[doc = "The time frame for pulling data for the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ForecastTimeframe")] +pub enum ForecastTimeframe { + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ForecastTimeframe { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ForecastTimeframe { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ForecastTimeframe { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Custom => serializer.serialize_unit_variant("ForecastTimeframe", 0u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The type of the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ForecastType")] +pub enum ForecastType { + Usage, + ActualCost, + AmortizedCost, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ForecastType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ForecastType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ForecastType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Usage => serializer.serialize_unit_variant("ForecastType", 0u32, "Usage"), + Self::ActualCost => serializer.serialize_unit_variant("ForecastType", 1u32, "ActualCost"), + Self::AmortizedCost => serializer.serialize_unit_variant("ForecastType", 2u32, "AmortizedCost"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member not accepted in the request payload. \n\n * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. \n\n * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. \n\n * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateCostDetailsReportErrorResponse { + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl GenerateCostDetailsReportErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition of a cost detailed report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateCostDetailsReportRequestDefinition { + #[doc = "The type of the detailed report. By default ActualCost is provided"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metric: Option, + #[doc = "The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months."] + #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] + pub time_period: Option, + #[doc = "This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost."] + #[serde(rename = "billingPeriod", default, skip_serializing_if = "Option::is_none")] + pub billing_period: Option, + #[doc = "This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost."] + #[serde(rename = "invoiceId", default, skip_serializing_if = "Option::is_none")] + pub invoice_id: Option, +} +impl GenerateCostDetailsReportRequestDefinition { + pub fn new() -> Self { + Self::default() + } +} +pub mod generate_cost_details_report_request_definition { + use super::*; + #[doc = "The type of the detailed report. By default ActualCost is provided"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Metric")] + pub enum Metric { + ActualCost, + AmortizedCost, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Metric { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Metric { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Metric { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ActualCost => serializer.serialize_unit_variant("Metric", 0u32, "ActualCost"), + Self::AmortizedCost => serializer.serialize_unit_variant("Metric", 1u32, "AmortizedCost"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The definition of a cost detailed report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateDetailedCostReportDefinition { + #[doc = "The type of the detailed report. By default ActualCost is provided"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metric: Option, + #[doc = "The start and end date for pulling data for the cost detailed report."] + #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] + pub time_period: Option, + #[doc = "Billing period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided."] + #[serde(rename = "billingPeriod", default, skip_serializing_if = "Option::is_none")] + pub billing_period: Option, + #[doc = "Invoice ID for Pay-as-you-go and Microsoft Customer Agreement scopes. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided."] + #[serde(rename = "invoiceId", default, skip_serializing_if = "Option::is_none")] + pub invoice_id: Option, + #[doc = "Customer ID for Microsoft Customer Agreement scopes (Invoice Id is also required for this)."] + #[serde(rename = "customerId", default, skip_serializing_if = "Option::is_none")] + pub customer_id: Option, +} +impl GenerateDetailedCostReportDefinition { + pub fn new() -> Self { + Self::default() + } +} +pub mod generate_detailed_cost_report_definition { + use super::*; + #[doc = "The type of the detailed report. By default ActualCost is provided"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Metric")] + pub enum Metric { + ActualCost, + AmortizedCost, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Metric { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Metric { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Metric { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ActualCost => serializer.serialize_unit_variant("Metric", 0u32, "ActualCost"), + Self::AmortizedCost => serializer.serialize_unit_variant("Metric", 1u32, "AmortizedCost"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature instead. \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateDetailedCostReportErrorResponse { + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl GenerateDetailedCostReportErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The result of the long running operation for cost detailed report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateDetailedCostReportOperationResult { + #[doc = "The ARM resource id of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the long running operation."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The URL to download the generated report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl GenerateDetailedCostReportOperationResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The status of the long running operation for cost detailed report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateDetailedCostReportOperationStatuses { + #[doc = "The ID of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The status of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The startTime of the operation."] + #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The endTime of the operation."] + #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The type of the long running operation."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The details of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + #[doc = "The URL to download the generated report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl GenerateDetailedCostReportOperationStatuses { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The start and end date for pulling data for the cost detailed report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GenerateDetailedCostReportTimePeriod { + #[doc = "The start date to pull data from. example format 2020-03-15"] + pub start: String, + #[doc = "The end date to pull data to. example format 2020-03-15"] + pub end: String, +} +impl GenerateDetailedCostReportTimePeriod { + pub fn new(start: String, end: String) -> Self { + Self { start, end } + } +} +#[doc = "Grain which corresponds to value."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "Grain")] +pub enum Grain { + Hourly, + Daily, + Monthly, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for Grain { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for Grain { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for Grain { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Hourly => serializer.serialize_unit_variant("Grain", 0u32, "Hourly"), + Self::Daily => serializer.serialize_unit_variant("Grain", 1u32, "Daily"), + Self::Monthly => serializer.serialize_unit_variant("Grain", 2u32, "Monthly"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The granularity of rows in the forecast."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "GranularityType")] +pub enum GranularityType { + Daily, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for GranularityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for GranularityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for GranularityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("GranularityType", 0u32, "Daily"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Included Quantity utilization summary resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IncludedQuantityUtilizationSummary { + #[serde(flatten)] + pub benefit_utilization_summary: BenefitUtilizationSummary, + #[doc = "Included Quantity utilization summary properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IncludedQuantityUtilizationSummary { + pub fn new(benefit_utilization_summary: BenefitUtilizationSummary) -> Self { + Self { + benefit_utilization_summary, + properties: None, + } + } +} +#[doc = "Included Quantity utilization summary properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IncludedQuantityUtilizationSummaryProperties { + #[serde(flatten)] + pub benefit_utilization_summary_properties: BenefitUtilizationSummaryProperties, + #[doc = "This is the utilized percentage for the benefit ID."] + #[serde(rename = "utilizationPercentage", default, skip_serializing_if = "Option::is_none")] + pub utilization_percentage: Option, +} +impl IncludedQuantityUtilizationSummaryProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Each KPI must contain a 'type' and 'enabled' key."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct KpiProperties { + #[doc = "KPI type (Forecast, Budget)."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "ID of resource related to metric (budget)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "show the KPI in the UI?"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl KpiProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod kpi_properties { + use super::*; + #[doc = "KPI type (Forecast, Budget)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Forecast, + Budget, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Forecast => serializer.serialize_unit_variant("Type", 0u32, "Forecast"), + Self::Budget => serializer.serialize_unit_variant("Type", 1u32, "Budget"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +pub type Language = String; +#[doc = "The number of days used to look back."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "LookBackPeriod")] +pub enum LookBackPeriod { + Last7Days, + Last30Days, + Last60Days, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for LookBackPeriod { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for LookBackPeriod { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for LookBackPeriod { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Last7Days => serializer.serialize_unit_variant("LookBackPeriod", 0u32, "Last7Days"), + Self::Last30Days => serializer.serialize_unit_variant("LookBackPeriod", 1u32, "Last30Days"), + Self::Last60Days => serializer.serialize_unit_variant("LookBackPeriod", 2u32, "Last60Days"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The notification associated with a budget.\n\n Supported for CategoryType(s): Cost, ReservationUtilization."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Notification { + #[doc = "The notification is enabled or not.\n\n Supported for CategoryType(s): Cost, ReservationUtilization."] + pub enabled: bool, + #[doc = "The comparison operator.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Supported operators for **CategoryType: Cost**\n- GreaterThan\n- GreaterThanOrEqualTo\n\n Supported operators for **CategoryType: ReservationUtilization**\n- LessThan"] + pub operator: notification::Operator, + #[doc = "Threshold value associated with a notification. It is always percent with a maximum of 2 decimal places.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold.\n\n **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has a utilization percentage below the threshold."] + pub threshold: f64, + #[doc = "Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).\n\n Supported for CategoryType(s): ReservationUtilization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub frequency: Option, + #[doc = "Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.\n\n Supported for CategoryType(s): Cost, ReservationUtilization."] + #[serde(rename = "contactEmails")] + pub contact_emails: Vec, + #[doc = "Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.\n\n Supported for CategoryType(s): Cost."] + #[serde( + rename = "contactRoles", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub contact_roles: Vec, + #[doc = "Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.\n\n Supported for CategoryType(s): Cost."] + #[serde( + rename = "contactGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub contact_groups: Vec, + #[doc = "The type of threshold.\n\n Supported for CategoryType(s): Cost."] + #[serde(rename = "thresholdType", default, skip_serializing_if = "Option::is_none")] + pub threshold_type: Option, + #[doc = "Language in which the recipient will receive the notification, \n\n Supported for CategoryType(s): Cost, ReservationUtilization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locale: Option, +} +impl Notification { + pub fn new(enabled: bool, operator: notification::Operator, threshold: f64, contact_emails: Vec) -> Self { + Self { + enabled, + operator, + threshold, + frequency: None, + contact_emails, + contact_roles: Vec::new(), + contact_groups: Vec::new(), + threshold_type: None, + locale: None, + } + } +} +pub mod notification { + use super::*; + #[doc = "The comparison operator.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Supported operators for **CategoryType: Cost**\n- GreaterThan\n- GreaterThanOrEqualTo\n\n Supported operators for **CategoryType: ReservationUtilization**\n- LessThan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + EqualTo, + GreaterThan, + GreaterThanOrEqualTo, + LessThan, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::EqualTo => serializer.serialize_unit_variant("Operator", 0u32, "EqualTo"), + Self::GreaterThan => serializer.serialize_unit_variant("Operator", 1u32, "GreaterThan"), + Self::GreaterThanOrEqualTo => serializer.serialize_unit_variant("Operator", 2u32, "GreaterThanOrEqualTo"), + Self::LessThan => serializer.serialize_unit_variant("Operator", 3u32, "LessThan"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).\n\n Supported for CategoryType(s): ReservationUtilization."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Frequency")] + pub enum Frequency { + Daily, + Weekly, + Monthly, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Frequency { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Frequency { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Frequency { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("Frequency", 0u32, "Daily"), + Self::Weekly => serializer.serialize_unit_variant("Frequency", 1u32, "Weekly"), + Self::Monthly => serializer.serialize_unit_variant("Frequency", 2u32, "Monthly"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of threshold.\n\n Supported for CategoryType(s): Cost."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ThresholdType")] + pub enum ThresholdType { + Actual, + Forecasted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ThresholdType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ThresholdType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ThresholdType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Actual => serializer.serialize_unit_variant("ThresholdType", 0u32, "Actual"), + Self::Forecasted => serializer.serialize_unit_variant("ThresholdType", 1u32, "Forecasted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ThresholdType { + fn default() -> Self { + Self::Actual + } + } + #[doc = "Language in which the recipient will receive the notification, \n\n Supported for CategoryType(s): Cost, ReservationUtilization."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Locale")] + pub enum Locale { + #[serde(rename = "en-us")] + EnUs, + #[serde(rename = "ja-jp")] + JaJp, + #[serde(rename = "zh-cn")] + ZhCn, + #[serde(rename = "de-de")] + DeDe, + #[serde(rename = "es-es")] + EsEs, + #[serde(rename = "fr-fr")] + FrFr, + #[serde(rename = "it-it")] + ItIt, + #[serde(rename = "ko-kr")] + KoKr, + #[serde(rename = "pt-br")] + PtBr, + #[serde(rename = "ru-ru")] + RuRu, + #[serde(rename = "zh-tw")] + ZhTw, + #[serde(rename = "cs-cz")] + CsCz, + #[serde(rename = "pl-pl")] + PlPl, + #[serde(rename = "tr-tr")] + TrTr, + #[serde(rename = "da-dk")] + DaDk, + #[serde(rename = "en-gb")] + EnGb, + #[serde(rename = "hu-hu")] + HuHu, + #[serde(rename = "nb-no")] + NbNo, + #[serde(rename = "nl-nl")] + NlNl, + #[serde(rename = "pt-pt")] + PtPt, + #[serde(rename = "sv-se")] + SvSe, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Locale { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Locale { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Locale { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::EnUs => serializer.serialize_unit_variant("Locale", 0u32, "en-us"), + Self::JaJp => serializer.serialize_unit_variant("Locale", 1u32, "ja-jp"), + Self::ZhCn => serializer.serialize_unit_variant("Locale", 2u32, "zh-cn"), + Self::DeDe => serializer.serialize_unit_variant("Locale", 3u32, "de-de"), + Self::EsEs => serializer.serialize_unit_variant("Locale", 4u32, "es-es"), + Self::FrFr => serializer.serialize_unit_variant("Locale", 5u32, "fr-fr"), + Self::ItIt => serializer.serialize_unit_variant("Locale", 6u32, "it-it"), + Self::KoKr => serializer.serialize_unit_variant("Locale", 7u32, "ko-kr"), + Self::PtBr => serializer.serialize_unit_variant("Locale", 8u32, "pt-br"), + Self::RuRu => serializer.serialize_unit_variant("Locale", 9u32, "ru-ru"), + Self::ZhTw => serializer.serialize_unit_variant("Locale", 10u32, "zh-tw"), + Self::CsCz => serializer.serialize_unit_variant("Locale", 11u32, "cs-cz"), + Self::PlPl => serializer.serialize_unit_variant("Locale", 12u32, "pl-pl"), + Self::TrTr => serializer.serialize_unit_variant("Locale", 13u32, "tr-tr"), + Self::DaDk => serializer.serialize_unit_variant("Locale", 14u32, "da-dk"), + Self::EnGb => serializer.serialize_unit_variant("Locale", 15u32, "en-gb"), + Self::HuHu => serializer.serialize_unit_variant("Locale", 16u32, "hu-hu"), + Self::NbNo => serializer.serialize_unit_variant("Locale", 17u32, "nb-no"), + Self::NlNl => serializer.serialize_unit_variant("Locale", 18u32, "nl-nl"), + Self::PtPt => serializer.serialize_unit_variant("Locale", 19u32, "pt-pt"), + Self::SvSe => serializer.serialize_unit_variant("Locale", 20u32, "sv-se"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +pub type NotificationEmail = String; +#[doc = "The properties of the scheduled action notification."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationProperties { + #[doc = "Array of email addresses."] + pub to: Vec, + #[doc = "Language in which the email is localized, for ex: 'Fr'. When the specified language is not supported, email will be in english. The supported languages are cs (Czech), da (Danish), de (German), en (English), es (Spanish), fr (French), hu (Hungarian), id (Indonesian), it (Lithuanian), ja (Japanese), ko (Korean), nb (Norwegian Bokmål), nl (Dutch), pl (Polish), pt (Portuguese), ru (Russian), sv (Swedish), tr (Turkish), zh (Chinese) "] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub language: Option, + #[doc = "Optional message to be added in the email. Length is limited to 250 characters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "Language for formatting the date/time and currency values in the email. For ex: 'fr'. Defaulted to English, when the specified regional format is not supported. "] + #[serde(rename = "regionalFormat", default, skip_serializing_if = "Option::is_none")] + pub regional_format: Option, + #[doc = "Subject of the email. Length is limited to 70 characters."] + pub subject: String, +} +impl NotificationProperties { + pub fn new(to: Vec, subject: String) -> Self { + Self { + to, + language: None, + message: None, + regional_format: None, + subject, + } + } +} +#[doc = "Details of a REST API operation, returned from the Resource Provider Operations API"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Localized display information for this particular operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[serde(rename = "actionType", default, skip_serializing_if = "Option::is_none")] + pub action_type: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Localized display information for this particular operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The short, localized friendly description of the operation; suitable for tool tips and detailed views."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(rename = "user,system")] + UserSystem, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UserSystem => serializer.serialize_unit_variant("Origin", 2u32, "user,system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + Internal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Internal => serializer.serialize_unit_variant("ActionType", 0u32, "Internal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of cost management operations supported by the Microsoft.CostManagement resource provider."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The status of the long running operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationStatus { + #[doc = "The status of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The URL to download the generated report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl OperationStatus { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation_status { + use super::*; + #[doc = "The status of the long running operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Running, + Completed, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Running => serializer.serialize_unit_variant("Status", 0u32, "Running"), + Self::Completed => serializer.serialize_unit_variant("Status", 1u32, "Completed"), + Self::Failed => serializer.serialize_unit_variant("Status", 2u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Each pivot must contain a 'type' and 'name'."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PivotProperties { + #[doc = "Data type to show in view."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Data field to show in view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl PivotProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod pivot_properties { + use super::*; + #[doc = "Data type to show in view."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Dimension, + TagKey, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Dimension => serializer.serialize_unit_variant("Type", 0u32, "Dimension"), + Self::TagKey => serializer.serialize_unit_variant("Type", 1u32, "TagKey"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The aggregation expression to be used in the query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryAggregation { + #[doc = "The name of the column to aggregate."] + pub name: String, + #[doc = "The name of the aggregation function to use."] + pub function: query_aggregation::Function, +} +impl QueryAggregation { + pub fn new(name: String, function: query_aggregation::Function) -> Self { + Self { name, function } + } +} +pub mod query_aggregation { + use super::*; + #[doc = "The name of the aggregation function to use."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Function")] + pub enum Function { + Sum, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Function { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Function { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Function { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Sum => serializer.serialize_unit_variant("Function", 0u32, "Sum"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "QueryColumn properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryColumn { + #[doc = "The name of column."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of column."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl QueryColumn { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The type of the column in the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "QueryColumnType")] +pub enum QueryColumnType { + TagKey, + Dimension, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for QueryColumnType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for QueryColumnType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for QueryColumnType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::TagKey => serializer.serialize_unit_variant("QueryColumnType", 0u32, "TagKey"), + Self::Dimension => serializer.serialize_unit_variant("QueryColumnType", 1u32, "Dimension"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The comparison expression to be used in the query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryComparisonExpression { + #[doc = "The name of the column to use in comparison."] + pub name: String, + #[doc = "The operator to use for comparison."] + pub operator: query_comparison_expression::Operator, + #[doc = "Array of values to use for comparison"] + pub values: Vec, +} +impl QueryComparisonExpression { + pub fn new(name: String, operator: query_comparison_expression::Operator, values: Vec) -> Self { + Self { name, operator, values } + } +} +pub mod query_comparison_expression { + use super::*; + #[doc = "The operator to use for comparison."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + In, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::In => serializer.serialize_unit_variant("Operator", 0u32, "In"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The definition of data present in the query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryDataset { + #[doc = "The granularity of rows in the query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub granularity: Option, + #[doc = "The configuration of dataset in the query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + #[doc = "Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub aggregation: Option, + #[doc = "Array of group by expression to use in the query. Query can have up to 2 group by clauses."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub grouping: Vec, + #[doc = "The filter expression to be used in the export."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, +} +impl QueryDataset { + pub fn new() -> Self { + Self::default() + } +} +pub mod query_dataset { + use super::*; + #[doc = "The granularity of rows in the query."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Granularity")] + pub enum Granularity { + Daily, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Granularity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Granularity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Granularity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The configuration of dataset in the query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryDatasetConfiguration { + #[doc = "Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub columns: Vec, +} +impl QueryDatasetConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition of a query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryDefinition { + #[doc = "The type of the query."] + #[serde(rename = "type")] + pub type_: query_definition::Type, + #[doc = "The time frame for pulling data for the query. If custom, then a specific time period must be provided."] + pub timeframe: query_definition::Timeframe, + #[doc = "The start and end date for pulling data for the query."] + #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] + pub time_period: Option, + #[doc = "The definition of data present in the query."] + pub dataset: QueryDataset, +} +impl QueryDefinition { + pub fn new(type_: query_definition::Type, timeframe: query_definition::Timeframe, dataset: QueryDataset) -> Self { + Self { + type_, + timeframe, + time_period: None, + dataset, + } + } +} +pub mod query_definition { + use super::*; + #[doc = "The type of the query."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Usage, + ActualCost, + AmortizedCost, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), + Self::ActualCost => serializer.serialize_unit_variant("Type", 1u32, "ActualCost"), + Self::AmortizedCost => serializer.serialize_unit_variant("Type", 2u32, "AmortizedCost"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The time frame for pulling data for the query. If custom, then a specific time period must be provided."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Timeframe")] + pub enum Timeframe { + MonthToDate, + BillingMonthToDate, + TheLastMonth, + TheLastBillingMonth, + WeekToDate, + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Timeframe { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Timeframe { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Timeframe { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "MonthToDate"), + Self::BillingMonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "BillingMonthToDate"), + Self::TheLastMonth => serializer.serialize_unit_variant("Timeframe", 2u32, "TheLastMonth"), + Self::TheLastBillingMonth => serializer.serialize_unit_variant("Timeframe", 3u32, "TheLastBillingMonth"), + Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 4u32, "WeekToDate"), + Self::Custom => serializer.serialize_unit_variant("Timeframe", 5u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The filter expression to be used in the export."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryFilter { + #[doc = "The logical \"AND\" expression. Must have at least 2 items."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub and: Vec, + #[doc = "The logical \"OR\" expression. Must have at least 2 items."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub or: Vec, + #[doc = "The comparison expression to be used in the query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dimensions: Option, + #[doc = "The comparison expression to be used in the query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl QueryFilter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The group by expression to be used in the query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryGrouping { + #[doc = "The type of the column in the export."] + #[serde(rename = "type")] + pub type_: QueryColumnType, + #[doc = "The name of the column to group."] + pub name: String, +} +impl QueryGrouping { + pub fn new(type_: QueryColumnType, name: String) -> Self { + Self { type_, name } + } +} +#[doc = "Query properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryProperties { + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of columns"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub columns: Vec, + #[doc = "Array of rows"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rows: Vec>, +} +impl QueryProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of query. It contains all columns listed under groupings and aggregation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryResult { + #[serde(flatten)] + pub cost_management_resource: CostManagementResource, + #[doc = "Query properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl QueryResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The start and end date for pulling data for the query."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueryTimePeriod { + #[doc = "The start date to pull data from."] + #[serde(with = "azure_core::date::rfc3339")] + pub from: time::OffsetDateTime, + #[doc = "The end date to pull data to."] + #[serde(with = "azure_core::date::rfc3339")] + pub to: time::OffsetDateTime, +} +impl QueryTimePeriod { + pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { + Self { from, to } + } +} +#[doc = "Kind of the recommendation scope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RecommendationScope")] +pub enum RecommendationScope { + Single, + Shared, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RecommendationScope { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RecommendationScope { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RecommendationScope { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Single => serializer.serialize_unit_variant("RecommendationScope", 0u32, "Single"), + Self::Shared => serializer.serialize_unit_variant("RecommendationScope", 1u32, "Shared"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +pub type RegionalFormat = String; +#[doc = "The aggregation expression to be used in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReportConfigAggregation { + #[doc = "The name of the column to aggregate."] + pub name: String, + #[doc = "The name of the aggregation function to use."] + pub function: report_config_aggregation::Function, +} +impl ReportConfigAggregation { + pub fn new(name: String, function: report_config_aggregation::Function) -> Self { + Self { name, function } + } +} +pub mod report_config_aggregation { + use super::*; + #[doc = "The name of the aggregation function to use."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Function")] + pub enum Function { + Sum, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Function { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Function { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Function { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Sum => serializer.serialize_unit_variant("Function", 0u32, "Sum"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The type of the column in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ReportConfigColumnType")] +pub enum ReportConfigColumnType { + TagKey, + Dimension, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ReportConfigColumnType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ReportConfigColumnType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ReportConfigColumnType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::TagKey => serializer.serialize_unit_variant("ReportConfigColumnType", 0u32, "TagKey"), + Self::Dimension => serializer.serialize_unit_variant("ReportConfigColumnType", 1u32, "Dimension"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The comparison expression to be used in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReportConfigComparisonExpression { + #[doc = "The name of the column to use in comparison."] + pub name: String, + #[doc = "The operator to use for comparison."] + pub operator: report_config_comparison_expression::Operator, + #[doc = "Array of values to use for comparison"] + pub values: Vec, +} +impl ReportConfigComparisonExpression { + pub fn new(name: String, operator: report_config_comparison_expression::Operator, values: Vec) -> Self { + Self { name, operator, values } + } +} +pub mod report_config_comparison_expression { + use super::*; + #[doc = "The operator to use for comparison."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + In, + Contains, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::In => serializer.serialize_unit_variant("Operator", 0u32, "In"), + Self::Contains => serializer.serialize_unit_variant("Operator", 1u32, "Contains"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The definition of data present in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ReportConfigDataset { + #[doc = "The granularity of rows in the report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub granularity: Option, + #[doc = "The configuration of dataset in the report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + #[doc = "Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub aggregation: Option, + #[doc = "Array of group by expression to use in the report. Report can have up to 2 group by clauses."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub grouping: Vec, + #[doc = "Array of order by expression to use in the report."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub sorting: Vec, + #[doc = "The filter expression to be used in the report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, +} +impl ReportConfigDataset { + pub fn new() -> Self { + Self::default() + } +} +pub mod report_config_dataset { + use super::*; + #[doc = "The granularity of rows in the report."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Granularity")] + pub enum Granularity { + Daily, + Monthly, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Granularity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Granularity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Granularity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("Granularity", 0u32, "Daily"), + Self::Monthly => serializer.serialize_unit_variant("Granularity", 1u32, "Monthly"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The configuration of dataset in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ReportConfigDatasetConfiguration { + #[doc = "Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub columns: Vec, +} +impl ReportConfigDatasetConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition of a report config."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReportConfigDefinition { + #[doc = "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates."] + #[serde(rename = "type")] + pub type_: report_config_definition::Type, + #[doc = "The time frame for pulling data for the report. If custom, then a specific time period must be provided."] + pub timeframe: report_config_definition::Timeframe, + #[doc = "The start and end date for pulling data for the report."] + #[serde(rename = "timePeriod", default, skip_serializing_if = "Option::is_none")] + pub time_period: Option, + #[doc = "The definition of data present in the report."] + #[serde(rename = "dataSet", default, skip_serializing_if = "Option::is_none")] + pub data_set: Option, + #[doc = "If true, report includes monetary commitment."] + #[serde(rename = "includeMonetaryCommitment", default, skip_serializing_if = "Option::is_none")] + pub include_monetary_commitment: Option, +} +impl ReportConfigDefinition { + pub fn new(type_: report_config_definition::Type, timeframe: report_config_definition::Timeframe) -> Self { + Self { + type_, + timeframe, + time_period: None, + data_set: None, + include_monetary_commitment: None, + } + } +} +pub mod report_config_definition { + use super::*; + #[doc = "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Usage, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Usage => serializer.serialize_unit_variant("Type", 0u32, "Usage"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The time frame for pulling data for the report. If custom, then a specific time period must be provided."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Timeframe")] + pub enum Timeframe { + WeekToDate, + MonthToDate, + YearToDate, + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Timeframe { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Timeframe { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Timeframe { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WeekToDate => serializer.serialize_unit_variant("Timeframe", 0u32, "WeekToDate"), + Self::MonthToDate => serializer.serialize_unit_variant("Timeframe", 1u32, "MonthToDate"), + Self::YearToDate => serializer.serialize_unit_variant("Timeframe", 2u32, "YearToDate"), + Self::Custom => serializer.serialize_unit_variant("Timeframe", 3u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The filter expression to be used in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ReportConfigFilter { + #[doc = "The logical \"AND\" expression. Must have at least 2 items."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub and: Vec, + #[doc = "The logical \"OR\" expression. Must have at least 2 items."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub or: Vec, + #[doc = "The comparison expression to be used in the report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dimensions: Option, + #[doc = "The comparison expression to be used in the report."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl ReportConfigFilter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The group by expression to be used in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReportConfigGrouping { + #[doc = "The type of the column in the report."] + #[serde(rename = "type")] + pub type_: ReportConfigColumnType, + #[doc = "The name of the column to group. This version supports subscription lowest possible grain."] + pub name: String, +} +impl ReportConfigGrouping { + pub fn new(type_: ReportConfigColumnType, name: String) -> Self { + Self { type_, name } + } +} +#[doc = "The order by expression to be used in the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReportConfigSorting { + #[doc = "Direction of sort."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[doc = "The name of the column to sort."] + pub name: String, +} +impl ReportConfigSorting { + pub fn new(name: String) -> Self { + Self { direction: None, name } + } +} +pub mod report_config_sorting { + use super::*; + #[doc = "Direction of sort."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Direction")] + pub enum Direction { + Ascending, + Descending, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Direction { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Direction { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Direction { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Ascending => serializer.serialize_unit_variant("Direction", 0u32, "Ascending"), + Self::Descending => serializer.serialize_unit_variant("Direction", 1u32, "Descending"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The start and end date for pulling data for the report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReportConfigTimePeriod { + #[doc = "The start date to pull data from."] + #[serde(with = "azure_core::date::rfc3339")] + pub from: time::OffsetDateTime, + #[doc = "The end date to pull data to."] + #[serde(with = "azure_core::date::rfc3339")] + pub to: time::OffsetDateTime, +} +impl ReportConfigTimePeriod { + pub fn new(from: time::OffsetDateTime, to: time::OffsetDateTime) -> Self { + Self { from, to } + } +} +#[doc = "The manifest of the report generated by the operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ReportManifest { + #[doc = "The Manifest version."] + #[serde(rename = "manifestVersion", default, skip_serializing_if = "Option::is_none")] + pub manifest_version: Option, + #[doc = "The data format of the report"] + #[serde(rename = "dataFormat", default, skip_serializing_if = "Option::is_none")] + pub data_format: Option, + #[doc = "The total number of bytes in all blobs."] + #[serde(rename = "byteCount", default, skip_serializing_if = "Option::is_none")] + pub byte_count: Option, + #[doc = "The total number of blobs."] + #[serde(rename = "blobCount", default, skip_serializing_if = "Option::is_none")] + pub blob_count: Option, + #[doc = "Is the data in compressed format."] + #[serde(rename = "compressData", default, skip_serializing_if = "Option::is_none")] + pub compress_data: Option, + #[doc = "The context of the Cost Details request."] + #[serde(rename = "requestContext", default, skip_serializing_if = "Option::is_none")] + pub request_context: Option, + #[doc = "List of blob information generated by this operation."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub blobs: Vec, +} +impl ReportManifest { + pub fn new() -> Self { + Self::default() + } +} +pub mod report_manifest { + use super::*; + #[doc = "The data format of the report"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DataFormat")] + pub enum DataFormat { + Csv, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DataFormat { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DataFormat { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DataFormat { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Csv => serializer.serialize_unit_variant("DataFormat", 0u32, "Csv"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The URL to download the generated report."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ReportUrl { + #[doc = "The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity"] + #[serde(rename = "reportUrl", default, skip_serializing_if = "Option::is_none")] + pub report_url: Option, + #[doc = "The time at which report URL becomes invalid."] + #[serde(rename = "validUntil", default, with = "azure_core::date::rfc3339::option")] + pub valid_until: Option, +} +impl ReportUrl { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The context of the Cost Details request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RequestContext { + #[doc = "The request scope of the request."] + #[serde(rename = "requestScope", default, skip_serializing_if = "Option::is_none")] + pub request_scope: Option, + #[doc = "The definition of a cost detailed report."] + #[serde(rename = "requestBody", default, skip_serializing_if = "Option::is_none")] + pub request_body: Option, +} +impl RequestContext { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ReservationReportSchema")] +pub enum ReservationReportSchema { + InstanceFlexibilityGroup, + InstanceFlexibilityRatio, + InstanceId, + Kind, + ReservationId, + ReservationOrderId, + ReservedHours, + SkuName, + TotalReservedQuantity, + UsageDate, + UsedHours, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ReservationReportSchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ReservationReportSchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ReservationReportSchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InstanceFlexibilityGroup => { + serializer.serialize_unit_variant("ReservationReportSchema", 0u32, "InstanceFlexibilityGroup") + } + Self::InstanceFlexibilityRatio => { + serializer.serialize_unit_variant("ReservationReportSchema", 1u32, "InstanceFlexibilityRatio") + } + Self::InstanceId => serializer.serialize_unit_variant("ReservationReportSchema", 2u32, "InstanceId"), + Self::Kind => serializer.serialize_unit_variant("ReservationReportSchema", 3u32, "Kind"), + Self::ReservationId => serializer.serialize_unit_variant("ReservationReportSchema", 4u32, "ReservationId"), + Self::ReservationOrderId => serializer.serialize_unit_variant("ReservationReportSchema", 5u32, "ReservationOrderId"), + Self::ReservedHours => serializer.serialize_unit_variant("ReservationReportSchema", 6u32, "ReservedHours"), + Self::SkuName => serializer.serialize_unit_variant("ReservationReportSchema", 7u32, "SkuName"), + Self::TotalReservedQuantity => serializer.serialize_unit_variant("ReservationReportSchema", 8u32, "TotalReservedQuantity"), + Self::UsageDate => serializer.serialize_unit_variant("ReservationReportSchema", 9u32, "UsageDate"), + Self::UsedHours => serializer.serialize_unit_variant("ReservationReportSchema", 10u32, "UsedHours"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Savings plan utilization summary resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SavingsPlanUtilizationSummary { + #[serde(flatten)] + pub benefit_utilization_summary: BenefitUtilizationSummary, + #[doc = "Savings plan utilization summary properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SavingsPlanUtilizationSummary { + pub fn new(benefit_utilization_summary: BenefitUtilizationSummary) -> Self { + Self { + benefit_utilization_summary, + properties: None, + } + } +} +#[doc = "Savings plan utilization summary properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SavingsPlanUtilizationSummaryProperties { + #[serde(flatten)] + pub benefit_utilization_summary_properties: BenefitUtilizationSummaryProperties, + #[doc = "This is the average hourly utilization for each date range that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2023-04-01-preview and usageDate < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, the avgUtilizationPercentage value will be equal to the average of the set of values where the set contains 24 utilization percentage entries one for each hour in a specific day."] + #[serde(rename = "avgUtilizationPercentage", default, skip_serializing_if = "Option::is_none")] + pub avg_utilization_percentage: Option, + #[doc = "This is the minimum hourly utilization for each date range that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2023-04-01-preview and usageDate < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, the minUtilizationPercentage value will be equal to the smallest in the set of values where the set contains 24 utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the lowest utilization percentage was 10% at hour 4, then the value for the minUtilizationPercentage in the response will be 10%."] + #[serde(rename = "minUtilizationPercentage", default, skip_serializing_if = "Option::is_none")] + pub min_utilization_percentage: Option, + #[doc = "This is the maximum hourly utilization for each date range that corresponds to given grain (Daily, Monthly). Suppose the API call is for usageDate > 2023-04-01-preview and usageDate < 2022-10-31 at a daily granularity. There will be one record per benefit id for each day. For a single day, the maxUtilizationPercentage value will be equal to the largest in the set of values where the set contains 24 utilization percentage entries one for each hour in a specific day. If on the day 2022-10-18, the largest utilization percentage was 90% at hour 5, then the value for the maxUtilizationPercentage in the response will be 90%."] + #[serde(rename = "maxUtilizationPercentage", default, skip_serializing_if = "Option::is_none")] + pub max_utilization_percentage: Option, +} +impl SavingsPlanUtilizationSummaryProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Frequency of the schedule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScheduleFrequency")] +pub enum ScheduleFrequency { + Daily, + Weekly, + Monthly, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScheduleFrequency { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScheduleFrequency { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScheduleFrequency { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Daily => serializer.serialize_unit_variant("ScheduleFrequency", 0u32, "Daily"), + Self::Weekly => serializer.serialize_unit_variant("ScheduleFrequency", 1u32, "Weekly"), + Self::Monthly => serializer.serialize_unit_variant("ScheduleFrequency", 2u32, "Monthly"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The properties of the schedule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScheduleProperties { + #[doc = "Frequency of the schedule."] + pub frequency: ScheduleFrequency, + #[doc = "UTC time at which cost analysis data will be emailed."] + #[serde(rename = "hourOfDay", default, skip_serializing_if = "Option::is_none")] + pub hour_of_day: Option, + #[doc = "Day names in english on which cost analysis data will be emailed. This property is applicable when frequency is Weekly or Monthly."] + #[serde( + rename = "daysOfWeek", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub days_of_week: Vec, + #[doc = "Weeks in which cost analysis data will be emailed. This property is applicable when frequency is Monthly and used in combination with daysOfWeek."] + #[serde( + rename = "weeksOfMonth", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub weeks_of_month: Vec, + #[doc = "UTC day on which cost analysis data will be emailed. Must be between 1 and 31. This property is applicable when frequency is Monthly and overrides weeksOfMonth or daysOfWeek."] + #[serde(rename = "dayOfMonth", default, skip_serializing_if = "Option::is_none")] + pub day_of_month: Option, + #[doc = "The start date and time of the scheduled action (UTC)."] + #[serde(rename = "startDate", with = "azure_core::date::rfc3339")] + pub start_date: time::OffsetDateTime, + #[doc = "The end date and time of the scheduled action (UTC)."] + #[serde(rename = "endDate", with = "azure_core::date::rfc3339")] + pub end_date: time::OffsetDateTime, +} +impl ScheduleProperties { + pub fn new(frequency: ScheduleFrequency, start_date: time::OffsetDateTime, end_date: time::OffsetDateTime) -> Self { + Self { + frequency, + hour_of_day: None, + days_of_week: Vec::new(), + weeks_of_month: Vec::new(), + day_of_month: None, + start_date, + end_date, + } + } +} +#[doc = "Scheduled action definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScheduledAction { + #[serde(flatten)] + pub scheduled_action_proxy_resource: ScheduledActionProxyResource, + #[doc = "The properties of the scheduled action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ScheduledAction { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Kind of the scheduled action."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScheduledActionKind")] +pub enum ScheduledActionKind { + Email, + InsightAlert, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScheduledActionKind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScheduledActionKind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScheduledActionKind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Email => serializer.serialize_unit_variant("ScheduledActionKind", 0u32, "Email"), + Self::InsightAlert => serializer.serialize_unit_variant("ScheduledActionKind", 1u32, "InsightAlert"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Scheduled actions list result. It contains a list of scheduled actions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScheduledActionListResult { + #[doc = "The list of scheduled actions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ScheduledActionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ScheduledActionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the scheduled action."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScheduledActionProperties { + #[doc = "Scheduled action name."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Destination of the view data. This is optional. Currently only CSV format is supported."] + #[serde(rename = "fileDestination", default, skip_serializing_if = "Option::is_none")] + pub file_destination: Option, + #[doc = "The properties of the scheduled action notification."] + pub notification: NotificationProperties, + #[doc = "Email address of the point of contact that should get the unsubscribe requests and notification emails."] + #[serde(rename = "notificationEmail", default, skip_serializing_if = "Option::is_none")] + pub notification_email: Option, + #[doc = "The properties of the schedule."] + pub schedule: ScheduleProperties, + #[doc = "Cost Management scope like 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option, + #[doc = "Status of the scheduled action."] + pub status: ScheduledActionStatus, + #[doc = "Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'"] + #[serde(rename = "viewId")] + pub view_id: String, +} +impl ScheduledActionProperties { + pub fn new( + display_name: String, + notification: NotificationProperties, + schedule: ScheduleProperties, + status: ScheduledActionStatus, + view_id: String, + ) -> Self { + Self { + display_name, + file_destination: None, + notification, + notification_email: None, + schedule, + scope: None, + status, + view_id, + } + } +} +#[doc = "The Resource model definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScheduledActionProxyResource { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Resource Etag. For update calls, eTag is mandatory. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required."] + #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] + pub e_tag: Option, + #[doc = "Kind of the scheduled action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl ScheduledActionProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Status of the scheduled action."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScheduledActionStatus")] +pub enum ScheduledActionStatus { + Enabled, + Expired, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScheduledActionStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScheduledActionStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScheduledActionStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("ScheduledActionStatus", 0u32, "Enabled"), + Self::Expired => serializer.serialize_unit_variant("ScheduledActionStatus", 1u32, "Expired"), + Self::Disabled => serializer.serialize_unit_variant("ScheduledActionStatus", 2u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The status of the long running operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Status { + #[doc = "The status of the long running operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl Status { + pub fn new() -> Self { + Self::default() + } +} +pub mod status { + use super::*; + #[doc = "The status of the long running operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + InProgress, + Completed, + Failed, + Queued, + NoDataFound, + ReadyToDownload, + TimedOut, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("Status", 0u32, "InProgress"), + Self::Completed => serializer.serialize_unit_variant("Status", 1u32, "Completed"), + Self::Failed => serializer.serialize_unit_variant("Status", 2u32, "Failed"), + Self::Queued => serializer.serialize_unit_variant("Status", 3u32, "Queued"), + Self::NoDataFound => serializer.serialize_unit_variant("Status", 4u32, "NoDataFound"), + Self::ReadyToDownload => serializer.serialize_unit_variant("Status", 5u32, "ReadyToDownload"), + Self::TimedOut => serializer.serialize_unit_variant("Status", 6u32, "TimedOut"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Grain which corresponds to value."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "Term")] +pub enum Term { + #[serde(rename = "P1Y")] + P1y, + #[serde(rename = "P3Y")] + P3y, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for Term { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for Term { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for Term { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1y => serializer.serialize_unit_variant("Term", 0u32, "P1Y"), + Self::P3y => serializer.serialize_unit_variant("Term", 1u32, "P3Y"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "States and configurations of Cost Analysis."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct View { + #[serde(flatten)] + pub cost_management_proxy_resource: CostManagementProxyResource, + #[doc = "The properties of the view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl View { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of listing views. It contains a list of available views."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ViewListResult { + #[doc = "The list of views."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ViewListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ViewListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the view."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ViewProperties { + #[doc = "User input name of the view. Required."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scope: Option, + #[doc = "Date the user created this view."] + #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] + pub created_on: Option, + #[doc = "Date when the user last modified this view."] + #[serde(rename = "modifiedOn", default, with = "azure_core::date::rfc3339::option")] + pub modified_on: Option, + #[doc = "Date range of the current view."] + #[serde(rename = "dateRange", default, skip_serializing_if = "Option::is_none")] + pub date_range: Option, + #[doc = "Currency of the current view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[doc = "The definition of a report config."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, + #[doc = "Chart type of the main view in Cost Analysis. Required."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub chart: Option, + #[doc = "Show costs accumulated over time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub accumulated: Option, + #[doc = "Metric to use when displaying costs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metric: Option, + #[doc = "List of KPIs to show in Cost Analysis UI."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub kpis: Vec, + #[doc = "Configuration of 3 sub-views in the Cost Analysis UI."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub pivots: Vec, +} +impl ViewProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod view_properties { + use super::*; + #[doc = "Chart type of the main view in Cost Analysis. Required."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Chart")] + pub enum Chart { + Area, + Line, + StackedColumn, + GroupedColumn, + Table, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Chart { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Chart { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Chart { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Area => serializer.serialize_unit_variant("Chart", 0u32, "Area"), + Self::Line => serializer.serialize_unit_variant("Chart", 1u32, "Line"), + Self::StackedColumn => serializer.serialize_unit_variant("Chart", 2u32, "StackedColumn"), + Self::GroupedColumn => serializer.serialize_unit_variant("Chart", 3u32, "GroupedColumn"), + Self::Table => serializer.serialize_unit_variant("Chart", 4u32, "Table"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Show costs accumulated over time."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Accumulated")] + pub enum Accumulated { + #[serde(rename = "true")] + True, + #[serde(rename = "false")] + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Accumulated { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Accumulated { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Accumulated { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("Accumulated", 0u32, "true"), + Self::False => serializer.serialize_unit_variant("Accumulated", 1u32, "false"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Metric to use when displaying costs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Metric")] + pub enum Metric { + ActualCost, + AmortizedCost, + #[serde(rename = "AHUB")] + Ahub, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Metric { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Metric { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Metric { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ActualCost => serializer.serialize_unit_variant("Metric", 0u32, "ActualCost"), + Self::AmortizedCost => serializer.serialize_unit_variant("Metric", 1u32, "AmortizedCost"), + Self::Ahub => serializer.serialize_unit_variant("Metric", 2u32, "AHUB"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Weeks of month."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "WeeksOfMonth")] +pub enum WeeksOfMonth { + First, + Second, + Third, + Fourth, + Last, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for WeeksOfMonth { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for WeeksOfMonth { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for WeeksOfMonth { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::First => serializer.serialize_unit_variant("WeeksOfMonth", 0u32, "First"), + Self::Second => serializer.serialize_unit_variant("WeeksOfMonth", 1u32, "Second"), + Self::Third => serializer.serialize_unit_variant("WeeksOfMonth", 2u32, "Third"), + Self::Fourth => serializer.serialize_unit_variant("WeeksOfMonth", 3u32, "Fourth"), + Self::Last => serializer.serialize_unit_variant("WeeksOfMonth", 4u32, "Last"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Benefit recommendation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllSavingsBenefitDetails { + #[doc = "The difference between total cost and benefit cost for the 'totalHours' in the look-back period."] + #[serde(rename = "overageCost", default, skip_serializing_if = "Option::is_none")] + pub overage_cost: Option, + #[doc = "The estimated cost with benefit for the 'totalHours' in the look-back period. It's equal to (commitmentAmount * totalHours)"] + #[serde(rename = "benefitCost", default, skip_serializing_if = "Option::is_none")] + pub benefit_cost: Option, + #[doc = "Total cost, which is sum of benefit cost and overage cost."] + #[serde(rename = "totalCost", default, skip_serializing_if = "Option::is_none")] + pub total_cost: Option, + #[doc = "The amount saved for the 'totalHours' in the look-back period, by purchasing the recommended quantity of the benefit."] + #[serde(rename = "savingsAmount", default, skip_serializing_if = "Option::is_none")] + pub savings_amount: Option, + #[doc = "The savings in percentage for the 'totalHours' in the look-back period, by purchasing the recommended quantity of benefit."] + #[serde(rename = "savingsPercentage", default, skip_serializing_if = "Option::is_none")] + pub savings_percentage: Option, + #[doc = "Estimated benefit coverage percentage for the 'totalHours' in the look-back period, with this commitment."] + #[serde(rename = "coveragePercentage", default, skip_serializing_if = "Option::is_none")] + pub coverage_percentage: Option, + #[doc = "The commitment amount at the commitmentGranularity."] + #[serde(rename = "commitmentAmount", default, skip_serializing_if = "Option::is_none")] + pub commitment_amount: Option, + #[doc = "Estimated average utilization percentage for the 'totalHours' in the look-back period, with this commitment."] + #[serde(rename = "averageUtilizationPercentage", default, skip_serializing_if = "Option::is_none")] + pub average_utilization_percentage: Option, + #[doc = "Estimated unused portion of the 'benefitCost'."] + #[serde(rename = "wastageCost", default, skip_serializing_if = "Option::is_none")] + pub wastage_cost: Option, +} +impl AllSavingsBenefitDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The list of all benefit recommendations with the recommendation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllSavingsList { + #[doc = "The list of benefit recommendations with the recommendation details.."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (URL) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl AllSavingsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "benefit plan recommendation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenefitRecommendationModel { + #[serde(flatten)] + pub benefit_resource: BenefitResource, + #[doc = "The properties of the benefit recommendations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl BenefitRecommendationModel { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the benefit recommendations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BenefitRecommendationProperties { + #[doc = "The first usage date used for looking back for computing the recommendations."] + #[serde(rename = "firstConsumptionDate", default, with = "azure_core::date::rfc3339::option")] + pub first_consumption_date: Option, + #[doc = "The last usage date used for looking back for computing the recommendations."] + #[serde(rename = "lastConsumptionDate", default, with = "azure_core::date::rfc3339::option")] + pub last_consumption_date: Option, + #[doc = "The number of days used to look back."] + #[serde(rename = "lookBackPeriod", default, skip_serializing_if = "Option::is_none")] + pub look_back_period: Option, + #[doc = "The total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'."] + #[serde(rename = "totalHours", default, skip_serializing_if = "Option::is_none")] + pub total_hours: Option, + #[doc = "On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "ARM SKU name. 'Compute_Savings_Plan' for SavingsPlan."] + #[serde(rename = "armSkuName", default, skip_serializing_if = "Option::is_none")] + pub arm_sku_name: Option, + #[doc = "Grain which corresponds to value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub term: Option, + #[doc = "Grain which corresponds to value."] + #[serde(rename = "commitmentGranularity", default, skip_serializing_if = "Option::is_none")] + pub commitment_granularity: Option, + #[doc = "An ISO 4217 currency code identifier for the costs and savings amounts."] + #[serde(rename = "currencyCode", default, skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[doc = "The current cost without benefit, corresponds to 'totalHours' in the look-back period."] + #[serde(rename = "costWithoutBenefit", default, skip_serializing_if = "Option::is_none")] + pub cost_without_benefit: Option, + #[doc = "Benefit recommendation details."] + #[serde(rename = "recommendationDetails", default, skip_serializing_if = "Option::is_none")] + pub recommendation_details: Option, + #[doc = "The list of all benefit recommendations with the recommendation details."] + #[serde(rename = "allRecommendationDetails", default, skip_serializing_if = "Option::is_none")] + pub all_recommendation_details: Option, + #[doc = "Kind of the recommendation scope."] + pub scope: RecommendationScope, +} +impl BenefitRecommendationProperties { + pub fn new(scope: RecommendationScope) -> Self { + Self { + first_consumption_date: None, + last_consumption_date: None, + look_back_period: None, + total_hours: None, + usage: None, + arm_sku_name: None, + term: None, + commitment_granularity: None, + currency_code: None, + cost_without_benefit: None, + recommendation_details: None, + all_recommendation_details: None, + scope, + } + } +} +#[doc = "Result of listing benefit recommendations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenefitRecommendationsListResult { + #[doc = "The list of benefit recommendations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (URL) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for BenefitRecommendationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl BenefitRecommendationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "On-demand charges between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RecommendationUsageDetails { + #[doc = "Grain which corresponds to value."] + #[serde(rename = "usageGrain", default, skip_serializing_if = "Option::is_none")] + pub usage_grain: Option, + #[doc = "On-demand charges for each hour between firstConsumptionDate and lastConsumptionDate that were used for computing benefit recommendations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub charges: Vec, +} +impl RecommendationUsageDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of the benefit recommendation when scope is 'Shared'."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SharedScopeBenefitRecommendationProperties { + #[serde(flatten)] + pub benefit_recommendation_properties: BenefitRecommendationProperties, +} +impl SharedScopeBenefitRecommendationProperties { + pub fn new(benefit_recommendation_properties: BenefitRecommendationProperties) -> Self { + Self { + benefit_recommendation_properties, + } + } +} +#[doc = "The properties of the benefit recommendations when scope is 'Single'."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SingleScopeBenefitRecommendationProperties { + #[serde(flatten)] + pub benefit_recommendation_properties: BenefitRecommendationProperties, + #[doc = "The subscription ID that this single scope recommendation is for. Applicable only if recommendation is for 'Single' scope."] + #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] + pub subscription_id: Option, + #[doc = "The resource group that this single scope recommendation is for. Applicable only if recommendation is for 'Single' scope and 'ResourceGroup' request scope."] + #[serde(rename = "resourceGroup", default, skip_serializing_if = "Option::is_none")] + pub resource_group: Option, +} +impl SingleScopeBenefitRecommendationProperties { + pub fn new(benefit_recommendation_properties: BenefitRecommendationProperties) -> Self { + Self { + benefit_recommendation_properties, + subscription_id: None, + resource_group: None, + } + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/databricks/Cargo.toml b/services/mgmt/databricks/Cargo.toml index 8247966d24..7b6006d0b8 100644 --- a/services/mgmt/databricks/Cargo.toml +++ b/services/mgmt/databricks/Cargo.toml @@ -32,10 +32,11 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2023-02-01", "enable_reqwest"] +default = ["package-2023-05-01", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-2023-05-01" = [] "package-2023-02-01" = [] "package-2022-04-01-preview" = [] "package-2018-04-01" = [] \ No newline at end of file diff --git a/services/mgmt/databricks/README.md b/services/mgmt/databricks/README.md index af1f221a39..f11a4b69b3 100644 --- a/services/mgmt/databricks/README.md +++ b/services/mgmt/databricks/README.md @@ -6,10 +6,11 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/databricks To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2023-02-01`. +The default tag is `package-2023-05-01`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-2023-05-01` has 24 operations from 3 API versions: `2022-04-01-preview`, `2023-02-01`, `2023-05-01`. Use crate feature `package-2023-05-01` to enable. The operations will be in the `package_2023_05_01` module. - `package-2023-02-01` has 24 operations from 3 API versions: `2022-04-01-preview`, `2022-10-01-preview`, `2023-02-01`. Use crate feature `package-2023-02-01` to enable. The operations will be in the `package_2023_02_01` module. - `package-2022-04-01-preview` has 24 operations from 1 API versions: `2022-04-01-preview`. Use crate feature `package-2022-04-01-preview` to enable. The operations will be in the `package_2022_04_01_preview` module. - `package-2018-04-01` has 11 operations from 1 API versions: `2018-04-01`. Use crate feature `package-2018-04-01` to enable. The operations will be in the `package_2018_04_01` module. \ No newline at end of file diff --git a/services/mgmt/databricks/src/lib.rs b/services/mgmt/databricks/src/lib.rs index 762008d94c..002036a052 100644 --- a/services/mgmt/databricks/src/lib.rs +++ b/services/mgmt/databricks/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-05-01")] +pub mod package_2023_05_01; +#[cfg(all(feature = "package-2023-05-01", not(feature = "no-default-tag")))] +pub use package_2023_05_01::*; #[cfg(feature = "package-2023-02-01")] pub mod package_2023_02_01; #[cfg(all(feature = "package-2023-02-01", not(feature = "no-default-tag")))] diff --git a/services/mgmt/storagecache/src/package_2021_09/mod.rs b/services/mgmt/databricks/src/package_2023_05_01/mod.rs similarity index 70% rename from services/mgmt/storagecache/src/package_2021_09/mod.rs rename to services/mgmt/databricks/src/package_2023_05_01/mod.rs index a5ebb6eb6d..64a3ca920a 100644 --- a/services/mgmt/storagecache/src/package_2021_09/mod.rs +++ b/services/mgmt/databricks/src/package_2023_05_01/mod.rs @@ -103,44 +103,492 @@ impl Client { pipeline, } } - pub fn asc_operations_client(&self) -> asc_operations::Client { - asc_operations::Client(self.clone()) - } - pub fn caches_client(&self) -> caches::Client { - caches::Client(self.clone()) + pub fn access_connectors_client(&self) -> access_connectors::Client { + access_connectors::Client(self.clone()) } pub fn operations_client(&self) -> operations::Client { operations::Client(self.clone()) } - pub fn skus_client(&self) -> skus::Client { - skus::Client(self.clone()) + pub fn outbound_network_dependencies_endpoints_client(&self) -> outbound_network_dependencies_endpoints::Client { + outbound_network_dependencies_endpoints::Client(self.clone()) + } + pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { + private_endpoint_connections::Client(self.clone()) } - pub fn storage_target_client(&self) -> storage_target::Client { - storage_target::Client(self.clone()) + pub fn private_link_resources_client(&self) -> private_link_resources::Client { + private_link_resources::Client(self.clone()) } - pub fn storage_targets_client(&self) -> storage_targets::Client { - storage_targets::Client(self.clone()) + pub fn v_net_peering_client(&self) -> v_net_peering::Client { + v_net_peering::Client(self.clone()) } - pub fn usage_models_client(&self) -> usage_models::Client { - usage_models::Client(self.clone()) + pub fn workspaces_client(&self) -> workspaces::Client { + workspaces::Client(self.clone()) } } -pub mod operations { +pub mod workspaces { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all of the available Resource Provider operations."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } + #[doc = "Gets the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates a new workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `parameters`: Parameters supplied to the create or update a workspace."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + parameters: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + parameters: parameters.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Updates a workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `parameters`: The update to the workspace."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + parameters: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + parameters: parameters.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets all the workspaces within a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_resource_group( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets all the workspaces within a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } } } - pub mod list { + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) parameters: models::Workspace, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) parameters: models::WorkspaceUpdate, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiOperationListResult = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -177,14 +625,127 @@ pub mod operations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = - azure_core::Url::parse(&format!("{}/providers/Microsoft.StorageCache/operations", this.client.endpoint(),))?; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Databricks/workspaces", + this.client.endpoint(), + &this.subscription_id + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -201,7 +762,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -217,7 +778,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -238,28 +799,22 @@ pub mod operations { } } } -pub mod skus { +pub mod operations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of StorageCache.Cache SKUs available to this subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } + #[doc = "Lists all of the available RP operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } } } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ResourceSkusResult = serde_json::from_slice(&bytes)?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -296,18 +851,14 @@ pub mod skus { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.StorageCache/skus", - this.client.endpoint(), - &this.subscription_id - ))?; + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.Databricks/operations", this.client.endpoint(),))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -324,7 +875,7 @@ pub mod skus { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -340,7 +891,7 @@ pub mod skus { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -361,18 +912,51 @@ pub mod skus { } } } -pub mod usage_models { +pub mod private_link_resources { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get the list of Cache Usage Models available to this subscription."] + #[doc = "List private link resources"] + #[doc = "List private link resources for a given workspace"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get the specified private link resource"] + #[doc = "Get the specified private link resource for the given group id (sub-resource)"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `group_id`: The name of the private link resource"] + pub fn get( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + group_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), subscription_id: subscription_id.into(), + group_id: group_id.into(), } } } @@ -380,9 +964,9 @@ pub mod usage_models { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UsageModelsResult = serde_json::from_slice(&bytes)?; + let body: models::PrivateLinkResourcesList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -419,17 +1003,21 @@ pub mod usage_models { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.StorageCache/usageModels", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/privateLinkResources", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name ))?; let rsp = match continuation { Some(value) => { @@ -447,7 +1035,7 @@ pub mod usage_models { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -463,7 +1051,7 @@ pub mod usage_models { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -483,38 +1071,13 @@ pub mod usage_models { } } } -} -pub mod asc_operations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the status of an asynchronous operation for the Azure HPC Cache"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `location`: The name of the region used to look up the operation."] - #[doc = "* `operation_id`: The operation id which uniquely identifies the asynchronous operation."] - pub fn get( - &self, - subscription_id: impl Into, - location: impl Into, - operation_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - location: location.into(), - operation_id: operation_id.into(), - } - } - } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AscOperation = serde_json::from_slice(&bytes)?; + let body: models::GroupIdInformation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -551,9 +1114,10 @@ pub mod asc_operations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) location: String, - pub(crate) operation_id: String, + pub(crate) group_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -565,11 +1129,12 @@ pub mod asc_operations { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.StorageCache/locations/{}/ascOperations/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/privateLinkResources/{}", this.client.endpoint(), &this.subscription_id, - &this.location, - &this.operation_id + &this.resource_group_name, + &this.workspace_name, + &this.group_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -580,7 +1145,7 @@ pub mod asc_operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -589,8 +1154,8 @@ pub mod asc_operations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -602,324 +1167,110 @@ pub mod asc_operations { } } } -pub mod caches { +pub mod private_endpoint_connections { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Returns all Caches the user has access to under a subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Returns all Caches the user has access to under a resource group."] + #[doc = "List private endpoint connections"] + #[doc = "List private endpoint connections of the workspace"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_resource_group( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( &self, resource_group_name: impl Into, + workspace_name: impl Into, subscription_id: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), subscription_id: subscription_id.into(), } } - #[doc = "Returns a Cache."] + #[doc = "Get private endpoint connection"] + #[doc = "Get a private endpoint connection properties for a workspace"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection"] pub fn get( &self, resource_group_name: impl Into, - cache_name: impl Into, + workspace_name: impl Into, subscription_id: impl Into, + private_endpoint_connection_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Create or update a Cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - cache: None, - } - } - #[doc = "Update a Cache instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn update( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - cache: None, - } - } - #[doc = "Schedules a Cache for deletion."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - cache_name: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Tells a Cache to write generate debug info for support to process."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn debug_info( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> debug_info::RequestBuilder { - debug_info::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - } - } - #[doc = "Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn flush( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> flush::RequestBuilder { - flush::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - } - } - #[doc = "Tells a Stopped state Cache to transition to Active state."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn start( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> start::RequestBuilder { - start::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - } - } - #[doc = "Tells an Active Cache to transition to Stopped state."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn stop( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> stop::RequestBuilder { - stop::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - } - } - #[doc = "Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn upgrade_firmware( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> upgrade_firmware::RequestBuilder { - upgrade_firmware::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::CachesListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + private_endpoint_connection_name: private_endpoint_connection_name.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.StorageCache/caches", - this.client.endpoint(), - &this.subscription_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) + #[doc = "Update private endpoint connection status"] + #[doc = "Update the status of a private endpoint connection with the specified name"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection"] + #[doc = "* `private_endpoint_connection`: The private endpoint connection with updated properties"] + pub fn create( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + private_endpoint_connection_name: impl Into, + private_endpoint_connection: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + private_endpoint_connection: private_endpoint_connection.into(), + } + } + #[doc = "Remove private endpoint connection"] + #[doc = "Remove private endpoint connection with the specified name"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection"] + pub fn delete( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + private_endpoint_connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), } } } - pub mod list_by_resource_group { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CachesListResult = serde_json::from_slice(&bytes)?; + let body: models::PrivateEndpointConnectionsList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -957,18 +1308,20 @@ pub mod caches { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/privateEndpointConnections", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name + &this.resource_group_name, + &this.workspace_name ))?; let rsp = match continuation { Some(value) => { @@ -986,7 +1339,7 @@ pub mod caches { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1002,7 +1355,7 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1026,9 +1379,9 @@ pub mod caches { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Cache = serde_json::from_slice(&bytes)?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1066,8 +1419,9 @@ pub mod caches { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, - pub(crate) cache_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, + pub(crate) private_endpoint_connection_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1078,13 +1432,7 @@ pub mod caches { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . private_endpoint_connection_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1094,7 +1442,7 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1103,8 +1451,8 @@ pub mod caches { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1115,13 +1463,13 @@ pub mod caches { } } } - pub mod create_or_update { + pub mod create { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Cache = serde_json::from_slice(&bytes)?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1159,16 +1507,12 @@ pub mod caches { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) cache: Option, + pub(crate) private_endpoint_connection_name: String, + pub(crate) private_endpoint_connection: models::PrivateEndpointConnection, } impl RequestBuilder { - #[doc = "Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties."] - pub fn cache(mut self, cache: impl Into) -> Self { - self.cache = Some(cache.into()); - self - } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1178,13 +1522,7 @@ pub mod caches { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . private_endpoint_connection_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1194,117 +1532,9 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = if let Some(cache) = &this.cache { - req.insert_header("content-type", "application/json"); - azure_core::to_json(cache)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Cache = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) cache: Option, - } - impl RequestBuilder { - #[doc = "Object containing the user-selectable properties of the Cache. If read-only properties are included, they must match the existing values of those properties."] - pub fn cache(mut self, cache: impl Into) -> Self { - self.cache = Some(cache.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = if let Some(cache) = &this.cache { - req.insert_header("content-type", "application/json"); - azure_core::to_json(cache)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.private_endpoint_connection)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1312,8 +1542,8 @@ pub mod caches { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1345,8 +1575,9 @@ pub mod caches { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, - pub(crate) cache_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, + pub(crate) private_endpoint_connection_name: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1358,13 +1589,7 @@ pub mod caches { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . private_endpoint_connection_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1374,7 +1599,7 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1383,129 +1608,58 @@ pub mod caches { } } } - pub mod debug_info { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) cache_name: String, - } - impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/debugInfo", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) +} +pub mod outbound_network_dependencies_endpoints { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified Workspace."] + #[doc = "Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane. You must configure outbound access with these endpoints. For more information, see https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), } } } - pub mod flush { + pub mod list { use super::models; pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) cache_name: String, + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OutboundEnvironmentEndpointCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/flush", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - } - pub mod start { - use super::models; - pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1524,11 +1678,10 @@ pub mod caches { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1537,14 +1690,8 @@ pub mod caches { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/start", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/outboundNetworkDependenciesEndpoints" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1553,19 +1700,147 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod v_net_peering { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the workspace vNet Peering."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `peering_name`: The name of the workspace vNet peering."] + pub fn get( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + peering_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + peering_name: peering_name.into(), + } + } + #[doc = "Creates vNet Peering for workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `virtual_network_peering_parameters`: Parameters supplied to the create workspace vNet Peering."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `peering_name`: The name of the workspace vNet peering."] + pub fn create_or_update( + &self, + virtual_network_peering_parameters: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + peering_name: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + virtual_network_peering_parameters: virtual_network_peering_parameters.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + peering_name: peering_name.into(), + } + } + #[doc = "Deletes the workspace vNetPeering."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `peering_name`: The name of the workspace vNet peering."] + pub fn delete( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + peering_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + peering_name: peering_name.into(), + } + } + #[doc = "Lists the workspace vNet Peerings."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_workspace( + &self, + resource_group_name: impl Into, + workspace_name: impl Into, + subscription_id: impl Into, + ) -> list_by_workspace::RequestBuilder { + list_by_workspace::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + subscription_id: subscription_id.into(), + } + } } - pub mod stop { + pub mod get { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualNetworkPeering = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1584,11 +1859,11 @@ pub mod caches { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, + pub(crate) peering_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1598,13 +1873,14 @@ pub mod caches { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/stop", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/virtualNetworkPeerings/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name + &this.workspace_name, + &this.peering_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1613,19 +1889,53 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod upgrade_firmware { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualNetworkPeering = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1643,9 +1953,11 @@ pub mod caches { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) virtual_network_peering_parameters: models::VirtualNetworkPeering, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, + pub(crate) peering_name: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1658,13 +1970,14 @@ pub mod caches { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/upgrade", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/virtualNetworkPeerings/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name + &this.workspace_name, + &this.peering_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1673,132 +1986,29 @@ pub mod caches { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.virtual_network_peering_parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - } -} -pub mod storage_targets { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Tells a storage target to refresh its DNS information."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn dns_refresh( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> dns_refresh::RequestBuilder { - dns_refresh::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - } - } - #[doc = "Returns a list of Storage Targets for the specified Cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - pub fn list_by_cache( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - ) -> list_by_cache::RequestBuilder { - list_by_cache::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - } - } - #[doc = "Returns a Storage Target from a Cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn get( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - } - } - #[doc = "Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn create_or_update( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - storagetarget: None, - } - } - #[doc = "Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn delete( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - force: None, + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod dns_refresh { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -1819,9 +2029,9 @@ pub mod storage_targets { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, + pub(crate) peering_name: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1834,14 +2044,14 @@ pub mod storage_targets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}/dnsRefresh", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/virtualNetworkPeerings/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.workspace_name, + &this.peering_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1850,9 +2060,8 @@ pub mod storage_targets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1860,13 +2069,13 @@ pub mod storage_targets { } } } - pub mod list_by_cache { + pub mod list_by_workspace { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::StorageTargetsResult = serde_json::from_slice(&bytes)?; + let body: models::VirtualNetworkPeeringList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1904,20 +2113,20 @@ pub mod storage_targets { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/workspaces/{}/virtualNetworkPeerings", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name + &this.workspace_name ))?; let rsp = match continuation { Some(value) => { @@ -1935,7 +2144,7 @@ pub mod storage_targets { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1951,7 +2160,7 @@ pub mod storage_targets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1971,13 +2180,127 @@ pub mod storage_targets { } } } +} +pub mod access_connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets an azure databricks accessConnector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `connector_name`: The name of the azure databricks accessConnector."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + connector_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + connector_name: connector_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates azure databricks accessConnector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `parameters`: Parameters supplied to the create or update an azure databricks accessConnector."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `connector_name`: The name of the azure databricks accessConnector."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + parameters: impl Into, + resource_group_name: impl Into, + connector_name: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + parameters: parameters.into(), + resource_group_name: resource_group_name.into(), + connector_name: connector_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Updates an azure databricks accessConnector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `parameters`: The update to the azure databricks accessConnector."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `connector_name`: The name of the azure databricks accessConnector."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + parameters: impl Into, + resource_group_name: impl Into, + connector_name: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + parameters: parameters.into(), + resource_group_name: resource_group_name.into(), + connector_name: connector_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the azure databricks accessConnector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `connector_name`: The name of the azure databricks accessConnector."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + connector_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + connector_name: connector_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets all the azure databricks accessConnectors within a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_resource_group( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets all the azure databricks accessConnectors within a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::StorageTarget = serde_json::from_slice(&bytes)?; + let body: models::AccessConnector = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2015,9 +2338,8 @@ pub mod storage_targets { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) connector_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2029,12 +2351,11 @@ pub mod storage_targets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/accessConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.connector_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -2045,7 +2366,7 @@ pub mod storage_targets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2054,8 +2375,8 @@ pub mod storage_targets { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2070,9 +2391,9 @@ pub mod storage_targets { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::StorageTarget = serde_json::from_slice(&bytes)?; + let body: models::AccessConnector = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2109,18 +2430,12 @@ pub mod storage_targets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) parameters: models::AccessConnector, pub(crate) resource_group_name: String, + pub(crate) connector_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, - pub(crate) storagetarget: Option, } impl RequestBuilder { - #[doc = "Object containing the definition of a Storage Target."] - pub fn storagetarget(mut self, storagetarget: impl Into) -> Self { - self.storagetarget = Some(storagetarget.into()); - self - } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2131,12 +2446,11 @@ pub mod storage_targets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/accessConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.connector_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -2147,13 +2461,9 @@ pub mod storage_targets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = if let Some(storagetarget) = &this.storagetarget { - req.insert_header("content-type", "application/json"); - azure_core::to_json(storagetarget)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2161,8 +2471,8 @@ pub mod storage_targets { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2173,7 +2483,7 @@ pub mod storage_targets { } } } - pub mod delete { + pub mod update { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -2193,18 +2503,12 @@ pub mod storage_targets { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) parameters: models::AccessConnectorUpdate, pub(crate) resource_group_name: String, + pub(crate) connector_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, - pub(crate) force: Option, } impl RequestBuilder { - #[doc = "Boolean value requesting the force delete operation for a storage target. Force delete discards unwritten-data in the cache instead of flushing it to back-end storage."] - pub fn force(mut self, force: impl Into) -> Self { - self.force = Some(force.into()); - self - } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2215,14 +2519,13 @@ pub mod storage_targets { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/accessConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.connector_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2231,11 +2534,9 @@ pub mod storage_targets { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - if let Some(force) = &this.force { - req.url_mut().query_pairs_mut().append_pair("force", force); - } - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2243,79 +2544,7 @@ pub mod storage_targets { } } } -} -pub mod storage_target { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn flush( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> flush::RequestBuilder { - flush::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - } - } - #[doc = "Suspends client access to a storage target."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn suspend( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> suspend::RequestBuilder { - suspend::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - } - } - #[doc = "Resumes client access to a previously suspended storage target."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: Target resource group."] - #[doc = "* `subscription_id`: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `cache_name`: Name of Cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class."] - #[doc = "* `storage_target_name`: Name of Storage Target."] - pub fn resume( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - cache_name: impl Into, - storage_target_name: impl Into, - ) -> resume::RequestBuilder { - resume::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - cache_name: cache_name.into(), - storage_target_name: storage_target_name.into(), - } - } - } - pub mod flush { + pub mod delete { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -2336,9 +2565,8 @@ pub mod storage_target { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, + pub(crate) connector_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -2351,14 +2579,13 @@ pub mod storage_target { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}/flush", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/accessConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.connector_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2367,9 +2594,8 @@ pub mod storage_target { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2377,9 +2603,32 @@ pub mod storage_target { } } } - pub mod suspend { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessConnectorListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -2399,49 +2648,96 @@ pub mod storage_target { pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}/suspend", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Databricks/accessConnectors", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.resource_group_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod resume { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AccessConnectorListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -2459,45 +2755,67 @@ pub mod storage_target { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) cache_name: String, - pub(crate) storage_target_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.StorageCache/caches/{}/storageTargets/{}/resume", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Databricks/accessConnectors", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name, - &this.storage_target_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-09-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } diff --git a/services/mgmt/databricks/src/package_2023_05_01/models.rs b/services/mgmt/databricks/src/package_2023_05_01/models.rs new file mode 100644 index 0000000000..7d0ad7e09d --- /dev/null +++ b/services/mgmt/databricks/src/package_2023_05_01/models.rs @@ -0,0 +1,1817 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Information about azure databricks accessConnector."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccessConnector { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AccessConnector { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + identity: None, + system_data: None, + properties: None, + } + } +} +#[doc = "List of azure databricks accessConnector."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AccessConnectorListResult { + #[doc = "The array of azure databricks accessConnector."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to use for getting the next set of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AccessConnectorListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AccessConnectorListResult { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AccessConnectorProperties { + #[doc = "Provisioning status of the accessConnector."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl AccessConnectorProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod access_connector_properties { + use super::*; + #[doc = "Provisioning status of the accessConnector."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Deleted, + Failed, + Succeeded, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Deleted"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Succeeded"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "An update to an azure databricks accessConnector."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AccessConnectorUpdate { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl AccessConnectorUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AddressSpace { + #[doc = "A list of address blocks reserved for this virtual network in CIDR notation."] + #[serde( + rename = "addressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub address_prefixes: Vec, +} +impl AddressSpace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Provides details of the entity that created/updated the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CreatedBy { + #[doc = "The Object ID that created the workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub oid: Option, + #[doc = "The Personal Object ID corresponding to the object ID above"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub puid: Option, + #[doc = "The application ID of the application that initiated the creation of the workspace. For example, Azure Portal."] + #[serde(rename = "applicationId", default, skip_serializing_if = "Option::is_none")] + pub application_id: Option, +} +impl CreatedBy { + pub fn new() -> Self { + Self::default() + } +} +pub type CreatedDateTime = time::OffsetDateTime; +#[doc = "The object that contains details of encryption used on the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Encryption { + #[doc = "The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault"] + #[serde(rename = "keySource", default, skip_serializing_if = "Option::is_none")] + pub key_source: Option, + #[doc = "The name of KeyVault key."] + #[serde(rename = "KeyName", default, skip_serializing_if = "Option::is_none")] + pub key_name: Option, + #[doc = "The version of KeyVault key."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub keyversion: Option, + #[doc = "The Uri of KeyVault."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub keyvaulturi: Option, +} +impl Encryption { + pub fn new() -> Self { + Self::default() + } +} +pub mod encryption { + use super::*; + #[doc = "The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "KeySource")] + pub enum KeySource { + Default, + #[serde(rename = "Microsoft.Keyvault")] + MicrosoftKeyvault, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for KeySource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for KeySource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for KeySource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("KeySource", 0u32, "Default"), + Self::MicrosoftKeyvault => serializer.serialize_unit_variant("KeySource", 1u32, "Microsoft.Keyvault"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for KeySource { + fn default() -> Self { + Self::Default + } + } +} +#[doc = "Encryption entities for databricks workspace resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EncryptionEntitiesDefinition { + #[doc = "The object that contains details of encryption used on the workspace."] + #[serde(rename = "managedServices", default, skip_serializing_if = "Option::is_none")] + pub managed_services: Option, + #[doc = "The object that contains details of encryption used on the workspace."] + #[serde(rename = "managedDisk", default, skip_serializing_if = "Option::is_none")] + pub managed_disk: Option, +} +impl EncryptionEntitiesDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The object that contains details of encryption used on the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EncryptionV2 { + #[doc = "The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault"] + #[serde(rename = "keySource")] + pub key_source: encryption_v2::KeySource, + #[doc = "Key Vault input properties for encryption."] + #[serde(rename = "keyVaultProperties", default, skip_serializing_if = "Option::is_none")] + pub key_vault_properties: Option, +} +impl EncryptionV2 { + pub fn new(key_source: encryption_v2::KeySource) -> Self { + Self { + key_source, + key_vault_properties: None, + } + } +} +pub mod encryption_v2 { + use super::*; + #[doc = "The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "KeySource")] + pub enum KeySource { + #[serde(rename = "Microsoft.Keyvault")] + MicrosoftKeyvault, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for KeySource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for KeySource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for KeySource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::MicrosoftKeyvault => serializer.serialize_unit_variant("KeySource", 0u32, "Microsoft.Keyvault"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Key Vault input properties for encryption."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub struct KeyVaultProperties { + #[doc = "The Uri of KeyVault."] + #[serde(rename = "keyVaultUri")] + pub key_vault_uri: String, + #[doc = "The name of KeyVault key."] + #[serde(rename = "keyName")] + pub key_name: String, + #[doc = "The version of KeyVault key."] + #[serde(rename = "keyVersion")] + pub key_version: String, + } + impl KeyVaultProperties { + pub fn new(key_vault_uri: String, key_name: String, key_version: String) -> Self { + Self { + key_vault_uri, + key_name, + key_version, + } + } + } +} +#[doc = "A domain name or IP address the Workspace is reaching at."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EndpointDependency { + #[doc = "The domain name of the dependency."] + #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] + pub domain_name: Option, + #[doc = "The Ports used when connecting to domainName."] + #[serde( + rename = "endpointDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoint_details: Vec, +} +impl EndpointDependency { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Connect information from the Workspace to a single endpoint."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EndpointDetail { + #[doc = "An IP Address that Domain Name currently resolves to."] + #[serde(rename = "ipAddress", default, skip_serializing_if = "Option::is_none")] + pub ip_address: Option, + #[doc = "The port an endpoint is connected to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "The time in milliseconds it takes for the connection to be created from the Workspace to this IpAddress at this Port."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latency: Option, + #[doc = "Whether it is possible to create a connection from the Workspace to this IpAddress at this Port."] + #[serde(rename = "isAccessible", default, skip_serializing_if = "Option::is_none")] + pub is_accessible: Option, +} +impl EndpointDetail { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorDetail { + #[doc = "The error's code."] + pub code: String, + #[doc = "A human readable error message."] + pub message: String, + #[doc = "Indicates which property in the request is responsible for the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, +} +impl ErrorDetail { + pub fn new(code: String, message: String) -> Self { + Self { + code, + message, + target: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorInfo { + #[doc = "A machine readable error code."] + pub code: String, + #[doc = "A human readable error message."] + pub message: String, + #[doc = "error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "Inner error details if they exist."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub innererror: Option, +} +impl ErrorInfo { + pub fn new(code: String, message: String) -> Self { + Self { + code, + message, + details: Vec::new(), + innererror: None, + } + } +} +#[doc = "Contains details when the response code indicates an error."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorResponse { + pub error: ErrorInfo, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new(error: ErrorInfo) -> Self { + Self { error } + } +} +#[doc = "The group information for creating a private endpoint on a workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupIdInformation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The resource identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The properties for a group information object"] + pub properties: GroupIdInformationProperties, +} +impl GroupIdInformation { + pub fn new(properties: GroupIdInformationProperties) -> Self { + Self { + resource: Resource::default(), + id: None, + name: None, + type_: None, + properties, + } + } +} +#[doc = "The properties for a group information object"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GroupIdInformationProperties { + #[doc = "The group id"] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "The required members for a specific group id"] + #[serde( + rename = "requiredMembers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_members: Vec, + #[doc = "The required DNS zones for a specific group id"] + #[serde( + rename = "requiredZoneNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_zone_names: Vec, +} +impl GroupIdInformationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The object that contains details of encryption used on the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ManagedDiskEncryption { + #[doc = "The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault"] + #[serde(rename = "keySource")] + pub key_source: managed_disk_encryption::KeySource, + #[doc = "Key Vault input properties for encryption."] + #[serde(rename = "keyVaultProperties")] + pub key_vault_properties: managed_disk_encryption::KeyVaultProperties, + #[doc = "Indicate whether the latest key version should be automatically used for Managed Disk Encryption."] + #[serde(rename = "rotationToLatestKeyVersionEnabled", default, skip_serializing_if = "Option::is_none")] + pub rotation_to_latest_key_version_enabled: Option, +} +impl ManagedDiskEncryption { + pub fn new(key_source: managed_disk_encryption::KeySource, key_vault_properties: managed_disk_encryption::KeyVaultProperties) -> Self { + Self { + key_source, + key_vault_properties, + rotation_to_latest_key_version_enabled: None, + } + } +} +pub mod managed_disk_encryption { + use super::*; + #[doc = "The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "KeySource")] + pub enum KeySource { + #[serde(rename = "Microsoft.Keyvault")] + MicrosoftKeyvault, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for KeySource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for KeySource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for KeySource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::MicrosoftKeyvault => serializer.serialize_unit_variant("KeySource", 0u32, "Microsoft.Keyvault"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Key Vault input properties for encryption."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub struct KeyVaultProperties { + #[doc = "The URI of KeyVault."] + #[serde(rename = "keyVaultUri")] + pub key_vault_uri: String, + #[doc = "The name of KeyVault key."] + #[serde(rename = "keyName")] + pub key_name: String, + #[doc = "The version of KeyVault key."] + #[serde(rename = "keyVersion")] + pub key_version: String, + } + impl KeyVaultProperties { + pub fn new(key_vault_uri: String, key_name: String, key_version: String) -> Self { + Self { + key_vault_uri, + key_name, + key_version, + } + } + } +} +#[doc = "The Managed Identity details for storage account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ManagedIdentityConfiguration { + #[doc = "The objectId of the Managed Identity that is linked to the Managed Storage account."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant Id where the Managed Identity is created."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The type of Identity created. It can be either SystemAssigned or UserAssigned."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl ManagedIdentityConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ManagedServiceIdentity { + #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] + #[serde(rename = "type")] + pub type_: ManagedServiceIdentityType, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl ManagedServiceIdentity { + pub fn new(type_: ManagedServiceIdentityType) -> Self { + Self { + principal_id: None, + tenant_id: None, + type_, + user_assigned_identities: None, + } + } +} +#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ManagedServiceIdentityType")] +pub enum ManagedServiceIdentityType { + None, + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned,UserAssigned")] + SystemAssignedUserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ManagedServiceIdentityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ManagedServiceIdentityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ManagedServiceIdentityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => { + serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned,UserAssigned") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "REST API operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Operation name: {provider}/{resource}/{operation}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The object that represents the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "The object that represents the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "Service provider: ex Microsoft.Databricks"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "Resource on which the operation is performed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "Operation type: Read, write, delete, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "Description for the resource operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of Resource Provider operations supported by the Resource Provider resource provider."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Egress endpoints which Workspace connects to for common purposes."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OutboundEnvironmentEndpoint { + #[doc = "The category of endpoints accessed by the Workspace, e.g. azure-storage, azure-mysql, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The endpoints that Workspace connect to"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoints: Vec, +} +impl OutboundEnvironmentEndpoint { + pub fn new() -> Self { + Self::default() + } +} +pub type OutboundEnvironmentEndpointCollection = Vec; +#[doc = "The current provisioning state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PeeringProvisioningState")] +pub enum PeeringProvisioningState { + Succeeded, + Updating, + Deleting, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PeeringProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PeeringProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PeeringProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("PeeringProvisioningState", 0u32, "Succeeded"), + Self::Updating => serializer.serialize_unit_variant("PeeringProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("PeeringProvisioningState", 2u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("PeeringProvisioningState", 3u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The private endpoint property of a private endpoint connection"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpoint { + #[doc = "The resource identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl PrivateEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The private endpoint connection of a workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnection { + #[doc = "The resource identifier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The properties of a private endpoint connection"] + pub properties: PrivateEndpointConnectionProperties, +} +impl PrivateEndpointConnection { + pub fn new(properties: PrivateEndpointConnectionProperties) -> Self { + Self { + id: None, + name: None, + type_: None, + properties, + } + } +} +#[doc = "The properties of a private endpoint connection"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnectionProperties { + #[doc = "The private endpoint property of a private endpoint connection"] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "GroupIds from the private link service resource."] + #[serde( + rename = "groupIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub group_ids: Vec, + #[doc = "The current state of a private endpoint connection"] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PrivateEndpointConnectionProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { + Self { + private_endpoint: None, + group_ids: Vec::new(), + private_link_service_connection_state, + provisioning_state: None, + } + } +} +#[doc = "The current provisioning state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PrivateEndpointConnectionProvisioningState")] +pub enum PrivateEndpointConnectionProvisioningState { + Succeeded, + Creating, + Updating, + Deleting, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PrivateEndpointConnectionProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PrivateEndpointConnectionProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"), + Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 4u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "List of private link connections."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionsList { + #[doc = "The list of returned private endpoint connection."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of endpoint connections."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PrivateEndpointConnectionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PrivateEndpointConnectionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The available private link resources for a workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourcesList { + #[doc = "The list of available private link resources for a workspace"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of private link resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PrivateLinkResourcesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PrivateLinkResourcesList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The current state of a private endpoint connection"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateLinkServiceConnectionState { + #[doc = "The status of a private endpoint connection"] + pub status: private_link_service_connection_state::Status, + #[doc = "The description for the current state of a private endpoint connection"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Actions required for a private endpoint connection"] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl PrivateLinkServiceConnectionState { + pub fn new(status: private_link_service_connection_state::Status) -> Self { + Self { + status, + description: None, + actions_required: None, + } + } +} +pub mod private_link_service_connection_state { + use super::*; + #[doc = "The status of a private endpoint connection"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Pending, + Approved, + Rejected, + Disconnected, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Pending => serializer.serialize_unit_variant("Status", 0u32, "Pending"), + Self::Approved => serializer.serialize_unit_variant("Status", 1u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("Status", 2u32, "Rejected"), + Self::Disconnected => serializer.serialize_unit_variant("Status", 3u32, "Disconnected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Provisioning status of the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ProvisioningState")] +pub enum ProvisioningState { + Accepted, + Running, + Ready, + Creating, + Created, + Deleting, + Deleted, + Canceled, + Failed, + Succeeded, + Updating, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"), + Self::Running => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Running"), + Self::Ready => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Ready"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Creating"), + Self::Created => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Created"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Deleting"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 7u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 8u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 9u32, "Succeeded"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 10u32, "Updating"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The core properties of ARM resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "SKU for the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Sku { + #[doc = "The SKU name."] + pub name: String, + #[doc = "The SKU tier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl Sku { + pub fn new(name: String) -> Self { + Self { name, tier: None } + } +} +#[doc = "The resource model definition for a ARM tracked top level resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User assigned identity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client ID of the assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Peerings in a VirtualNetwork resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualNetworkPeering { + #[doc = "Properties of the virtual network peering."] + pub properties: VirtualNetworkPeeringPropertiesFormat, + #[doc = "Name of the virtual network peering resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "type of the virtual network peering resource"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl VirtualNetworkPeering { + pub fn new(properties: VirtualNetworkPeeringPropertiesFormat) -> Self { + Self { + properties, + name: None, + id: None, + type_: None, + } + } +} +#[doc = "Gets all virtual network peerings under a workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualNetworkPeeringList { + #[doc = "List of virtual network peerings on workspace."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of virtual network peering list results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for VirtualNetworkPeeringList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl VirtualNetworkPeeringList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the virtual network peering."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualNetworkPeeringPropertiesFormat { + #[doc = "Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space."] + #[serde(rename = "allowVirtualNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub allow_virtual_network_access: Option, + #[doc = "Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network."] + #[serde(rename = "allowForwardedTraffic", default, skip_serializing_if = "Option::is_none")] + pub allow_forwarded_traffic: Option, + #[doc = "If gateway links can be used in remote virtual networking to link to this virtual network."] + #[serde(rename = "allowGatewayTransit", default, skip_serializing_if = "Option::is_none")] + pub allow_gateway_transit: Option, + #[doc = "If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway."] + #[serde(rename = "useRemoteGateways", default, skip_serializing_if = "Option::is_none")] + pub use_remote_gateways: Option, + #[doc = " The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering)."] + #[serde(rename = "databricksVirtualNetwork", default, skip_serializing_if = "Option::is_none")] + pub databricks_virtual_network: Option, + #[doc = "AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network."] + #[serde(rename = "databricksAddressSpace", default, skip_serializing_if = "Option::is_none")] + pub databricks_address_space: Option, + #[doc = " The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering)."] + #[serde(rename = "remoteVirtualNetwork")] + pub remote_virtual_network: virtual_network_peering_properties_format::RemoteVirtualNetwork, + #[doc = "AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network."] + #[serde(rename = "remoteAddressSpace", default, skip_serializing_if = "Option::is_none")] + pub remote_address_space: Option, + #[doc = "The status of the virtual network peering."] + #[serde(rename = "peeringState", default, skip_serializing_if = "Option::is_none")] + pub peering_state: Option, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl VirtualNetworkPeeringPropertiesFormat { + pub fn new(remote_virtual_network: virtual_network_peering_properties_format::RemoteVirtualNetwork) -> Self { + Self { + allow_virtual_network_access: None, + allow_forwarded_traffic: None, + allow_gateway_transit: None, + use_remote_gateways: None, + databricks_virtual_network: None, + databricks_address_space: None, + remote_virtual_network, + remote_address_space: None, + peering_state: None, + provisioning_state: None, + } + } +} +pub mod virtual_network_peering_properties_format { + use super::*; + #[doc = " The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DatabricksVirtualNetwork { + #[doc = "The Id of the databricks virtual network."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + } + impl DatabricksVirtualNetwork { + pub fn new() -> Self { + Self::default() + } + } + #[doc = " The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct RemoteVirtualNetwork { + #[doc = "The Id of the remote virtual network."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + } + impl RemoteVirtualNetwork { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The status of the virtual network peering."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PeeringState")] + pub enum PeeringState { + Initiated, + Connected, + Disconnected, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PeeringState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PeeringState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PeeringState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Initiated => serializer.serialize_unit_variant("PeeringState", 0u32, "Initiated"), + Self::Connected => serializer.serialize_unit_variant("PeeringState", 1u32, "Connected"), + Self::Disconnected => serializer.serialize_unit_variant("PeeringState", 2u32, "Disconnected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Workspace { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "The workspace properties."] + pub properties: WorkspaceProperties, + #[doc = "SKU for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Workspace { + pub fn new(tracked_resource: TrackedResource, properties: WorkspaceProperties) -> Self { + Self { + tracked_resource, + properties, + sku: None, + system_data: None, + } + } +} +#[doc = "The value which should be used for this field."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceCustomBooleanParameter { + #[doc = "Provisioning status of the workspace."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The value which should be used for this field."] + pub value: bool, +} +impl WorkspaceCustomBooleanParameter { + pub fn new(value: bool) -> Self { + Self { type_: None, value } + } +} +#[doc = "The value which should be used for this field."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceCustomObjectParameter { + #[doc = "Provisioning status of the workspace."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The value which should be used for this field."] + pub value: serde_json::Value, +} +impl WorkspaceCustomObjectParameter { + pub fn new(value: serde_json::Value) -> Self { + Self { type_: None, value } + } +} +#[doc = "Provisioning status of the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "WorkspaceCustomParameterType")] +pub enum WorkspaceCustomParameterType { + Bool, + Object, + String, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for WorkspaceCustomParameterType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for WorkspaceCustomParameterType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for WorkspaceCustomParameterType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Bool => serializer.serialize_unit_variant("WorkspaceCustomParameterType", 0u32, "Bool"), + Self::Object => serializer.serialize_unit_variant("WorkspaceCustomParameterType", 1u32, "Object"), + Self::String => serializer.serialize_unit_variant("WorkspaceCustomParameterType", 2u32, "String"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Custom Parameters used for Cluster Creation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceCustomParameters { + #[doc = "The Value."] + #[serde(rename = "amlWorkspaceId", default, skip_serializing_if = "Option::is_none")] + pub aml_workspace_id: Option, + #[doc = "The Value."] + #[serde(rename = "customVirtualNetworkId", default, skip_serializing_if = "Option::is_none")] + pub custom_virtual_network_id: Option, + #[doc = "The Value."] + #[serde(rename = "customPublicSubnetName", default, skip_serializing_if = "Option::is_none")] + pub custom_public_subnet_name: Option, + #[doc = "The Value."] + #[serde(rename = "customPrivateSubnetName", default, skip_serializing_if = "Option::is_none")] + pub custom_private_subnet_name: Option, + #[doc = "The value which should be used for this field."] + #[serde(rename = "enableNoPublicIp", default, skip_serializing_if = "Option::is_none")] + pub enable_no_public_ip: Option, + #[doc = "The Value."] + #[serde(rename = "loadBalancerBackendPoolName", default, skip_serializing_if = "Option::is_none")] + pub load_balancer_backend_pool_name: Option, + #[doc = "The Value."] + #[serde(rename = "loadBalancerId", default, skip_serializing_if = "Option::is_none")] + pub load_balancer_id: Option, + #[doc = "The Value."] + #[serde(rename = "natGatewayName", default, skip_serializing_if = "Option::is_none")] + pub nat_gateway_name: Option, + #[doc = "The Value."] + #[serde(rename = "publicIpName", default, skip_serializing_if = "Option::is_none")] + pub public_ip_name: Option, + #[doc = "The value which should be used for this field."] + #[serde(rename = "prepareEncryption", default, skip_serializing_if = "Option::is_none")] + pub prepare_encryption: Option, + #[doc = "The object that contains details of encryption used on the workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption: Option, + #[doc = "The value which should be used for this field."] + #[serde(rename = "requireInfrastructureEncryption", default, skip_serializing_if = "Option::is_none")] + pub require_infrastructure_encryption: Option, + #[doc = "The Value."] + #[serde(rename = "storageAccountName", default, skip_serializing_if = "Option::is_none")] + pub storage_account_name: Option, + #[doc = "The Value."] + #[serde(rename = "storageAccountSkuName", default, skip_serializing_if = "Option::is_none")] + pub storage_account_sku_name: Option, + #[doc = "The Value."] + #[serde(rename = "vnetAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub vnet_address_prefix: Option, + #[doc = "The value which should be used for this field."] + #[serde(rename = "resourceTags", default, skip_serializing_if = "Option::is_none")] + pub resource_tags: Option, +} +impl WorkspaceCustomParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Value."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceCustomStringParameter { + #[doc = "Provisioning status of the workspace."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The value which should be used for this field."] + pub value: String, +} +impl WorkspaceCustomStringParameter { + pub fn new(value: String) -> Self { + Self { type_: None, value } + } +} +#[doc = "The object that contains details of encryption used on the workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceEncryptionParameter { + #[doc = "Provisioning status of the workspace."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The object that contains details of encryption used on the workspace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl WorkspaceEncryptionParameter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of workspaces."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceListResult { + #[doc = "The array of workspaces."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to use for getting the next set of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WorkspaceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The workspace properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceProperties { + #[doc = "The managed resource group Id."] + #[serde(rename = "managedResourceGroupId")] + pub managed_resource_group_id: String, + #[doc = "Custom Parameters used for Cluster Creation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option, + #[doc = "Provisioning status of the workspace."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The blob URI where the UI definition file is located."] + #[serde(rename = "uiDefinitionUri", default, skip_serializing_if = "Option::is_none")] + pub ui_definition_uri: Option, + #[doc = "The workspace provider authorizations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub authorizations: Vec, + #[doc = "Provides details of the entity that created/updated the workspace."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "Provides details of the entity that created/updated the workspace."] + #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + #[doc = "The date and time stamp when the workspace was created."] + #[serde(rename = "createdDateTime", default, skip_serializing_if = "Option::is_none")] + pub created_date_time: Option, + #[doc = "The unique identifier of the databricks workspace in databricks control plane."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net'"] + #[serde(rename = "workspaceUrl", default, skip_serializing_if = "Option::is_none")] + pub workspace_url: Option, + #[doc = "The Managed Identity details for storage account."] + #[serde(rename = "storageAccountIdentity", default, skip_serializing_if = "Option::is_none")] + pub storage_account_identity: Option, + #[doc = "The Managed Identity details for storage account."] + #[serde(rename = "managedDiskIdentity", default, skip_serializing_if = "Option::is_none")] + pub managed_disk_identity: Option, + #[doc = "The resource Id of the managed disk encryption set."] + #[serde(rename = "diskEncryptionSetId", default, skip_serializing_if = "Option::is_none")] + pub disk_encryption_set_id: Option, + #[doc = "Encryption properties for databricks workspace"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encryption: Option, + #[doc = "Private endpoint connections created on the workspace"] + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "The network access type for accessing workspace. Set value to disabled to access workspace only via private link."] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only."] + #[serde(rename = "requiredNsgRules", default, skip_serializing_if = "Option::is_none")] + pub required_nsg_rules: Option, +} +impl WorkspaceProperties { + pub fn new(managed_resource_group_id: String) -> Self { + Self { + managed_resource_group_id, + parameters: None, + provisioning_state: None, + ui_definition_uri: None, + authorizations: Vec::new(), + created_by: None, + updated_by: None, + created_date_time: None, + workspace_id: None, + workspace_url: None, + storage_account_identity: None, + managed_disk_identity: None, + disk_encryption_set_id: None, + encryption: None, + private_endpoint_connections: Vec::new(), + public_network_access: None, + required_nsg_rules: None, + } + } +} +pub mod workspace_properties { + use super::*; + #[doc = "Encryption properties for databricks workspace"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub struct Encryption { + #[doc = "Encryption entities for databricks workspace resource."] + pub entities: EncryptionEntitiesDefinition, + } + impl Encryption { + pub fn new(entities: EncryptionEntitiesDefinition) -> Self { + Self { entities } + } + } + #[doc = "The network access type for accessing workspace. Set value to disabled to access workspace only via private link."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "RequiredNsgRules")] + pub enum RequiredNsgRules { + AllRules, + NoAzureDatabricksRules, + NoAzureServiceRules, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for RequiredNsgRules { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for RequiredNsgRules { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for RequiredNsgRules { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AllRules => serializer.serialize_unit_variant("RequiredNsgRules", 0u32, "AllRules"), + Self::NoAzureDatabricksRules => serializer.serialize_unit_variant("RequiredNsgRules", 1u32, "NoAzureDatabricksRules"), + Self::NoAzureServiceRules => serializer.serialize_unit_variant("RequiredNsgRules", 2u32, "NoAzureServiceRules"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The workspace provider authorization."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceProviderAuthorization { + #[doc = "The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the workspace resources."] + #[serde(rename = "principalId")] + pub principal_id: String, + #[doc = "The provider's role definition identifier. This role will define all the permissions that the provider must have on the workspace's container resource group. This role definition cannot have permission to delete the resource group."] + #[serde(rename = "roleDefinitionId")] + pub role_definition_id: String, +} +impl WorkspaceProviderAuthorization { + pub fn new(principal_id: String, role_definition_id: String) -> Self { + Self { + principal_id, + role_definition_id, + } + } +} +#[doc = "An update to a workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceUpdate { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl WorkspaceUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/datafactory/src/package_2018_06/models.rs b/services/mgmt/datafactory/src/package_2018_06/models.rs index fb448638ae..68fe7554fd 100644 --- a/services/mgmt/datafactory/src/package_2018_06/models.rs +++ b/services/mgmt/datafactory/src/package_2018_06/models.rs @@ -32,6 +32,12 @@ pub struct Activity { #[doc = "Activity description."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, + #[doc = "Activity state. This is an optional property and if not provided, the state will be Active by default."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Status result of the activity when the state is set to Inactive. This is an optional property and if not provided when the activity is inactive, the status will be Succeeded by default."] + #[serde(rename = "onInactiveMarkAs", default, skip_serializing_if = "Option::is_none")] + pub on_inactive_mark_as: Option, #[doc = "Activity depends on condition."] #[serde( rename = "dependsOn", @@ -55,11 +61,92 @@ impl Activity { name, type_, description: None, + state: None, + on_inactive_mark_as: None, depends_on: Vec::new(), user_properties: Vec::new(), } } } +pub mod activity { + use super::*; + #[doc = "Activity state. This is an optional property and if not provided, the state will be Active by default."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Active, + Inactive, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Active => serializer.serialize_unit_variant("State", 0u32, "Active"), + Self::Inactive => serializer.serialize_unit_variant("State", 1u32, "Inactive"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Status result of the activity when the state is set to Inactive. This is an optional property and if not provided when the activity is inactive, the status will be Succeeded by default."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OnInactiveMarkAs")] + pub enum OnInactiveMarkAs { + Succeeded, + Failed, + Skipped, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OnInactiveMarkAs { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OnInactiveMarkAs { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OnInactiveMarkAs { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("OnInactiveMarkAs", 0u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("OnInactiveMarkAs", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("OnInactiveMarkAs", 2u32, "Skipped"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "Activity dependency information."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ActivityDependency { @@ -193,6 +280,14 @@ impl AdditionalColumns { Self::default() } } +#[doc = "REST additional header parameter. Type: string (or Expression with resultType string)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdditionalHeaderParameter {} +impl AdditionalHeaderParameter { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Amazon Marketplace Web Service linked service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AmazonMwsLinkedService { @@ -239,9 +334,9 @@ pub struct AmazonMwsLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AmazonMwsLinkedServiceTypeProperties { pub fn new( @@ -307,9 +402,9 @@ pub struct AmazonRdsForLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AmazonRdsForLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -492,9 +587,9 @@ pub struct AmazonRdsForSqlServerLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Sql always encrypted properties."] #[serde(rename = "alwaysEncryptedSettings", default, skip_serializing_if = "Option::is_none")] pub always_encrypted_settings: Option, @@ -524,6 +619,9 @@ pub struct AmazonRdsForSqlServerSource { #[doc = "Value and type setting for stored procedure parameters. Example: \"{Parameter1: {value: \"1\", type: \"int\"}}\"."] #[serde(rename = "storedProcedureParameters", default, skip_serializing_if = "Option::is_none")] pub stored_procedure_parameters: Option, + #[doc = "Specifies the transaction locking behavior for the SQL source. Allowed values: ReadCommitted/ReadUncommitted/RepeatableRead/Serializable/Snapshot. The default value is ReadCommitted. Type: string (or Expression with resultType string)."] + #[serde(rename = "isolationLevel", default, skip_serializing_if = "Option::is_none")] + pub isolation_level: Option, #[doc = "Which additional types to produce."] #[serde(rename = "produceAdditionalTypes", default, skip_serializing_if = "Option::is_none")] pub produce_additional_types: Option, @@ -541,6 +639,7 @@ impl AmazonRdsForSqlServerSource { sql_reader_query: None, sql_reader_stored_procedure_name: None, stored_procedure_parameters: None, + isolation_level: None, produce_additional_types: None, partition_option: None, partition_settings: None, @@ -612,9 +711,9 @@ pub struct AmazonRedshiftLinkedServiceTypeProperties { #[doc = "The TCP port number that the Amazon Redshift server uses to listen for client connections. The default value is 5439. Type: integer (or Expression with resultType integer)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub port: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AmazonRedshiftLinkedServiceTypeProperties { pub fn new(server: serde_json::Value, database: serde_json::Value) -> Self { @@ -716,9 +815,9 @@ pub struct AmazonS3CompatibleLinkedServiceTypeProperties { #[doc = "If true, use S3 path-style access instead of virtual hosted-style access. Default value is false. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "forcePathStyle", default, skip_serializing_if = "Option::is_none")] pub force_path_style: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AmazonS3CompatibleLinkedServiceTypeProperties { pub fn new() -> Self { @@ -766,9 +865,9 @@ pub struct AmazonS3CompatibleReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -890,9 +989,9 @@ pub struct AmazonS3LinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "sessionToken", default, skip_serializing_if = "Option::is_none")] pub session_token: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AmazonS3LinkedServiceTypeProperties { pub fn new() -> Self { @@ -940,9 +1039,9 @@ pub struct AmazonS3ReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -993,7 +1092,7 @@ impl AppFiguresLinkedService { #[doc = "AppFigures linked service type properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AppFiguresLinkedServiceTypeProperties { - #[doc = "The username of the Appfigures source."] + #[doc = "The username of the Appfigures source. Type: string (or Expression with resultType string)."] #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] @@ -1034,7 +1133,7 @@ pub struct AppendVariableActivityTypeProperties { #[doc = "Name of the variable whose value needs to be appended to."] #[serde(rename = "variableName", default, skip_serializing_if = "Option::is_none")] pub variable_name: Option, - #[doc = "Value to be appended. Could be a static value or Expression"] + #[doc = "Value to be appended. Type: could be a static value matching type of the variable item or Expression with resultType matching type of the variable item"] #[serde(default, skip_serializing_if = "Option::is_none")] pub value: Option, } @@ -1077,9 +1176,9 @@ pub struct AsanaLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] pub api_token: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AsanaLinkedServiceTypeProperties { pub fn new(api_token: SecretBase) -> Self { @@ -1318,9 +1417,9 @@ pub struct AzureBatchLinkedServiceTypeProperties { #[doc = "Linked service reference type."] #[serde(rename = "linkedServiceName")] pub linked_service_name: LinkedServiceReference, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -1466,9 +1565,9 @@ pub struct AzureBlobFsLinkedServiceTypeProperties { #[doc = "Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions’ cloud type. Type: string (or Expression with resultType string)."] #[serde(rename = "azureCloudType", default, skip_serializing_if = "Option::is_none")] pub azure_cloud_type: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -1657,7 +1756,7 @@ pub struct AzureBlobStorageLinkedServiceTypeProperties { pub sas_token: Option, #[doc = "Blob service endpoint of the Azure Blob Storage resource. It is mutually exclusive with connectionString, sasUri property."] #[serde(rename = "serviceEndpoint", default, skip_serializing_if = "Option::is_none")] - pub service_endpoint: Option, + pub service_endpoint: Option, #[doc = "The ID of the service principal used to authenticate against Azure SQL Data Warehouse. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, @@ -1672,8 +1771,8 @@ pub struct AzureBlobStorageLinkedServiceTypeProperties { pub azure_cloud_type: Option, #[doc = "Specify the kind of your storage account. Allowed values are: Storage (general purpose v1), StorageV2 (general purpose v2), BlobStorage, or BlockBlobStorage. Type: string (or Expression with resultType string)."] #[serde(rename = "accountKind", default, skip_serializing_if = "Option::is_none")] - pub account_kind: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + pub account_kind: Option, + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, #[doc = "Credential reference type."] @@ -1774,9 +1873,9 @@ pub struct AzureBlobStorageReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -2026,9 +2125,9 @@ pub struct AzureDataLakeAnalyticsLinkedServiceTypeProperties { #[doc = "Azure Data Lake Analytics URI Type: string (or Expression with resultType string)."] #[serde(rename = "dataLakeAnalyticsUri", default, skip_serializing_if = "Option::is_none")] pub data_lake_analytics_uri: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzureDataLakeAnalyticsLinkedServiceTypeProperties { pub fn new(account_name: serde_json::Value, tenant: serde_json::Value) -> Self { @@ -2126,9 +2225,9 @@ pub struct AzureDataLakeStoreLinkedServiceTypeProperties { #[doc = "Data Lake Store account resource group name (if different from Data Factory account). Type: string (or Expression with resultType string)."] #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] pub resource_group_name: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -2424,9 +2523,9 @@ pub struct AzureDatabricksDetltaLakeLinkedServiceTypeProperties { #[doc = "The id of an existing interactive cluster that will be used for all runs of this job. Type: string (or Expression with resultType string)."] #[serde(rename = "clusterId", default, skip_serializing_if = "Option::is_none")] pub cluster_id: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -2513,9 +2612,9 @@ pub struct AzureDatabricksLinkedServiceTypeProperties { #[doc = "Enable the elastic disk on the new cluster. This property is now ignored, and takes the default elastic disk behavior in Databricks (elastic disks are always enabled). Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "newClusterEnableElasticDisk", default, skip_serializing_if = "Option::is_none")] pub new_cluster_enable_elastic_disk: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "The policy id for limiting the ability to configure clusters based on a user defined set of rules. Type: string (or Expression with resultType string)."] #[serde(rename = "policyId", default, skip_serializing_if = "Option::is_none")] pub policy_id: Option, @@ -2595,9 +2694,9 @@ pub struct AzureFileStorageLinkedServiceTypeProperties { #[doc = "The azure file share snapshot version. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub snapshot: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzureFileStorageLinkedServiceTypeProperties { pub fn new() -> Self { @@ -2635,9 +2734,9 @@ pub struct AzureFileStorageReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -2801,9 +2900,9 @@ pub struct AzureFunctionLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "functionKey", default, skip_serializing_if = "Option::is_none")] pub function_key: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -3008,9 +3107,9 @@ pub struct AzureMlLinkedServiceTypeProperties { #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Type of authentication (Required to specify MSI) used to connect to AzureML. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub authentication: Option, @@ -3075,9 +3174,9 @@ pub struct AzureMlServiceLinkedServiceTypeProperties { #[doc = "The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzureMlServiceLinkedServiceTypeProperties { pub fn new(subscription_id: serde_json::Value, resource_group_name: serde_json::Value, ml_workspace_name: serde_json::Value) -> Self { @@ -3179,9 +3278,9 @@ pub struct AzureMariaDbLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pwd: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzureMariaDbLinkedServiceTypeProperties { pub fn new() -> Self { @@ -3248,9 +3347,9 @@ pub struct AzureMySqlLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzureMySqlLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -3350,9 +3449,9 @@ pub struct AzurePostgreSqlLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzurePostgreSqlLinkedServiceTypeProperties { pub fn new() -> Self { @@ -3547,9 +3646,9 @@ pub struct AzureSearchLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub key: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl AzureSearchLinkedServiceTypeProperties { pub fn new(url: serde_json::Value) -> Self { @@ -3598,9 +3697,9 @@ pub struct AzureSqlDwLinkedServiceTypeProperties { #[doc = "Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions’ cloud type. Type: string (or Expression with resultType string)."] #[serde(rename = "azureCloudType", default, skip_serializing_if = "Option::is_none")] pub azure_cloud_type: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -3692,9 +3791,9 @@ pub struct AzureSqlDatabaseLinkedServiceTypeProperties { #[doc = "Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions’ cloud type. Type: string (or Expression with resultType string)."] #[serde(rename = "azureCloudType", default, skip_serializing_if = "Option::is_none")] pub azure_cloud_type: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Sql always encrypted properties."] #[serde(rename = "alwaysEncryptedSettings", default, skip_serializing_if = "Option::is_none")] pub always_encrypted_settings: Option, @@ -3755,9 +3854,9 @@ pub struct AzureSqlMiLinkedServiceTypeProperties { #[doc = "Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions’ cloud type. Type: string (or Expression with resultType string)."] #[serde(rename = "azureCloudType", default, skip_serializing_if = "Option::is_none")] pub azure_cloud_type: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Sql always encrypted properties."] #[serde(rename = "alwaysEncryptedSettings", default, skip_serializing_if = "Option::is_none")] pub always_encrypted_settings: Option, @@ -3878,6 +3977,9 @@ pub struct AzureSqlSource { #[doc = "Value and type setting for stored procedure parameters. Example: \"{Parameter1: {value: \"1\", type: \"int\"}}\"."] #[serde(rename = "storedProcedureParameters", default, skip_serializing_if = "Option::is_none")] pub stored_procedure_parameters: Option, + #[doc = "Specifies the transaction locking behavior for the SQL source. Allowed values: ReadCommitted/ReadUncommitted/RepeatableRead/Serializable/Snapshot. The default value is ReadCommitted. Type: string (or Expression with resultType string)."] + #[serde(rename = "isolationLevel", default, skip_serializing_if = "Option::is_none")] + pub isolation_level: Option, #[doc = "Which additional types to produce."] #[serde(rename = "produceAdditionalTypes", default, skip_serializing_if = "Option::is_none")] pub produce_additional_types: Option, @@ -3895,6 +3997,7 @@ impl AzureSqlSource { sql_reader_query: None, sql_reader_stored_procedure_name: None, stored_procedure_parameters: None, + isolation_level: None, produce_additional_types: None, partition_option: None, partition_settings: None, @@ -3968,7 +4071,7 @@ pub struct AzureStorageLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] pub sas_token: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } @@ -4449,9 +4552,9 @@ pub struct CassandraLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl CassandraLinkedServiceTypeProperties { pub fn new(host: serde_json::Value) -> Self { @@ -4787,9 +4890,9 @@ pub struct CommonDataServiceForAppsLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] pub service_principal_credential: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl CommonDataServiceForAppsLinkedServiceTypeProperties { pub fn new(deployment_type: serde_json::Value, authentication_type: serde_json::Value) -> Self { @@ -5024,9 +5127,9 @@ pub struct ConcurLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ConcurLinkedServiceTypeProperties { pub fn new(client_id: serde_json::Value, username: serde_json::Value) -> Self { @@ -5399,9 +5502,9 @@ pub struct CosmosDbLinkedServiceTypeProperties { #[doc = "The client ID of the application in Azure Active Directory used for Server-To-Server authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, - #[doc = "The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string)."] + #[doc = "The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string."] #[serde(rename = "servicePrincipalCredentialType", default, skip_serializing_if = "Option::is_none")] - pub service_principal_credential_type: Option, + pub service_principal_credential_type: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] pub service_principal_credential: Option, @@ -5411,12 +5514,12 @@ pub struct CosmosDbLinkedServiceTypeProperties { #[doc = "Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions’ cloud type. Type: string (or Expression with resultType string)."] #[serde(rename = "azureCloudType", default, skip_serializing_if = "Option::is_none")] pub azure_cloud_type: Option, - #[doc = "The connection mode used to access CosmosDB account. Type: string (or Expression with resultType string)."] + #[doc = "The connection mode used to access CosmosDB account. Type: string."] #[serde(rename = "connectionMode", default, skip_serializing_if = "Option::is_none")] pub connection_mode: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -5428,48 +5531,7 @@ impl CosmosDbLinkedServiceTypeProperties { } pub mod cosmos_db_linked_service_type_properties { use super::*; - #[doc = "The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ServicePrincipalCredentialType")] - pub enum ServicePrincipalCredentialType { - ServicePrincipalKey, - ServicePrincipalCert, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ServicePrincipalCredentialType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ServicePrincipalCredentialType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ServicePrincipalCredentialType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::ServicePrincipalKey => { - serializer.serialize_unit_variant("ServicePrincipalCredentialType", 0u32, "ServicePrincipalKey") - } - Self::ServicePrincipalCert => { - serializer.serialize_unit_variant("ServicePrincipalCredentialType", 1u32, "ServicePrincipalCert") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The connection mode used to access CosmosDB account. Type: string (or Expression with resultType string)."] + #[doc = "The connection mode used to access CosmosDB account. Type: string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "ConnectionMode")] pub enum ConnectionMode { @@ -5722,9 +5784,9 @@ pub struct CouchbaseLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(rename = "credString", default, skip_serializing_if = "Option::is_none")] pub cred_string: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl CouchbaseLinkedServiceTypeProperties { pub fn new() -> Self { @@ -7066,9 +7128,9 @@ pub struct DataworldLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] pub api_token: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl DataworldLinkedServiceTypeProperties { pub fn new(api_token: SecretBase) -> Self { @@ -7133,9 +7195,9 @@ pub struct Db2LinkedServiceTypeProperties { #[doc = "Certificate Common Name when TLS is enabled. It is mutually exclusive with connectionString property. Type: string (or Expression with resultType string)."] #[serde(rename = "certificateCommonName", default, skip_serializing_if = "Option::is_none")] pub certificate_common_name: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. It is mutually exclusive with connectionString property. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. It is mutually exclusive with connectionString property. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl Db2LinkedServiceTypeProperties { pub fn new() -> Self { @@ -7610,9 +7672,9 @@ pub struct DrillLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pwd: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl DrillLinkedServiceTypeProperties { pub fn new() -> Self { @@ -7686,9 +7748,9 @@ pub struct DynamicsAxLinkedServiceTypeProperties { #[doc = "Specify the resource you are requesting authorization. Type: string (or Expression with resultType string)."] #[serde(rename = "aadResourceId")] pub aad_resource_id: serde_json::Value, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl DynamicsAxLinkedServiceTypeProperties { pub fn new( @@ -7876,9 +7938,9 @@ pub struct DynamicsCrmLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] pub service_principal_credential: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl DynamicsCrmLinkedServiceTypeProperties { pub fn new(deployment_type: serde_json::Value, authentication_type: serde_json::Value) -> Self { @@ -8063,9 +8125,9 @@ pub struct DynamicsLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalCredential", default, skip_serializing_if = "Option::is_none")] pub service_principal_credential: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -8206,9 +8268,9 @@ pub struct EloquaLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl EloquaLinkedServiceTypeProperties { pub fn new(endpoint: serde_json::Value, username: serde_json::Value) -> Self { @@ -9218,9 +9280,9 @@ pub struct FileServerLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl FileServerLinkedServiceTypeProperties { pub fn new(host: serde_json::Value) -> Self { @@ -9260,9 +9322,9 @@ pub struct FileServerReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -9559,9 +9621,9 @@ pub struct FtpReadSettings { #[doc = "Ftp wildcardFileName. Type: string (or Expression with resultType string)."] #[serde(rename = "wildcardFileName", default, skip_serializing_if = "Option::is_none")] pub wildcard_file_name: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -9571,9 +9633,9 @@ pub struct FtpReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Specify whether to use binary transfer mode for FTP stores."] + #[doc = "Specify whether to use binary transfer mode for FTP stores. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "useBinaryTransfer", default, skip_serializing_if = "Option::is_none")] - pub use_binary_transfer: Option, + pub use_binary_transfer: Option, #[doc = "If true, disable parallel reading within each file. Default is false. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "disableChunking", default, skip_serializing_if = "Option::is_none")] pub disable_chunking: Option, @@ -9628,9 +9690,9 @@ pub struct FtpServerLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "If true, connect to the FTP server over SSL/TLS channel. Default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enableSsl", default, skip_serializing_if = "Option::is_none")] pub enable_ssl: Option, @@ -9976,7 +10038,7 @@ pub struct GoogleAdWordsLinkedServiceTypeProperties { #[doc = "Properties used to connect to GoogleAds. It is mutually exclusive with any other properties in the linked service. Type: object."] #[serde(rename = "connectionProperties", default, skip_serializing_if = "Option::is_none")] pub connection_properties: Option, - #[doc = "The Client customer ID of the AdWords account that you want to fetch report data for."] + #[doc = "The Client customer ID of the AdWords account that you want to fetch report data for. Type: string (or Expression with resultType string)."] #[serde(rename = "clientCustomerID", default, skip_serializing_if = "Option::is_none")] pub client_customer_id: Option, #[doc = "The base definition of a secret type."] @@ -9994,21 +10056,21 @@ pub struct GoogleAdWordsLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] pub client_secret: Option, - #[doc = "The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR."] + #[doc = "The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, - #[doc = "The full path to the .p12 key file that is used to authenticate the service account email address and can only be used on self-hosted IR."] + #[doc = "The full path to the .p12 key file that is used to authenticate the service account email address and can only be used on self-hosted IR. Type: string (or Expression with resultType string)."] #[serde(rename = "keyFilePath", default, skip_serializing_if = "Option::is_none")] pub key_file_path: Option, - #[doc = "The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR."] + #[doc = "The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. Type: string (or Expression with resultType string)."] #[serde(rename = "trustedCertPath", default, skip_serializing_if = "Option::is_none")] pub trusted_cert_path: Option, - #[doc = "Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false."] + #[doc = "Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "useSystemTrustStore", default, skip_serializing_if = "Option::is_none")] pub use_system_trust_store: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl GoogleAdWordsLinkedServiceTypeProperties { pub fn new() -> Self { @@ -10127,12 +10189,12 @@ impl GoogleBigQueryLinkedService { #[doc = "Google BigQuery service linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GoogleBigQueryLinkedServiceTypeProperties { - #[doc = "The default BigQuery project to query against."] + #[doc = "The default BigQuery project to query against. Type: string (or Expression with resultType string)."] pub project: serde_json::Value, - #[doc = "A comma-separated list of public BigQuery projects to access."] + #[doc = "A comma-separated list of public BigQuery projects to access. Type: string (or Expression with resultType string)."] #[serde(rename = "additionalProjects", default, skip_serializing_if = "Option::is_none")] pub additional_projects: Option, - #[doc = "Whether to request access to Google Drive. Allowing Google Drive access enables support for federated tables that combine BigQuery data with data from Google Drive. The default value is false."] + #[doc = "Whether to request access to Google Drive. Allowing Google Drive access enables support for federated tables that combine BigQuery data with data from Google Drive. The default value is false. Type: string (or Expression with resultType string)."] #[serde(rename = "requestGoogleDriveScope", default, skip_serializing_if = "Option::is_none")] pub request_google_drive_scope: Option, #[doc = "The OAuth 2.0 authentication mechanism used for authentication. ServiceAuthentication can only be used on self-hosted IR."] @@ -10147,21 +10209,21 @@ pub struct GoogleBigQueryLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] pub client_secret: Option, - #[doc = "The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR."] + #[doc = "The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, - #[doc = "The full path to the .p12 key file that is used to authenticate the service account email address and can only be used on self-hosted IR."] + #[doc = "The full path to the .p12 key file that is used to authenticate the service account email address and can only be used on self-hosted IR. Type: string (or Expression with resultType string)."] #[serde(rename = "keyFilePath", default, skip_serializing_if = "Option::is_none")] pub key_file_path: Option, - #[doc = "The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR."] + #[doc = "The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over SSL. This property can only be set when using SSL on self-hosted IR. The default value is the cacerts.pem file installed with the IR. Type: string (or Expression with resultType string)."] #[serde(rename = "trustedCertPath", default, skip_serializing_if = "Option::is_none")] pub trusted_cert_path: Option, - #[doc = "Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false."] + #[doc = "Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. The default value is false.Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "useSystemTrustStore", default, skip_serializing_if = "Option::is_none")] pub use_system_trust_store: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl GoogleBigQueryLinkedServiceTypeProperties { pub fn new( @@ -10287,9 +10349,9 @@ pub struct GoogleCloudStorageLinkedServiceTypeProperties { #[doc = "This value specifies the endpoint to access with the Google Cloud Storage Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string)."] #[serde(rename = "serviceUrl", default, skip_serializing_if = "Option::is_none")] pub service_url: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl GoogleCloudStorageLinkedServiceTypeProperties { pub fn new() -> Self { @@ -10337,9 +10399,9 @@ pub struct GoogleCloudStorageReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -10393,9 +10455,9 @@ pub struct GoogleSheetsLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] pub api_token: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl GoogleSheetsLinkedServiceTypeProperties { pub fn new(api_token: SecretBase) -> Self { @@ -10449,9 +10511,9 @@ pub struct GreenplumLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pwd: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl GreenplumLinkedServiceTypeProperties { pub fn new() -> Self { @@ -10541,9 +10603,9 @@ pub struct HBaseLinkedServiceTypeProperties { #[doc = "Specifies whether to allow self-signed certificates from the server. The default value is false."] #[serde(rename = "allowSelfSignedServerCert", default, skip_serializing_if = "Option::is_none")] pub allow_self_signed_server_cert: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl HBaseLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, authentication_type: h_base_linked_service_type_properties::AuthenticationType) -> Self { @@ -10723,12 +10785,8 @@ pub struct HdInsightHiveActivityTypeProperties { #[serde(default, skip_serializing_if = "Option::is_none")] pub defines: Option, #[doc = "User specified arguments under hivevar namespace."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub variables: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub variables: Option, #[doc = "Query timeout value (in minutes). Effective when the HDInsight cluster is with ESP (Enterprise Security Package)"] #[serde(rename = "queryTimeout", default, skip_serializing_if = "Option::is_none")] pub query_timeout: Option, @@ -10773,9 +10831,9 @@ pub struct HdInsightLinkedServiceTypeProperties { #[doc = "Linked service reference type."] #[serde(rename = "hcatalogLinkedServiceName", default, skip_serializing_if = "Option::is_none")] pub hcatalog_linked_service_name: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Specify if the HDInsight is created with ESP (Enterprise Security Package). Type: Boolean."] #[serde(rename = "isEspEnabled", default, skip_serializing_if = "Option::is_none")] pub is_esp_enabled: Option, @@ -10971,9 +11029,9 @@ pub struct HdInsightOnDemandLinkedServiceTypeProperties { #[doc = "Specifies the Yarn configuration parameters (yarn-site.xml) for the HDInsight cluster."] #[serde(rename = "yarnConfiguration", default, skip_serializing_if = "Option::is_none")] pub yarn_configuration: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Specifies the size of the head node for the HDInsight cluster."] #[serde(rename = "headNodeSize", default, skip_serializing_if = "Option::is_none")] pub head_node_size: Option, @@ -11277,9 +11335,9 @@ pub struct HdfsLinkedServiceTypeProperties { #[doc = "Type of authentication used to connect to the HDFS. Possible values are: Anonymous and Windows. Type: string (or Expression with resultType string)."] #[serde(rename = "authenticationType", default, skip_serializing_if = "Option::is_none")] pub authentication_type: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "User name for Windows authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] pub user_name: Option, @@ -11326,9 +11384,9 @@ pub struct HdfsReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -11507,9 +11565,9 @@ pub struct HiveLinkedServiceTypeProperties { #[doc = "Specifies whether to allow self-signed certificates from the server. The default value is false."] #[serde(rename = "allowSelfSignedServerCert", default, skip_serializing_if = "Option::is_none")] pub allow_self_signed_server_cert: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl HiveLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, authentication_type: hive_linked_service_type_properties::AuthenticationType) -> Self { @@ -11779,9 +11837,9 @@ pub struct HttpLinkedServiceTypeProperties { #[doc = "Thumbprint of certificate for ClientCertificate authentication. Only valid for on-premises copy. For on-premises copy with ClientCertificate authentication, either CertThumbprint or EmbeddedCertData/Password should be specified. Type: string (or Expression with resultType string)."] #[serde(rename = "certThumbprint", default, skip_serializing_if = "Option::is_none")] pub cert_thumbprint: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "If true, validate the HTTPS server SSL certificate. Default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enableServerCertificateValidation", default, skip_serializing_if = "Option::is_none")] pub enable_server_certificate_validation: Option, @@ -11847,7 +11905,7 @@ pub mod http_linked_service_type_properties { } } } -#[doc = "Sftp read settings."] +#[doc = "Http read settings."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HttpReadSettings { #[serde(flatten)] @@ -11861,15 +11919,12 @@ pub struct HttpReadSettings { #[doc = "The additional HTTP headers in the request to the RESTful API. Type: string (or Expression with resultType string)."] #[serde(rename = "additionalHeaders", default, skip_serializing_if = "Option::is_none")] pub additional_headers: Option, - #[doc = "Specifies the timeout for a HTTP client to get HTTP response from HTTP server."] + #[doc = "Specifies the timeout for a HTTP client to get HTTP response from HTTP server. Type: string (or Expression with resultType string)."] #[serde(rename = "requestTimeout", default, skip_serializing_if = "Option::is_none")] pub request_timeout: Option, - #[doc = "Indicates whether to enable partition discovery."] - #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, - #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] - #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] - pub partition_root_path: Option, + #[doc = "Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects)."] + #[serde(rename = "additionalColumns", default, skip_serializing_if = "Option::is_none")] + pub additional_columns: Option, } impl HttpReadSettings { pub fn new(store_read_settings: StoreReadSettings) -> Self { @@ -11879,8 +11934,7 @@ impl HttpReadSettings { request_body: None, additional_headers: None, request_timeout: None, - enable_partition_discovery: None, - partition_root_path: None, + additional_columns: None, } } } @@ -11959,9 +12013,9 @@ pub struct HubspotLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl HubspotLinkedServiceTypeProperties { pub fn new(client_id: serde_json::Value) -> Self { @@ -12126,9 +12180,9 @@ pub struct ImpalaLinkedServiceTypeProperties { #[doc = "Specifies whether to allow self-signed certificates from the server. The default value is false."] #[serde(rename = "allowSelfSignedServerCert", default, skip_serializing_if = "Option::is_none")] pub allow_self_signed_server_cert: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ImpalaLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, authentication_type: impala_linked_service_type_properties::AuthenticationType) -> Self { @@ -12256,7 +12310,7 @@ impl InformixLinkedService { #[doc = "Informix linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InformixLinkedServiceTypeProperties { - #[doc = "The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, SecureString or AzureKeyVaultSecretReference."] + #[doc = "The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, or SecureString, or AzureKeyVaultSecretReference, or Expression with resultType string."] #[serde(rename = "connectionString")] pub connection_string: serde_json::Value, #[doc = "Type of authentication used to connect to the Informix as ODBC data store. Possible values are: Anonymous and Basic. Type: string (or Expression with resultType string)."] @@ -12271,9 +12325,9 @@ pub struct InformixLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl InformixLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -13258,9 +13312,9 @@ pub struct JiraLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl JiraLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, username: serde_json::Value) -> Self { @@ -13925,9 +13979,9 @@ pub struct MagentoLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl MagentoLinkedServiceTypeProperties { pub fn new(host: serde_json::Value) -> Self { @@ -14470,9 +14524,9 @@ pub struct MariaDbLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pwd: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl MariaDbLinkedServiceTypeProperties { pub fn new() -> Self { @@ -14550,9 +14604,9 @@ pub struct MarketoLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl MarketoLinkedServiceTypeProperties { pub fn new(endpoint: serde_json::Value, client_id: serde_json::Value) -> Self { @@ -14636,7 +14690,7 @@ impl MicrosoftAccessLinkedService { #[doc = "Microsoft Access linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MicrosoftAccessLinkedServiceTypeProperties { - #[doc = "The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, SecureString or AzureKeyVaultSecretReference."] + #[doc = "The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, or SecureString, or AzureKeyVaultSecretReference, or Expression with resultType string."] #[serde(rename = "connectionString")] pub connection_string: serde_json::Value, #[doc = "Type of authentication used to connect to the Microsoft Access as ODBC data store. Possible values are: Anonymous and Basic. Type: string (or Expression with resultType string)."] @@ -14651,9 +14705,9 @@ pub struct MicrosoftAccessLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl MicrosoftAccessLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -14784,12 +14838,16 @@ pub struct MongoDbAtlasLinkedServiceTypeProperties { pub connection_string: serde_json::Value, #[doc = "The name of the MongoDB Atlas database that you want to access. Type: string (or Expression with resultType string)."] pub database: serde_json::Value, + #[doc = "The MongoDB Atlas Driver version that you want to choose. Allowed value are 2.10.4 and 2.19.0. Type: string (or Expression with resultType string)."] + #[serde(rename = "mongoDbAtlasDriverVersion", default, skip_serializing_if = "Option::is_none")] + pub mongo_db_atlas_driver_version: Option, } impl MongoDbAtlasLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value, database: serde_json::Value) -> Self { Self { connection_string, database, + mongo_db_atlas_driver_version: None, } } } @@ -14936,9 +14994,9 @@ pub struct MongoDbLinkedServiceTypeProperties { #[doc = "Specifies whether to allow self-signed certificates from the server. The default value is false. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "allowSelfSignedServerCert", default, skip_serializing_if = "Option::is_none")] pub allow_self_signed_server_cert: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl MongoDbLinkedServiceTypeProperties { pub fn new(server: serde_json::Value, database_name: serde_json::Value) -> Self { @@ -15167,15 +15225,15 @@ impl MySqlLinkedService { #[doc = "MySQL linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MySqlLinkedServiceTypeProperties { - #[doc = "The connection string."] + #[doc = "The connection string. Type: string, SecureString or AzureKeyVaultSecretReference."] #[serde(rename = "connectionString")] pub connection_string: serde_json::Value, #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl MySqlLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -15258,9 +15316,9 @@ pub struct NetezzaLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pwd: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl NetezzaLinkedServiceTypeProperties { pub fn new() -> Self { @@ -15502,9 +15560,9 @@ pub struct ODataLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalEmbeddedCertPassword", default, skip_serializing_if = "Option::is_none")] pub service_principal_embedded_cert_password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ODataLinkedServiceTypeProperties { pub fn new(url: serde_json::Value) -> Self { @@ -15687,7 +15745,7 @@ impl OdbcLinkedService { #[doc = "ODBC linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OdbcLinkedServiceTypeProperties { - #[doc = "The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, SecureString or AzureKeyVaultSecretReference."] + #[doc = "The non-access credential portion of the connection string as well as an optional encrypted credential. Type: string, or SecureString, or AzureKeyVaultSecretReference, or Expression with resultType string."] #[serde(rename = "connectionString")] pub connection_string: serde_json::Value, #[doc = "Type of authentication used to connect to the ODBC data store. Possible values are: Anonymous and Basic. Type: string (or Expression with resultType string)."] @@ -15702,9 +15760,9 @@ pub struct OdbcLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl OdbcLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -15845,9 +15903,9 @@ pub struct Office365LinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey")] pub service_principal_key: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl Office365LinkedServiceTypeProperties { pub fn new( @@ -15885,7 +15943,7 @@ pub struct Office365Source { #[doc = "End time of the requested range for this dataset. Type: string (or Expression with resultType string)."] #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] pub end_time: Option, - #[doc = "The columns to be read out from the Office 365 table. Type: array of objects (or Expression with resultType array of objects). Example: [ { \"name\": \"Id\" }, { \"name\": \"CreatedDateTime\" } ]"] + #[doc = "The columns to be read out from the Office 365 table. Type: array of objects (or Expression with resultType array of objects). itemType: OutputColumn. Example: [ { \"name\": \"Id\" }, { \"name\": \"CreatedDateTime\" } ]"] #[serde(rename = "outputColumns", default, skip_serializing_if = "Option::is_none")] pub output_columns: Option, } @@ -16136,9 +16194,9 @@ pub struct OracleCloudStorageLinkedServiceTypeProperties { #[doc = "This value specifies the endpoint to access with the Oracle Cloud Storage Connector. This is an optional property; change it only if you want to try a different service endpoint or want to switch between https and http. Type: string (or Expression with resultType string)."] #[serde(rename = "serviceUrl", default, skip_serializing_if = "Option::is_none")] pub service_url: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl OracleCloudStorageLinkedServiceTypeProperties { pub fn new() -> Self { @@ -16186,9 +16244,9 @@ pub struct OracleCloudStorageReadSettings { #[doc = "Point to a text file that lists each file (relative path to the path configured in the dataset) that you want to copy. Type: string (or Expression with resultType string)."] #[serde(rename = "fileListPath", default, skip_serializing_if = "Option::is_none")] pub file_list_path: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -16245,9 +16303,9 @@ pub struct OracleLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl OracleLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -16355,9 +16413,9 @@ pub struct OracleServiceCloudLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl OracleServiceCloudLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, username: serde_json::Value, password: SecretBase) -> Self { @@ -16643,6 +16701,18 @@ impl OrcWriteSettings { } } } +#[doc = "The columns to be read out from the Office 365 table."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OutputColumn { + #[doc = "Name of the table column. Type: string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl OutputColumn { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Package store for the SSIS integration runtime."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PackageStore { @@ -16660,6 +16730,14 @@ impl PackageStore { } } } +#[doc = "REST pagination rule parameter. Type: string (or Expression with resultType string)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PaginationRuleParameter {} +impl PaginationRuleParameter { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Definition of all parameters for an entity."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ParameterDefinitionSpecification {} @@ -16872,7 +16950,7 @@ impl PaypalLinkedService { #[doc = "Paypal Service linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PaypalLinkedServiceTypeProperties { - #[doc = "The URL\u{a0}of the PayPal instance. (i.e. api.sandbox.paypal.com)"] + #[doc = "The URL of the PayPal instance. (i.e. api.sandbox.paypal.com)"] pub host: serde_json::Value, #[doc = "The client ID associated with your PayPal application."] #[serde(rename = "clientId")] @@ -16889,9 +16967,9 @@ pub struct PaypalLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl PaypalLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, client_id: serde_json::Value) -> Self { @@ -17010,9 +17088,9 @@ pub struct PhoenixLinkedServiceTypeProperties { #[doc = "Specifies whether to allow self-signed certificates from the server. The default value is false."] #[serde(rename = "allowSelfSignedServerCert", default, skip_serializing_if = "Option::is_none")] pub allow_self_signed_server_cert: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl PhoenixLinkedServiceTypeProperties { pub fn new(host: serde_json::Value, authentication_type: phoenix_linked_service_type_properties::AuthenticationType) -> Self { @@ -17441,15 +17519,15 @@ impl PostgreSqlLinkedService { #[doc = "PostgreSQL linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PostgreSqlLinkedServiceTypeProperties { - #[doc = "The connection string."] + #[doc = "The connection string. Type: string, SecureString or AzureKeyVaultSecretReference."] #[serde(rename = "connectionString")] pub connection_string: serde_json::Value, #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl PostgreSqlLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -17663,9 +17741,9 @@ pub struct PrestoLinkedServiceTypeProperties { #[doc = "The local time zone used by the connection. Valid values for this option are specified in the IANA Time Zone Database. The default value is the system time zone."] #[serde(rename = "timeZoneID", default, skip_serializing_if = "Option::is_none")] pub time_zone_id: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl PrestoLinkedServiceTypeProperties { pub fn new( @@ -17993,9 +18071,9 @@ pub struct QuickBooksLinkedServiceTypeProperties { #[doc = "Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true."] #[serde(rename = "useEncryptedEndpoints", default, skip_serializing_if = "Option::is_none")] pub use_encrypted_endpoints: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl QuickBooksLinkedServiceTypeProperties { pub fn new() -> Self { @@ -18061,9 +18139,9 @@ pub struct QuickbaseLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "userToken")] pub user_token: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl QuickbaseLinkedServiceTypeProperties { pub fn new(url: serde_json::Value, user_token: SecretBase) -> Self { @@ -18398,9 +18476,9 @@ pub struct ResponsysLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ResponsysLinkedServiceTypeProperties { pub fn new(endpoint: serde_json::Value, client_id: serde_json::Value) -> Self { @@ -18478,10 +18556,10 @@ pub struct RestResourceDatasetTypeProperties { #[doc = "The HTTP request body to the RESTful API if requestMethod is POST. Type: string (or Expression with resultType string)."] #[serde(rename = "requestBody", default, skip_serializing_if = "Option::is_none")] pub request_body: Option, - #[doc = "The additional HTTP headers in the request to the RESTful API. Type: string (or Expression with resultType string)."] + #[doc = "The additional HTTP headers in the request to the RESTful API."] #[serde(rename = "additionalHeaders", default, skip_serializing_if = "Option::is_none")] pub additional_headers: Option, - #[doc = "The pagination rules to compose next page requests. Type: string (or Expression with resultType string)."] + #[doc = "The pagination rules to compose next page requests."] #[serde(rename = "paginationRules", default, skip_serializing_if = "Option::is_none")] pub pagination_rules: Option, } @@ -18510,7 +18588,7 @@ impl RestServiceLinkedService { #[doc = "Rest Service linked service properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RestServiceLinkedServiceTypeProperties { - #[doc = "The base URL of the REST service."] + #[doc = "The base URL of the REST service. Type: string (or Expression with resultType string)."] pub url: serde_json::Value, #[doc = "Whether to validate server side SSL certificate when connecting to the endpoint.The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enableServerCertificateValidation", default, skip_serializing_if = "Option::is_none")] @@ -18518,7 +18596,7 @@ pub struct RestServiceLinkedServiceTypeProperties { #[doc = "Type of authentication used to connect to the REST service."] #[serde(rename = "authenticationType")] pub authentication_type: rest_service_linked_service_type_properties::AuthenticationType, - #[doc = "The user name used in Basic authentication type."] + #[doc = "The user name used in Basic authentication type. Type: string (or Expression with resultType string)."] #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")] pub user_name: Option, #[doc = "The base definition of a secret type."] @@ -18527,24 +18605,24 @@ pub struct RestServiceLinkedServiceTypeProperties { #[doc = "The additional HTTP headers in the request to RESTful API used for authorization. Type: object (or Expression with resultType object)."] #[serde(rename = "authHeaders", default, skip_serializing_if = "Option::is_none")] pub auth_headers: Option, - #[doc = "The application's client ID used in AadServicePrincipal authentication type."] + #[doc = "The application's client ID used in AadServicePrincipal authentication type. Type: string (or Expression with resultType string)."] #[serde(rename = "servicePrincipalId", default, skip_serializing_if = "Option::is_none")] pub service_principal_id: Option, #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey", default, skip_serializing_if = "Option::is_none")] pub service_principal_key: Option, - #[doc = "The tenant information (domain name or tenant ID) used in AadServicePrincipal authentication type under which your application resides."] + #[doc = "The tenant information (domain name or tenant ID) used in AadServicePrincipal authentication type under which your application resides. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tenant: Option, #[doc = "Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions’ cloud type. Type: string (or Expression with resultType string)."] #[serde(rename = "azureCloudType", default, skip_serializing_if = "Option::is_none")] pub azure_cloud_type: Option, - #[doc = "The resource you are requesting authorization to use."] + #[doc = "The resource you are requesting authorization to use. Type: string (or Expression with resultType string)."] #[serde(rename = "aadResourceId", default, skip_serializing_if = "Option::is_none")] pub aad_resource_id: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Credential reference type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub credential: Option, @@ -18988,9 +19066,9 @@ pub mod run_query_order_by { #[doc = "SSIS access credential."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SsisAccessCredential { - #[doc = "Domain for windows authentication."] + #[doc = "Domain for windows authentication. Type: string (or Expression with resultType string)."] pub domain: serde_json::Value, - #[doc = "UseName for windows authentication."] + #[doc = "UseName for windows authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] @@ -19042,9 +19120,9 @@ impl SsisConnectionManager { #[doc = "SSIS package execution credential."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SsisExecutionCredential { - #[doc = "Domain for windows authentication."] + #[doc = "Domain for windows authentication. Type: string (or Expression with resultType string)."] pub domain: serde_json::Value, - #[doc = "UseName for windows authentication."] + #[doc = "UseName for windows authentication. Type: string (or Expression with resultType string)."] #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "Azure Data Factory secure string definition. The string value will be masked with asterisks '*' during Get or List API calls."] @@ -19295,9 +19373,9 @@ pub struct SalesforceLinkedServiceTypeProperties { #[doc = "The Salesforce API version used in ADF. Type: string (or Expression with resultType string)."] #[serde(rename = "apiVersion", default, skip_serializing_if = "Option::is_none")] pub api_version: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SalesforceLinkedServiceTypeProperties { pub fn new() -> Self { @@ -19342,9 +19420,9 @@ pub struct SalesforceMarketingCloudLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SalesforceMarketingCloudLinkedServiceTypeProperties { pub fn new() -> Self { @@ -19452,9 +19530,9 @@ pub struct SalesforceServiceCloudLinkedServiceTypeProperties { #[doc = "Extended properties appended to the connection string. Type: string (or Expression with resultType string)."] #[serde(rename = "extendedProperties", default, skip_serializing_if = "Option::is_none")] pub extended_properties: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SalesforceServiceCloudLinkedServiceTypeProperties { pub fn new() -> Self { @@ -19780,9 +19858,9 @@ pub struct SapBwLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SapBwLinkedServiceTypeProperties { pub fn new(server: serde_json::Value, system_number: serde_json::Value, client_id: serde_json::Value) -> Self { @@ -19852,9 +19930,9 @@ pub struct SapCloudForCustomerLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SapCloudForCustomerLinkedServiceTypeProperties { pub fn new(url: serde_json::Value) -> Self { @@ -19994,19 +20072,19 @@ impl SapEccLinkedService { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SapEccLinkedServiceTypeProperties { #[doc = "The URL of SAP ECC OData API. For example, '[https://hostname:port/sap/opu/odata/sap/servicename/]'. Type: string (or Expression with resultType string)."] - pub url: String, + pub url: serde_json::Value, #[doc = "The username for Basic authentication. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, + pub username: Option, #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Either encryptedCredential or username/password must be provided. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] pub encrypted_credential: Option, } impl SapEccLinkedServiceTypeProperties { - pub fn new(url: String) -> Self { + pub fn new(url: serde_json::Value) -> Self { Self { url, username: None, @@ -20096,9 +20174,9 @@ pub struct SapHanaLinkedServiceProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SapHanaLinkedServiceProperties { pub fn new() -> Self { @@ -20330,9 +20408,9 @@ pub struct SapOdpLinkedServiceTypeProperties { #[doc = "The subscriber name. Type: string (or Expression with resultType string)."] #[serde(rename = "subscriberName", default, skip_serializing_if = "Option::is_none")] pub subscriber_name: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SapOdpLinkedServiceTypeProperties { pub fn new() -> Self { @@ -20446,9 +20524,9 @@ pub struct SapOpenHubLinkedServiceTypeProperties { #[doc = "The Logon Group for the SAP System. Type: string (or Expression with resultType string)."] #[serde(rename = "logonGroup", default, skip_serializing_if = "Option::is_none")] pub logon_group: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SapOpenHubLinkedServiceTypeProperties { pub fn new() -> Self { @@ -20585,9 +20663,9 @@ pub struct SapTableLinkedServiceTypeProperties { #[doc = "The Logon Group for the SAP System. Type: string (or Expression with resultType string)."] #[serde(rename = "logonGroup", default, skip_serializing_if = "Option::is_none")] pub logon_group: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SapTableLinkedServiceTypeProperties { pub fn new() -> Self { @@ -20844,7 +20922,7 @@ pub struct ScriptActivityParameter { #[doc = "The type of the parameter."] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, - #[doc = "The value of the parameter."] + #[doc = "The value of the parameter. Type: string (or Expression with resultType string)."] #[serde(default, skip_serializing_if = "Option::is_none")] pub value: Option, #[doc = "The direction of the parameter."] @@ -21510,9 +21588,9 @@ pub struct ServiceNowLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ServiceNowLinkedServiceTypeProperties { pub fn new(endpoint: serde_json::Value, authentication_type: service_now_linked_service_type_properties::AuthenticationType) -> Self { @@ -21701,9 +21779,9 @@ pub struct SftpReadSettings { #[doc = "Sftp wildcardFileName. Type: string (or Expression with resultType string)."] #[serde(rename = "wildcardFileName", default, skip_serializing_if = "Option::is_none")] pub wildcard_file_name: Option, - #[doc = "Indicates whether to enable partition discovery."] + #[doc = "Indicates whether to enable partition discovery. Type: boolean (or Expression with resultType boolean)."] #[serde(rename = "enablePartitionDiscovery", default, skip_serializing_if = "Option::is_none")] - pub enable_partition_discovery: Option, + pub enable_partition_discovery: Option, #[doc = "Specify the root path where partition discovery starts from. Type: string (or Expression with resultType string)."] #[serde(rename = "partitionRootPath", default, skip_serializing_if = "Option::is_none")] pub partition_root_path: Option, @@ -21774,9 +21852,9 @@ pub struct SftpServerLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "The SSH private key file path for SshPublicKey authentication. Only valid for on-premises copy. For on-premises copy with SshPublicKey authentication, either PrivateKeyPath or PrivateKeyContent should be specified. SSH private key should be OpenSSH format. Type: string (or Expression with resultType string)."] #[serde(rename = "privateKeyPath", default, skip_serializing_if = "Option::is_none")] pub private_key_path: Option, @@ -21917,9 +21995,9 @@ pub struct SharePointOnlineListLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "servicePrincipalKey")] pub service_principal_key: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SharePointOnlineListLinkedServiceTypeProperties { pub fn new( @@ -22009,9 +22087,9 @@ pub struct ShopifyLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ShopifyLinkedServiceTypeProperties { pub fn new(host: serde_json::Value) -> Self { @@ -22097,9 +22175,9 @@ pub struct SmartsheetLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken")] pub api_token: SecretBase, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SmartsheetLinkedServiceTypeProperties { pub fn new(api_token: SecretBase) -> Self { @@ -22206,9 +22284,9 @@ pub struct SnowflakeLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SnowflakeLinkedServiceTypeProperties { pub fn new(connection_string: serde_json::Value) -> Self { @@ -22389,9 +22467,9 @@ pub struct SparkLinkedServiceTypeProperties { #[doc = "Specifies whether to allow self-signed certificates from the server. The default value is false."] #[serde(rename = "allowSelfSignedServerCert", default, skip_serializing_if = "Option::is_none")] pub allow_self_signed_server_cert: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SparkLinkedServiceTypeProperties { pub fn new( @@ -22581,7 +22659,7 @@ impl SparkSource { #[doc = "Sql always encrypted properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SqlAlwaysEncryptedProperties { - #[doc = "Sql always encrypted AKV authentication type. Type: string (or Expression with resultType string)."] + #[doc = "Sql always encrypted AKV authentication type. Type: string."] #[serde(rename = "alwaysEncryptedAkvAuthType")] pub always_encrypted_akv_auth_type: sql_always_encrypted_properties::AlwaysEncryptedAkvAuthType, #[doc = "The client ID of the application in Azure Active Directory used for Azure Key Vault authentication. Type: string (or Expression with resultType string)."] @@ -22606,7 +22684,7 @@ impl SqlAlwaysEncryptedProperties { } pub mod sql_always_encrypted_properties { use super::*; - #[doc = "Sql always encrypted AKV authentication type. Type: string (or Expression with resultType string)."] + #[doc = "Sql always encrypted AKV authentication type. Type: string."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "AlwaysEncryptedAkvAuthType")] pub enum AlwaysEncryptedAkvAuthType { @@ -22711,6 +22789,9 @@ pub struct SqlDwSource { #[doc = "Value and type setting for stored procedure parameters. Example: \"{Parameter1: {value: \"1\", type: \"int\"}}\". Type: object (or Expression with resultType object), itemType: StoredProcedureParameter."] #[serde(rename = "storedProcedureParameters", default, skip_serializing_if = "Option::is_none")] pub stored_procedure_parameters: Option, + #[doc = "Specifies the transaction locking behavior for the SQL source. Allowed values: ReadCommitted/ReadUncommitted/RepeatableRead/Serializable/Snapshot. The default value is ReadCommitted. Type: string (or Expression with resultType string)."] + #[serde(rename = "isolationLevel", default, skip_serializing_if = "Option::is_none")] + pub isolation_level: Option, #[doc = "The partition mechanism that will be used for Sql read in parallel. Possible values include: \"None\", \"PhysicalPartitionsOfTable\", \"DynamicRange\"."] #[serde(rename = "partitionOption", default, skip_serializing_if = "Option::is_none")] pub partition_option: Option, @@ -22725,6 +22806,7 @@ impl SqlDwSource { sql_reader_query: None, sql_reader_stored_procedure_name: None, stored_procedure_parameters: None, + isolation_level: None, partition_option: None, partition_settings: None, } @@ -22845,6 +22927,9 @@ pub struct SqlMiSource { #[doc = "Value and type setting for stored procedure parameters. Example: \"{Parameter1: {value: \"1\", type: \"int\"}}\"."] #[serde(rename = "storedProcedureParameters", default, skip_serializing_if = "Option::is_none")] pub stored_procedure_parameters: Option, + #[doc = "Specifies the transaction locking behavior for the SQL source. Allowed values: ReadCommitted/ReadUncommitted/RepeatableRead/Serializable/Snapshot. The default value is ReadCommitted. Type: string (or Expression with resultType string)."] + #[serde(rename = "isolationLevel", default, skip_serializing_if = "Option::is_none")] + pub isolation_level: Option, #[doc = "Which additional types to produce."] #[serde(rename = "produceAdditionalTypes", default, skip_serializing_if = "Option::is_none")] pub produce_additional_types: Option, @@ -22862,6 +22947,7 @@ impl SqlMiSource { sql_reader_query: None, sql_reader_stored_procedure_name: None, stored_procedure_parameters: None, + isolation_level: None, produce_additional_types: None, partition_option: None, partition_settings: None, @@ -22954,9 +23040,9 @@ pub struct SqlServerLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, #[doc = "Sql always encrypted properties."] #[serde(rename = "alwaysEncryptedSettings", default, skip_serializing_if = "Option::is_none")] pub always_encrypted_settings: Option, @@ -23035,6 +23121,9 @@ pub struct SqlServerSource { #[doc = "Value and type setting for stored procedure parameters. Example: \"{Parameter1: {value: \"1\", type: \"int\"}}\"."] #[serde(rename = "storedProcedureParameters", default, skip_serializing_if = "Option::is_none")] pub stored_procedure_parameters: Option, + #[doc = "Specifies the transaction locking behavior for the SQL source. Allowed values: ReadCommitted/ReadUncommitted/RepeatableRead/Serializable/Snapshot. The default value is ReadCommitted. Type: string (or Expression with resultType string)."] + #[serde(rename = "isolationLevel", default, skip_serializing_if = "Option::is_none")] + pub isolation_level: Option, #[doc = "Which additional types to produce."] #[serde(rename = "produceAdditionalTypes", default, skip_serializing_if = "Option::is_none")] pub produce_additional_types: Option, @@ -23052,6 +23141,7 @@ impl SqlServerSource { sql_reader_query: None, sql_reader_stored_procedure_name: None, stored_procedure_parameters: None, + isolation_level: None, produce_additional_types: None, partition_option: None, partition_settings: None, @@ -23294,7 +23384,7 @@ pub struct SquareLinkedServiceTypeProperties { #[doc = "Properties used to connect to Square. It is mutually exclusive with any other properties in the linked service. Type: object."] #[serde(rename = "connectionProperties", default, skip_serializing_if = "Option::is_none")] pub connection_properties: Option, - #[doc = "The URL\u{a0}of the Square instance. (i.e. mystore.mysquare.com)"] + #[doc = "The URL of the Square instance. (i.e. mystore.mysquare.com)"] #[serde(default, skip_serializing_if = "Option::is_none")] pub host: Option, #[doc = "The client ID associated with your Square application."] @@ -23315,9 +23405,9 @@ pub struct SquareLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SquareLinkedServiceTypeProperties { pub fn new() -> Self { @@ -23935,9 +24025,9 @@ pub struct SybaseLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl SybaseLinkedServiceTypeProperties { pub fn new(server: serde_json::Value, database: serde_json::Value) -> Self { @@ -24075,9 +24165,18 @@ pub struct SynapseNotebookActivityTypeProperties { #[doc = "Number of core and memory to be used for driver allocated in the specified Spark pool for the session, which will be used for overriding 'driverCores' and 'driverMemory' of the notebook you provide. Type: string (or Expression with resultType string)."] #[serde(rename = "driverSize", default, skip_serializing_if = "Option::is_none")] pub driver_size: Option, - #[doc = "Number of executors to launch for this session, which will override the 'numExecutors' of the notebook you provide."] + #[doc = "Number of executors to launch for this session, which will override the 'numExecutors' of the notebook you provide. Type: integer (or Expression with resultType integer)."] #[serde(rename = "numExecutors", default, skip_serializing_if = "Option::is_none")] - pub num_executors: Option, + pub num_executors: Option, + #[doc = "The type of the spark config."] + #[serde(rename = "configurationType", default, skip_serializing_if = "Option::is_none")] + pub configuration_type: Option, + #[doc = "Spark configuration reference."] + #[serde(rename = "targetSparkConfiguration", default, skip_serializing_if = "Option::is_none")] + pub target_spark_configuration: Option, + #[doc = "Spark configuration property."] + #[serde(rename = "sparkConfig", default, skip_serializing_if = "Option::is_none")] + pub spark_config: Option, } impl SynapseNotebookActivityTypeProperties { pub fn new(notebook: SynapseNotebookReference) -> Self { @@ -24089,6 +24188,51 @@ impl SynapseNotebookActivityTypeProperties { conf: None, driver_size: None, num_executors: None, + configuration_type: None, + target_spark_configuration: None, + spark_config: None, + } + } +} +pub mod synapse_notebook_activity_type_properties { + use super::*; + #[doc = "The type of the spark config."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ConfigurationType")] + pub enum ConfigurationType { + Default, + Customized, + Artifact, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ConfigurationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ConfigurationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ConfigurationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ConfigurationType", 0u32, "Default"), + Self::Customized => serializer.serialize_unit_variant("ConfigurationType", 1u32, "Customized"), + Self::Artifact => serializer.serialize_unit_variant("ConfigurationType", 2u32, "Artifact"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } } @@ -24479,9 +24623,9 @@ pub struct TeamDeskLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken", default, skip_serializing_if = "Option::is_none")] pub api_token: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl TeamDeskLinkedServiceTypeProperties { pub fn new(authentication_type: team_desk_linked_service_type_properties::AuthenticationType, url: serde_json::Value) -> Self { @@ -24570,9 +24714,9 @@ pub struct TeradataLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(default, skip_serializing_if = "Option::is_none")] pub password: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl TeradataLinkedServiceTypeProperties { pub fn new() -> Self { @@ -25340,7 +25484,7 @@ impl TwilioLinkedService { #[doc = "Twilio linked service type properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwilioLinkedServiceTypeProperties { - #[doc = "The Account SID of Twilio service."] + #[doc = "The Account SID of Twilio service. Type: string (or Expression with resultType string)."] #[serde(rename = "userName")] pub user_name: serde_json::Value, #[doc = "The base definition of a secret type."] @@ -25400,7 +25544,7 @@ impl UntilActivity { pub struct UntilActivityTypeProperties { #[doc = "Azure Data Factory expression definition."] pub expression: Expression, - #[doc = "Specifies the timeout for the activity to run. If there is no value specified, it takes the value of TimeSpan.FromDays(7) which is 1 week as default. Type: string (or Expression with resultType string), pattern: ((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9])). Type: string (or Expression with resultType string), pattern: ((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))."] + #[doc = "Specifies the timeout for the activity to run. If there is no value specified, it takes the value of TimeSpan.FromDays(7) which is 1 week as default. Type: string (or Expression with resultType string), pattern: ((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))."] #[serde(default, skip_serializing_if = "Option::is_none")] pub timeout: Option, #[doc = "List of activities to execute."] @@ -25653,9 +25797,9 @@ pub struct VerticaLinkedServiceTypeProperties { #[doc = "Azure Key Vault secret reference."] #[serde(default, skip_serializing_if = "Option::is_none")] pub pwd: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl VerticaLinkedServiceTypeProperties { pub fn new() -> Self { @@ -25716,7 +25860,7 @@ impl WaitActivity { #[doc = "Wait activity properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct WaitActivityTypeProperties { - #[doc = "Duration in seconds."] + #[doc = "Duration in seconds. Type: integer (or Expression with resultType integer)."] #[serde(rename = "waitTimeInSeconds")] pub wait_time_in_seconds: serde_json::Value, } @@ -26190,9 +26334,9 @@ pub struct XeroLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl XeroLinkedServiceTypeProperties { pub fn new() -> Self { @@ -26367,9 +26511,9 @@ pub struct ZendeskLinkedServiceTypeProperties { #[doc = "The base definition of a secret type."] #[serde(rename = "apiToken", default, skip_serializing_if = "Option::is_none")] pub api_token: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ZendeskLinkedServiceTypeProperties { pub fn new(authentication_type: zendesk_linked_service_type_properties::AuthenticationType, url: serde_json::Value) -> Self { @@ -26478,9 +26622,9 @@ pub struct ZohoLinkedServiceTypeProperties { #[doc = "Specifies whether to verify the identity of the server when connecting over SSL. The default value is true."] #[serde(rename = "usePeerVerification", default, skip_serializing_if = "Option::is_none")] pub use_peer_verification: Option, - #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string)."] + #[doc = "The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string."] #[serde(rename = "encryptedCredential", default, skip_serializing_if = "Option::is_none")] - pub encrypted_credential: Option, + pub encrypted_credential: Option, } impl ZohoLinkedServiceTypeProperties { pub fn new() -> Self { diff --git a/services/mgmt/dataprotection/Cargo.toml b/services/mgmt/dataprotection/Cargo.toml index 3677db281d..f8d0f14a53 100644 --- a/services/mgmt/dataprotection/Cargo.toml +++ b/services/mgmt/dataprotection/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2023-05", "enable_reqwest"] +default = ["package-2023-01", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] -"package-2023-05" = [] "package-2023-01" = [] "package-2022-12" = [] "package-2022-05" = [] -"package-2022-04" = [] \ No newline at end of file +"package-2022-04" = [] +"package-2022-03" = [] \ No newline at end of file diff --git a/services/mgmt/dataprotection/README.md b/services/mgmt/dataprotection/README.md index 8d58660583..e13fbc530d 100644 --- a/services/mgmt/dataprotection/README.md +++ b/services/mgmt/dataprotection/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/dataprotec To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2023-05`. +The default tag is `package-2023-01`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: -- `package-2023-05` has 66 operations from 1 API versions: `2023-05-01`. Use crate feature `package-2023-05` to enable. The operations will be in the `package_2023_05` module. - `package-2023-01` has 66 operations from 1 API versions: `2023-01-01`. Use crate feature `package-2023-01` to enable. The operations will be in the `package_2023_01` module. - `package-2022-12` has 61 operations from 1 API versions: `2022-12-01`. Use crate feature `package-2022-12` to enable. The operations will be in the `package_2022_12` module. - `package-2022-05` has 58 operations from 1 API versions: `2022-05-01`. Use crate feature `package-2022-05` to enable. The operations will be in the `package_2022_05` module. -- `package-2022-04` has 58 operations from 1 API versions: `2022-04-01`. Use crate feature `package-2022-04` to enable. The operations will be in the `package_2022_04` module. \ No newline at end of file +- `package-2022-04` has 58 operations from 1 API versions: `2022-04-01`. Use crate feature `package-2022-04` to enable. The operations will be in the `package_2022_04` module. +- `package-2022-03` has 58 operations from 1 API versions: `2022-03-01`. Use crate feature `package-2022-03` to enable. The operations will be in the `package_2022_03` module. \ No newline at end of file diff --git a/services/mgmt/dataprotection/src/lib.rs b/services/mgmt/dataprotection/src/lib.rs index 1166843a67..a2aee03e3e 100644 --- a/services/mgmt/dataprotection/src/lib.rs +++ b/services/mgmt/dataprotection/src/lib.rs @@ -3,10 +3,6 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] -#[cfg(feature = "package-2023-05")] -pub mod package_2023_05; -#[cfg(all(feature = "package-2023-05", not(feature = "no-default-tag")))] -pub use package_2023_05::*; #[cfg(feature = "package-2023-01")] pub mod package_2023_01; #[cfg(all(feature = "package-2023-01", not(feature = "no-default-tag")))] @@ -23,3 +19,7 @@ pub use package_2022_05::*; pub mod package_2022_04; #[cfg(all(feature = "package-2022-04", not(feature = "no-default-tag")))] pub use package_2022_04::*; +#[cfg(feature = "package-2022-03")] +pub mod package_2022_03; +#[cfg(all(feature = "package-2022-03", not(feature = "no-default-tag")))] +pub use package_2022_03::*; diff --git a/services/mgmt/dataprotection/src/package_2023_05/mod.rs b/services/mgmt/dataprotection/src/package_2022_03/mod.rs similarity index 85% rename from services/mgmt/dataprotection/src/package_2023_05/mod.rs rename to services/mgmt/dataprotection/src/package_2022_03/mod.rs index 889710546d..2fbd714fa7 100644 --- a/services/mgmt/dataprotection/src/package_2023_05/mod.rs +++ b/services/mgmt/dataprotection/src/package_2022_03/mod.rs @@ -121,12 +121,6 @@ impl Client { pub fn data_protection_operations_client(&self) -> data_protection_operations::Client { data_protection_operations::Client(self.clone()) } - pub fn deleted_backup_instances_client(&self) -> deleted_backup_instances::Client { - deleted_backup_instances::Client(self.clone()) - } - pub fn dpp_resource_guard_proxy_client(&self) -> dpp_resource_guard_proxy::Client { - dpp_resource_guard_proxy::Client(self.clone()) - } pub fn export_jobs_client(&self) -> export_jobs::Client { export_jobs::Client(self.clone()) } @@ -165,7 +159,7 @@ pub mod backup_vaults { #[doc = "Returns resource collection belonging to a subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `subscription_id`: The subscription Id."] pub fn get_in_subscription(&self, subscription_id: impl Into) -> get_in_subscription::RequestBuilder { get_in_subscription::RequestBuilder { client: self.0.clone(), @@ -175,8 +169,8 @@ pub mod backup_vaults { #[doc = "Returns resource collection belonging to a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] pub fn get_in_resource_group( &self, resource_group_name: impl Into, @@ -191,8 +185,8 @@ pub mod backup_vaults { #[doc = "Returns a resource belonging to a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn get( &self, @@ -210,8 +204,8 @@ pub mod backup_vaults { #[doc = "Creates or updates a BackupVault resource belonging to a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `parameters`: Request body for operation"] pub fn create_or_update( @@ -232,8 +226,8 @@ pub mod backup_vaults { #[doc = "Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `parameters`: Request body for operation"] pub fn update( @@ -254,8 +248,8 @@ pub mod backup_vaults { #[doc = "Deletes a BackupVault resource from the resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn delete( &self, @@ -273,8 +267,8 @@ pub mod backup_vaults { #[doc = "API to check for resource name availability"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] #[doc = "* `location`: The location in which uniqueness will be verified."] #[doc = "* `parameters`: Check name availability request"] pub fn check_name_availability( @@ -364,7 +358,7 @@ pub mod backup_vaults { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -380,7 +374,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -473,7 +467,7 @@ pub mod backup_vaults { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -489,7 +483,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -581,7 +575,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -676,7 +670,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -772,7 +766,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -819,7 +813,6 @@ pub mod backup_vaults { pub(crate) vault_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -844,7 +837,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -926,7 +919,7 @@ pub mod backup_vaults { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -957,7 +950,7 @@ pub mod operation_result { #[doc = "Gets the operation result for a resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `subscription_id`: The subscription Id."] pub fn get( &self, subscription_id: impl Into, @@ -1021,7 +1014,7 @@ pub mod operation_result { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1038,7 +1031,7 @@ pub mod operation_status { #[doc = "Gets the operation status for a resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `subscription_id`: The subscription Id."] pub fn get( &self, subscription_id: impl Into, @@ -1125,7 +1118,7 @@ pub mod operation_status { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1154,8 +1147,8 @@ pub mod operation_status_backup_vault_context { #[doc = "Gets the operation status for an operation over a BackupVault's context."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn get( &self, @@ -1247,7 +1240,7 @@ pub mod operation_status_backup_vault_context { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1276,8 +1269,8 @@ pub mod operation_status_resource_group_context { #[doc = "Gets the operation status for an operation over a ResourceGroup's context."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] pub fn get( &self, resource_group_name: impl Into, @@ -1364,7 +1357,7 @@ pub mod operation_status_resource_group_context { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1391,8 +1384,8 @@ pub mod backup_vault_operation_results { pub struct Client(pub(crate) super::Client); impl Client { #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn get( &self, @@ -1503,7 +1496,7 @@ pub mod backup_vault_operation_results { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1532,7 +1525,7 @@ pub mod data_protection { #[doc = "Validates if a feature is supported"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `subscription_id`: The subscription Id."] #[doc = "* `parameters`: Feature support request object"] pub fn check_feature_support( &self, @@ -1619,7 +1612,7 @@ pub mod data_protection { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1718,7 +1711,7 @@ pub mod data_protection_operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1734,7 +1727,7 @@ pub mod data_protection_operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1762,8 +1755,8 @@ pub mod backup_policies { #[doc = "Returns list of backup policies belonging to a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn list( &self, @@ -1782,8 +1775,8 @@ pub mod backup_policies { #[doc = "Gets a backup policy belonging to a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn get( &self, @@ -1803,8 +1796,8 @@ pub mod backup_policies { #[doc = "Creates or Updates a backup policy belonging to a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `backup_policy_name`: Name of the policy"] #[doc = "* `parameters`: Request body for operation"] @@ -1828,8 +1821,8 @@ pub mod backup_policies { #[doc = "Deletes a backup policy belonging to a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn delete( &self, @@ -1922,7 +1915,7 @@ pub mod backup_policies { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1938,7 +1931,7 @@ pub mod backup_policies { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2032,7 +2025,7 @@ pub mod backup_policies { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2128,7 +2121,7 @@ pub mod backup_policies { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2201,7 +2194,7 @@ pub mod backup_policies { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2218,8 +2211,8 @@ pub mod backup_instances { #[doc = "Gets a backup instances belonging to a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn list( &self, @@ -2237,10 +2230,10 @@ pub mod backup_instances { #[doc = "Gets a backup instance with name in a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] pub fn get( &self, subscription_id: impl Into, @@ -2259,10 +2252,10 @@ pub mod backup_instances { #[doc = "Create or update a backup instance in a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] #[doc = "* `parameters`: Request body for operation"] pub fn create_or_update( &self, @@ -2284,10 +2277,10 @@ pub mod backup_instances { #[doc = "Delete a backup instance in a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] pub fn delete( &self, subscription_id: impl Into, @@ -2306,10 +2299,10 @@ pub mod backup_instances { #[doc = "Trigger adhoc backup "] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] #[doc = "* `parameters`: Request body for operation"] pub fn adhoc_backup( &self, @@ -2331,8 +2324,8 @@ pub mod backup_instances { #[doc = "Validate whether adhoc backup will be successful or not"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `parameters`: Request body for operation"] pub fn validate_for_backup( @@ -2353,10 +2346,9 @@ pub mod backup_instances { #[doc = "Get result of backup instance creation operation"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] pub fn get_backup_instance_operation_result( &self, subscription_id: impl Into, @@ -2377,11 +2369,10 @@ pub mod backup_instances { #[doc = "rehydrate recovery point for restore for a BackupInstance"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `parameters`: Request body for operation"] - #[doc = "* `backup_instance_name`: The name of the backup instance."] pub fn trigger_rehydrate( &self, resource_group_name: impl Into, @@ -2402,10 +2393,10 @@ pub mod backup_instances { #[doc = "Triggers restore for a BackupInstance"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] #[doc = "* `parameters`: Request body for operation"] pub fn trigger_restore( &self, @@ -2427,10 +2418,9 @@ pub mod backup_instances { #[doc = "This operation will resume backups for backup instance"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] pub fn resume_backups( &self, subscription_id: impl Into, @@ -2449,10 +2439,9 @@ pub mod backup_instances { #[doc = "This operation will resume protection for a stopped backup instance"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] pub fn resume_protection( &self, subscription_id: impl Into, @@ -2471,10 +2460,9 @@ pub mod backup_instances { #[doc = "This operation will stop protection of a backup instance and data will be held forever"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] pub fn stop_protection( &self, subscription_id: impl Into, @@ -2490,13 +2478,12 @@ pub mod backup_instances { backup_instance_name: backup_instance_name.into(), } } - #[doc = "This operation will stop backup for a backup instance and retains the backup data as per the policy (except latest Recovery point, which will be retained forever)"] + #[doc = "This operation will stop backups for backup instance"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] pub fn suspend_backups( &self, subscription_id: impl Into, @@ -2515,10 +2502,9 @@ pub mod backup_instances { #[doc = "Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] #[doc = "* `parameters`: Request body for operation"] pub fn sync_backup_instance( &self, @@ -2540,10 +2526,10 @@ pub mod backup_instances { #[doc = "Validates if Restore can be triggered for a DataSource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] #[doc = "* `parameters`: Request body for operation"] pub fn validate_for_restore( &self, @@ -2638,7 +2624,7 @@ pub mod backup_instances { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2654,7 +2640,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2748,7 +2734,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2860,7 +2846,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2934,7 +2920,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3031,7 +3017,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3146,7 +3132,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3236,7 +3222,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3303,7 +3289,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3401,7 +3387,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3468,7 +3454,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -3523,7 +3509,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -3578,7 +3564,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -3633,7 +3619,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -3689,7 +3675,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3787,7 +3773,7 @@ pub mod backup_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3817,10 +3803,10 @@ pub mod recovery_points { #[doc = "Returns a list of Recovery Points for a DataSource in a vault."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] pub fn list( &self, subscription_id: impl Into, @@ -3841,10 +3827,10 @@ pub mod recovery_points { #[doc = "Gets a Recovery Point using recoveryPointId for a Datasource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] pub fn get( &self, subscription_id: impl Into, @@ -3945,7 +3931,7 @@ pub mod recovery_points { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3961,7 +3947,7 @@ pub mod recovery_points { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -4055,7 +4041,7 @@ pub mod recovery_points { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4084,8 +4070,8 @@ pub mod jobs { #[doc = "Returns list of jobs belonging to a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn list( &self, @@ -4103,8 +4089,8 @@ pub mod jobs { #[doc = "Gets a job with id in a backup vault"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `job_id`: The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] pub fn get( @@ -4198,7 +4184,7 @@ pub mod jobs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4214,7 +4200,7 @@ pub mod jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -4308,7 +4294,7 @@ pub mod jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4335,10 +4321,10 @@ pub mod restorable_time_ranges { pub struct Client(pub(crate) super::Client); impl Client { #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the backup instance."] + #[doc = "* `backup_instance_name`: The name of the backup instance"] #[doc = "* `parameters`: Request body for operation"] pub fn find( &self, @@ -4426,7 +4412,7 @@ pub mod restorable_time_ranges { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -4457,8 +4443,8 @@ pub mod export_jobs { #[doc = "Triggers export of jobs and returns an OperationID to track."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] pub fn trigger( &self, @@ -4524,7 +4510,7 @@ pub mod export_jobs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -4542,8 +4528,8 @@ pub mod export_jobs_operation_result { #[doc = "Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] #[doc = "* `vault_name`: The name of the backup vault."] #[doc = "* `operation_id`: OperationID which represents the export job."] pub fn get( @@ -4629,7 +4615,7 @@ pub mod export_jobs_operation_result { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4651,445 +4637,202 @@ pub mod export_jobs_operation_result { } } } -pub mod deleted_backup_instances { +pub mod resource_guards { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets deleted backup instances belonging to a backup vault"] + #[doc = "Returns ResourceGuards collection belonging to a subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - pub fn list( + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_resources_in_subscription(&self, subscription_id: impl Into) -> get_resources_in_subscription::RequestBuilder { + get_resources_in_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Returns ResourceGuards collection belonging to a ResourceGroup."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + pub fn get_resources_in_resource_group( &self, subscription_id: impl Into, resource_group_name: impl Into, - vault_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + ) -> get_resources_in_resource_group::RequestBuilder { + get_resources_in_resource_group::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), } } - #[doc = "Gets a deleted backup instance with name in a backup vault"] + #[doc = "Returns a ResourceGuard belonging to a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the deleted backup instance"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_guards_name`: The name of ResourceGuard"] pub fn get( &self, - subscription_id: impl Into, resource_group_name: impl Into, - vault_name: impl Into, - backup_instance_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), - backup_instance_name: backup_instance_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), } } + #[doc = "Creates or updates a ResourceGuard resource belonging to a resource group."] + #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `backup_instance_name`: The name of the deleted backup instance"] - pub fn undelete( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_guards_name`: The name of ResourceGuard"] + #[doc = "* `parameters`: Request body for operation"] + pub fn put( &self, - subscription_id: impl Into, resource_group_name: impl Into, - vault_name: impl Into, - backup_instance_name: impl Into, - ) -> undelete::RequestBuilder { - undelete::RequestBuilder { + subscription_id: impl Into, + resource_guards_name: impl Into, + parameters: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), - backup_instance_name: backup_instance_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), + parameters: parameters.into(), } } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeletedBackupInstanceResourceList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + #[doc = "Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_guards_name`: The name of ResourceGuard"] + #[doc = "* `parameters`: Request body for operation"] + pub fn patch( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + parameters: impl Into, + ) -> patch::RequestBuilder { + patch::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), + parameters: parameters.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Deletes a ResourceGuard resource from the resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + #[doc = "* `resource_guards_name`: The name of ResourceGuard"] + pub fn delete( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_disable_soft_delete_requests_objects( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + ) -> get_disable_soft_delete_requests_objects::RequestBuilder { + get_disable_soft_delete_requests_objects::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/deletedBackupInstances" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) + #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_delete_resource_guard_proxy_requests_objects( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + ) -> get_delete_resource_guard_proxy_requests_objects::RequestBuilder { + get_delete_resource_guard_proxy_requests_objects::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), } } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DeletedBackupInstanceResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_backup_security_pin_requests_objects( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + ) -> get_backup_security_pin_requests_objects::RequestBuilder { + get_backup_security_pin_requests_objects::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - pub(crate) backup_instance_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/deletedBackupInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name , & this . backup_instance_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod undelete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - pub(crate) backup_instance_name: String, - } - impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/deletedBackupInstances/{}/undelete" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name , & this . backup_instance_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod resource_guards { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns ResourceGuards collection belonging to a subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_resources_in_subscription(&self, subscription_id: impl Into) -> get_resources_in_subscription::RequestBuilder { - get_resources_in_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Returns ResourceGuards collection belonging to a ResourceGroup."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - pub fn get_resources_in_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> get_resources_in_resource_group::RequestBuilder { - get_resources_in_resource_group::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - } - } - #[doc = "Returns a ResourceGuard belonging to a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_guards_name`: The name of ResourceGuard"] - pub fn get( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - } - } - #[doc = "Creates or updates a ResourceGuard resource belonging to a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_guards_name`: The name of ResourceGuard"] - #[doc = "* `parameters`: Request body for operation"] - pub fn put( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - parameters: impl Into, - ) -> put::RequestBuilder { - put::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_guards_name`: The name of ResourceGuard"] - #[doc = "* `parameters`: Request body for operation"] - pub fn patch( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - parameters: impl Into, - ) -> patch::RequestBuilder { - patch::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes a ResourceGuard resource from the resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_guards_name`: The name of ResourceGuard"] - pub fn delete( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), + #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_delete_protected_item_requests_objects( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + ) -> get_delete_protected_item_requests_objects::RequestBuilder { + get_delete_protected_item_requests_objects::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), } } #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_disable_soft_delete_requests_objects( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_update_protection_policy_requests_objects( &self, resource_group_name: impl Into, subscription_id: impl Into, resource_guards_name: impl Into, - ) -> get_disable_soft_delete_requests_objects::RequestBuilder { - get_disable_soft_delete_requests_objects::RequestBuilder { + ) -> get_update_protection_policy_requests_objects::RequestBuilder { + get_update_protection_policy_requests_objects::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), subscription_id: subscription_id.into(), @@ -5099,15 +4842,15 @@ pub mod resource_guards { #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_delete_resource_guard_proxy_requests_objects( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_update_protected_item_requests_objects( &self, resource_group_name: impl Into, subscription_id: impl Into, resource_guards_name: impl Into, - ) -> get_delete_resource_guard_proxy_requests_objects::RequestBuilder { - get_delete_resource_guard_proxy_requests_objects::RequestBuilder { + ) -> get_update_protected_item_requests_objects::RequestBuilder { + get_update_protected_item_requests_objects::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), subscription_id: subscription_id.into(), @@ -5117,760 +4860,131 @@ pub mod resource_guards { #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_backup_security_pin_requests_objects( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_default_disable_soft_delete_requests_object( &self, resource_group_name: impl Into, subscription_id: impl Into, resource_guards_name: impl Into, - ) -> get_backup_security_pin_requests_objects::RequestBuilder { - get_backup_security_pin_requests_objects::RequestBuilder { + request_name: impl Into, + ) -> get_default_disable_soft_delete_requests_object::RequestBuilder { + get_default_disable_soft_delete_requests_object::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), subscription_id: subscription_id.into(), resource_guards_name: resource_guards_name.into(), + request_name: request_name.into(), } } #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_delete_protected_item_requests_objects( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_default_delete_resource_guard_proxy_requests_object( &self, resource_group_name: impl Into, subscription_id: impl Into, resource_guards_name: impl Into, - ) -> get_delete_protected_item_requests_objects::RequestBuilder { - get_delete_protected_item_requests_objects::RequestBuilder { + request_name: impl Into, + ) -> get_default_delete_resource_guard_proxy_requests_object::RequestBuilder { + get_default_delete_resource_guard_proxy_requests_object::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), subscription_id: subscription_id.into(), resource_guards_name: resource_guards_name.into(), + request_name: request_name.into(), } } #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_update_protection_policy_requests_objects( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_default_backup_security_pin_requests_object( &self, resource_group_name: impl Into, subscription_id: impl Into, resource_guards_name: impl Into, - ) -> get_update_protection_policy_requests_objects::RequestBuilder { - get_update_protection_policy_requests_objects::RequestBuilder { + request_name: impl Into, + ) -> get_default_backup_security_pin_requests_object::RequestBuilder { + get_default_backup_security_pin_requests_object::RequestBuilder { client: self.0.clone(), resource_group_name: resource_group_name.into(), subscription_id: subscription_id.into(), resource_guards_name: resource_guards_name.into(), + request_name: request_name.into(), } } #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_update_protected_item_requests_objects( + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_default_delete_protected_item_requests_object( &self, resource_group_name: impl Into, subscription_id: impl Into, resource_guards_name: impl Into, - ) -> get_update_protected_item_requests_objects::RequestBuilder { - get_update_protected_item_requests_objects::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - } - } - #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_default_disable_soft_delete_requests_object( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - request_name: impl Into, - ) -> get_default_disable_soft_delete_requests_object::RequestBuilder { - get_default_disable_soft_delete_requests_object::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - request_name: request_name.into(), - } - } - #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_default_delete_resource_guard_proxy_requests_object( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - request_name: impl Into, - ) -> get_default_delete_resource_guard_proxy_requests_object::RequestBuilder { - get_default_delete_resource_guard_proxy_requests_object::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - request_name: request_name.into(), - } - } - #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_default_backup_security_pin_requests_object( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - request_name: impl Into, - ) -> get_default_backup_security_pin_requests_object::RequestBuilder { - get_default_backup_security_pin_requests_object::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - request_name: request_name.into(), - } - } - #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_default_delete_protected_item_requests_object( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - request_name: impl Into, - ) -> get_default_delete_protected_item_requests_object::RequestBuilder { - get_default_delete_protected_item_requests_object::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - request_name: request_name.into(), - } - } - #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_default_update_protection_policy_requests_object( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - request_name: impl Into, - ) -> get_default_update_protection_policy_requests_object::RequestBuilder { - get_default_update_protection_policy_requests_object::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - request_name: request_name.into(), - } - } - #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - pub fn get_default_update_protected_item_requests_object( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - resource_guards_name: impl Into, - request_name: impl Into, - ) -> get_default_update_protected_item_requests_object::RequestBuilder { - get_default_update_protected_item_requests_object::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - resource_guards_name: resource_guards_name.into(), - request_name: request_name.into(), - } - } - } - pub mod get_resources_in_subscription { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardResourceList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.DataProtection/resourceGuards", - this.client.endpoint(), - &this.subscription_id - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } - pub mod get_resources_in_resource_group { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardResourceList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.resource_guards_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod put { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, - pub(crate) parameters: models::ResourceGuardResource, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.resource_guards_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod patch { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, - pub(crate) parameters: models::PatchResourceGuardInput, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.resource_guards_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.resource_guards_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + request_name: impl Into, + ) -> get_default_delete_protected_item_requests_object::RequestBuilder { + get_default_delete_protected_item_requests_object::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), + request_name: request_name.into(), + } + } + #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_default_update_protection_policy_requests_object( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + request_name: impl Into, + ) -> get_default_update_protection_policy_requests_object::RequestBuilder { + get_default_update_protection_policy_requests_object::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), + request_name: request_name.into(), + } + } + #[doc = "Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group where the backup vault is present."] + #[doc = "* `subscription_id`: The subscription Id."] + pub fn get_default_update_protected_item_requests_object( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + resource_guards_name: impl Into, + request_name: impl Into, + ) -> get_default_update_protected_item_requests_object::RequestBuilder { + get_default_update_protected_item_requests_object::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + resource_guards_name: resource_guards_name.into(), + request_name: request_name.into(), } } } - pub mod get_disable_soft_delete_requests_objects { + pub mod get_resources_in_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; + let body: models::ResourceGuardResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5907,16 +5021,18 @@ pub mod resource_guards { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/disableSoftDeleteRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DataProtection/resourceGuards", + this.client.endpoint(), + &this.subscription_id + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -5933,7 +5049,7 @@ pub mod resource_guards { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5949,7 +5065,7 @@ pub mod resource_guards { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -5969,13 +5085,13 @@ pub mod resource_guards { } } } - pub mod get_delete_resource_guard_proxy_requests_objects { + pub mod get_resources_in_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; + let body: models::ResourceGuardResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6012,16 +5128,20 @@ pub mod resource_guards { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, + pub(crate) resource_group_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteResourceGuardProxyRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -6038,7 +5158,7 @@ pub mod resource_guards { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6054,7 +5174,7 @@ pub mod resource_guards { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -6074,13 +5194,13 @@ pub mod resource_guards { } } } - pub mod get_backup_security_pin_requests_objects { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; + let body: models::ResourceGuardResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6122,70 +5242,58 @@ pub mod resource_guards { pub(crate) resource_guards_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/getBackupSecurityPINRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_guards_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get_delete_protected_item_requests_objects { + pub mod put { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; + let body: models::ResourceGuardResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6225,72 +5333,62 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, + pub(crate) parameters: models::ResourceGuardResource, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteProtectedItemRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_guards_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get_update_protection_policy_requests_objects { + pub mod patch { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; + let body: models::ResourceGuardResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6330,66 +5428,114 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, + pub(crate) parameters: models::PatchResourceRequestInput, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectionPolicyRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_guards_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get_update_protected_item_requests_objects { + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_guards_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_disable_soft_delete_requests_objects { use super::models; pub struct Response(azure_core::Response); impl Response { @@ -6441,7 +5587,7 @@ pub mod resource_guards { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectedItemRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/disableSoftDeleteRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -6458,7 +5604,7 @@ pub mod resource_guards { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6474,7 +5620,7 @@ pub mod resource_guards { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -6494,101 +5640,13 @@ pub mod resource_guards { } } } - pub mod get_default_disable_soft_delete_requests_object { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) subscription_id: String, - pub(crate) resource_guards_name: String, - pub(crate) request_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/disableSoftDeleteRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_default_delete_resource_guard_proxy_requests_object { + pub mod get_delete_resource_guard_proxy_requests_objects { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6628,55 +5686,72 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, - pub(crate) request_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteResourceGuardProxyRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteResourceGuardProxyRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod get_default_backup_security_pin_requests_object { + pub mod get_backup_security_pin_requests_objects { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6716,55 +5791,72 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, - pub(crate) request_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/getBackupSecurityPINRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/getBackupSecurityPINRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod get_default_delete_protected_item_requests_object { + pub mod get_delete_protected_item_requests_objects { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6804,55 +5896,72 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, - pub(crate) request_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteProtectedItemRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteProtectedItemRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } - pub mod get_default_update_protection_policy_requests_object { + pub mod get_update_protection_policy_requests_objects { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6892,55 +6001,72 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, - pub(crate) request_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectionPolicyRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectionPolicyRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod get_default_update_protected_item_requests_object { + pub mod get_update_protected_item_requests_objects { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResourceList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6980,174 +6106,160 @@ pub mod resource_guards { pub(crate) resource_group_name: String, pub(crate) subscription_id: String, pub(crate) resource_guards_name: String, - pub(crate) request_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectedItemRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectedItemRequests" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } -} -pub mod dpp_resource_guard_proxy { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Returns the list of ResourceGuardProxies associated with the vault"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - vault_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), + pub mod get_default_disable_soft_delete_requests_object { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `resource_guard_proxy_name`: name of the resource guard proxy"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - vault_name: impl Into, - resource_guard_proxy_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), - resource_guard_proxy_name: resource_guard_proxy_name.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Creates or Updates a ResourceGuardProxy"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `resource_guard_proxy_name`: name of the resource guard proxy"] - #[doc = "* `parameters`: Request body for operation"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - vault_name: impl Into, - resource_guard_proxy_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), - resource_guard_proxy_name: resource_guard_proxy_name.into(), - parameters: parameters.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Deletes the ResourceGuardProxy"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `resource_guard_proxy_name`: name of the resource guard proxy"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - vault_name: impl Into, - resource_guard_proxy_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), - resource_guard_proxy_name: resource_guard_proxy_name.into(), + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + pub(crate) request_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/disableSoftDeleteRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } - #[doc = "UnlockDelete call for ResourceGuardProxy, executed before one can delete it"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `vault_name`: The name of the backup vault."] - #[doc = "* `resource_guard_proxy_name`: name of the resource guard proxy"] - #[doc = "* `parameters`: Request body for operation"] - pub fn unlock_delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - vault_name: impl Into, - resource_guard_proxy_name: impl Into, - parameters: impl Into, - ) -> unlock_delete::RequestBuilder { - unlock_delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - vault_name: vault_name.into(), - resource_guard_proxy_name: resource_guard_proxy_name.into(), - parameters: parameters.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list { + pub mod get_default_delete_resource_guard_proxy_requests_object { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardProxyBaseResourceList = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7184,75 +6296,58 @@ pub mod dpp_resource_guard_proxy { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) vault_name: String, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + pub(crate) request_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/backupResourceGuardProxies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteResourceGuardProxyRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod get_default_backup_security_pin_requests_object { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardProxyBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7289,10 +6384,10 @@ pub mod dpp_resource_guard_proxy { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - pub(crate) resource_guard_proxy_name: String, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + pub(crate) request_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7303,7 +6398,7 @@ pub mod dpp_resource_guard_proxy { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/backupResourceGuardProxies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name , & this . resource_guard_proxy_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/getBackupSecurityPINRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7313,7 +6408,7 @@ pub mod dpp_resource_guard_proxy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7322,8 +6417,8 @@ pub mod dpp_resource_guard_proxy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7334,13 +6429,13 @@ pub mod dpp_resource_guard_proxy { } } } - pub mod create_or_update { + pub mod get_default_delete_protected_item_requests_object { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ResourceGuardProxyBaseResource = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7377,11 +6472,10 @@ pub mod dpp_resource_guard_proxy { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - pub(crate) resource_guard_proxy_name: String, - pub(crate) parameters: models::ResourceGuardProxyBaseResource, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + pub(crate) request_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7392,8 +6486,8 @@ pub mod dpp_resource_guard_proxy { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/backupResourceGuardProxies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name , & this . resource_guard_proxy_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/deleteProtectedItemRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -7402,9 +6496,8 @@ pub mod dpp_resource_guard_proxy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -7412,8 +6505,8 @@ pub mod dpp_resource_guard_proxy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7424,9 +6517,32 @@ pub mod dpp_resource_guard_proxy { } } } - pub mod delete { + pub mod get_default_update_protection_policy_requests_object { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -7444,10 +6560,10 @@ pub mod dpp_resource_guard_proxy { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - pub(crate) resource_guard_proxy_name: String, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + pub(crate) request_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7458,8 +6574,8 @@ pub mod dpp_resource_guard_proxy { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/backupResourceGuardProxies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name , & this . resource_guard_proxy_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectionPolicyRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -7468,7 +6584,7 @@ pub mod dpp_resource_guard_proxy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7476,14 +6592,26 @@ pub mod dpp_resource_guard_proxy { }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod unlock_delete { + pub mod get_default_update_protected_item_requests_object { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UnlockDeleteResponse = serde_json::from_slice(&bytes)?; + let body: models::DppBaseResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7520,11 +6648,10 @@ pub mod dpp_resource_guard_proxy { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) vault_name: String, - pub(crate) resource_guard_proxy_name: String, - pub(crate) parameters: models::UnlockDeleteRequest, + pub(crate) subscription_id: String, + pub(crate) resource_guards_name: String, + pub(crate) request_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7535,8 +6662,8 @@ pub mod dpp_resource_guard_proxy { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/backupVaults/{}/backupResourceGuardProxies/{}/unlockDelete" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . vault_name , & this . resource_guard_proxy_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DataProtection/resourceGuards/{}/updateProtectedItemRequests/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_guards_name , & this . request_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -7545,9 +6672,8 @@ pub mod dpp_resource_guard_proxy { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -7555,8 +6681,8 @@ pub mod dpp_resource_guard_proxy { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] diff --git a/services/mgmt/dataprotection/src/package_2023_05/models.rs b/services/mgmt/dataprotection/src/package_2022_03/models.rs similarity index 79% rename from services/mgmt/dataprotection/src/package_2023_05/models.rs rename to services/mgmt/dataprotection/src/package_2022_03/models.rs index d4a959c273..c67c53e645 100644 --- a/services/mgmt/dataprotection/src/package_2023_05/models.rs +++ b/services/mgmt/dataprotection/src/package_2022_03/models.rs @@ -108,8 +108,6 @@ pub struct AzureBackupDiscreteRecoveryPoint { pub retention_tag_name: Option, #[serde(rename = "retentionTagVersion", default, skip_serializing_if = "Option::is_none")] pub retention_tag_version: Option, - #[serde(rename = "expiryTime", default, with = "azure_core::date::rfc3339::option")] - pub expiry_time: Option, } impl AzureBackupDiscreteRecoveryPoint { pub fn new(azure_backup_recovery_point: AzureBackupRecoveryPoint, recovery_point_time: time::OffsetDateTime) -> Self { @@ -124,7 +122,6 @@ impl AzureBackupDiscreteRecoveryPoint { recovery_point_type: None, retention_tag_name: None, retention_tag_version: None, - expiry_time: None, } } } @@ -583,7 +580,6 @@ pub mod azure_backup_restore_request { pub enum SourceDataStoreType { ArchiveStore, SnapshotStore, - OperationalStore, VaultStore, #[serde(skip_deserializing)] UnknownValue(String), @@ -612,8 +608,7 @@ pub mod azure_backup_restore_request { match self { Self::ArchiveStore => serializer.serialize_unit_variant("SourceDataStoreType", 0u32, "ArchiveStore"), Self::SnapshotStore => serializer.serialize_unit_variant("SourceDataStoreType", 1u32, "SnapshotStore"), - Self::OperationalStore => serializer.serialize_unit_variant("SourceDataStoreType", 2u32, "OperationalStore"), - Self::VaultStore => serializer.serialize_unit_variant("SourceDataStoreType", 3u32, "VaultStore"), + Self::VaultStore => serializer.serialize_unit_variant("SourceDataStoreType", 2u32, "VaultStore"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -668,56 +663,6 @@ impl AzureBackupRule { } } } -#[doc = "Settings for Azure Monitor based alerts"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureMonitorAlertSettings { - #[serde(rename = "alertsForAllJobFailures", default, skip_serializing_if = "Option::is_none")] - pub alerts_for_all_job_failures: Option, -} -impl AzureMonitorAlertSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod azure_monitor_alert_settings { - use super::*; - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "AlertsForAllJobFailures")] - pub enum AlertsForAllJobFailures { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for AlertsForAllJobFailures { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for AlertsForAllJobFailures { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for AlertsForAllJobFailures { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("AlertsForAllJobFailures", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("AlertsForAllJobFailures", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Parameters for Operational-Tier DataStore"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AzureOperationalStoreParameters { @@ -765,18 +710,6 @@ impl BackupCriteria { Self { object_type } } } -#[doc = "Parameters for Backup Datasource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BackupDatasourceParameters { - #[doc = "Type of the specific object - used for deserializing"] - #[serde(rename = "objectType")] - pub object_type: String, -} -impl BackupDatasourceParameters { - pub fn new(object_type: String) -> Self { - Self { object_type } - } -} #[doc = "Backup Instance"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupInstance { @@ -937,7 +870,7 @@ pub mod backup_instance { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct BackupInstanceResource { #[serde(flatten)] - pub dpp_proxy_resource: DppProxyResource, + pub dpp_resource: DppResource, #[doc = "Backup Instance"] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -1021,9 +954,6 @@ impl BackupSchedule { #[doc = "Backup Vault"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BackupVault { - #[doc = "Monitoring Settings"] - #[serde(rename = "monitoringSettings", default, skip_serializing_if = "Option::is_none")] - pub monitoring_settings: Option, #[doc = "Provisioning state of the BackupVault resource"] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1033,30 +963,17 @@ pub struct BackupVault { #[doc = "ResourceMoveDetails will be returned in response to GetResource call from ARM"] #[serde(rename = "resourceMoveDetails", default, skip_serializing_if = "Option::is_none")] pub resource_move_details: Option, - #[doc = "Class containing security settings of vault"] - #[serde(rename = "securitySettings", default, skip_serializing_if = "Option::is_none")] - pub security_settings: Option, #[doc = "Storage Settings"] #[serde(rename = "storageSettings")] pub storage_settings: Vec, - #[doc = "Is vault protected by resource guard"] - #[serde(rename = "isVaultProtectedByResourceGuard", default, skip_serializing_if = "Option::is_none")] - pub is_vault_protected_by_resource_guard: Option, - #[doc = "Class containing feature settings of vault"] - #[serde(rename = "featureSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_settings: Option, } impl BackupVault { pub fn new(storage_settings: Vec) -> Self { Self { - monitoring_settings: None, provisioning_state: None, resource_move_state: None, resource_move_details: None, - security_settings: None, storage_settings, - is_vault_protected_by_resource_guard: None, - feature_settings: None, } } } @@ -1266,23 +1183,6 @@ impl BasePolicyRule { Self { name, object_type } } } -#[doc = "Parameters to be used during configuration of backup of blobs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlobBackupDatasourceParameters { - #[serde(flatten)] - pub backup_datasource_parameters: BackupDatasourceParameters, - #[doc = "List of containers to be backed up during configuration of backup of blobs"] - #[serde(rename = "containersList")] - pub containers_list: Vec, -} -impl BlobBackupDatasourceParameters { - pub fn new(backup_datasource_parameters: BackupDatasourceParameters, containers_list: Vec) -> Self { - Self { - backup_datasource_parameters, - containers_list, - } - } -} #[doc = "CheckNameAvailability Request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CheckNameAvailabilityRequest { @@ -1474,60 +1374,6 @@ impl CopyOption { Self { object_type } } } -#[doc = "CrossSubscriptionRestore Settings"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CrossSubscriptionRestoreSettings { - #[doc = "CrossSubscriptionRestore state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, -} -impl CrossSubscriptionRestoreSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod cross_subscription_restore_settings { - use super::*; - #[doc = "CrossSubscriptionRestore state"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "State")] - pub enum State { - Disabled, - PermanentlyDisabled, - Enabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for State { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for State { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for State { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("State", 0u32, "Disabled"), - Self::PermanentlyDisabled => serializer.serialize_unit_variant("State", 1u32, "PermanentlyDisabled"), - Self::Enabled => serializer.serialize_unit_variant("State", 2u32, "Enabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Duration based custom options to copy"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomCopyOption { @@ -1770,82 +1616,6 @@ impl DeleteOption { Self { duration, object_type } } } -#[doc = "Deleted Backup Instance"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeletedBackupInstance { - #[serde(flatten)] - pub backup_instance: BackupInstance, - #[doc = "Deletion Info"] - #[serde(rename = "deletionInfo", default, skip_serializing_if = "Option::is_none")] - pub deletion_info: Option, -} -impl DeletedBackupInstance { - pub fn new(backup_instance: BackupInstance) -> Self { - Self { - backup_instance, - deletion_info: None, - } - } -} -#[doc = "Deleted Backup Instance"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeletedBackupInstanceResource { - #[serde(flatten)] - pub dpp_resource: DppResource, - #[doc = "Deleted Backup Instance"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl DeletedBackupInstanceResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "List of DeletedBackupInstance resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeletedBackupInstanceResourceList { - #[serde(flatten)] - pub dpp_resource_list: DppResourceList, - #[doc = "List of resources."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for DeletedBackupInstanceResourceList { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl DeletedBackupInstanceResourceList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Deletion Info"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DeletionInfo { - #[doc = "Specifies time of deletion"] - #[serde(rename = "deletionTime", default, skip_serializing_if = "Option::is_none")] - pub deletion_time: Option, - #[doc = "Specifies billing end date"] - #[serde(rename = "billingEndDate", default, skip_serializing_if = "Option::is_none")] - pub billing_end_date: Option, - #[doc = "Specifies purge time"] - #[serde(rename = "scheduledPurgeTime", default, skip_serializing_if = "Option::is_none")] - pub scheduled_purge_time: Option, - #[doc = "Delete activity ID for troubleshooting purpose"] - #[serde(rename = "deleteActivityID", default, skip_serializing_if = "Option::is_none")] - pub delete_activity_id: Option, -} -impl DeletionInfo { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Base resource under Microsoft.DataProtection provider namespace"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DppBaseResource { @@ -1889,35 +1659,6 @@ impl DppBaseResourceList { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DppBaseTrackedResource { - #[doc = "Optional ETag."] - #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] - pub e_tag: Option, - #[doc = "Resource Id represents the complete path to the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource location."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Resource name associated with the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/..."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl DppBaseTrackedResource { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Identity details"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DppIdentityDetails { @@ -1936,29 +1677,6 @@ impl DppIdentityDetails { Self::default() } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DppProxyResource { - #[doc = "Proxy Resource Id represents the complete path to the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Proxy Resource name associated with the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Proxy Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/..."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Proxy Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl DppProxyResource { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Resource class"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DppResource { @@ -1994,11 +1712,30 @@ impl DppResourceList { } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct DppTrackedResource { - #[serde(flatten)] - pub dpp_base_tracked_resource: DppBaseTrackedResource, + #[doc = "Optional ETag."] + #[serde(rename = "eTag", default, skip_serializing_if = "Option::is_none")] + pub e_tag: Option, + #[doc = "Resource Id represents the complete path to the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, #[doc = "Identity details"] #[serde(default, skip_serializing_if = "Option::is_none")] pub identity: Option, + #[doc = "Resource location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Resource name associated with the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/..."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, } impl DppTrackedResource { pub fn new() -> Self { @@ -2112,18 +1849,6 @@ impl ExportJobsResult { Self::default() } } -#[doc = "Class containing feature settings of vault"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FeatureSettings { - #[doc = "CrossSubscriptionRestore Settings"] - #[serde(rename = "crossSubscriptionRestoreSettings", default, skip_serializing_if = "Option::is_none")] - pub cross_subscription_restore_settings: Option, -} -impl FeatureSettings { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Base class for feature object"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FeatureValidationRequest { @@ -2285,60 +2010,6 @@ impl ImmediateCopyOption { Self { copy_option } } } -#[doc = "Immutability Settings at vault level"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ImmutabilitySettings { - #[doc = "Immutability state"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, -} -impl ImmutabilitySettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod immutability_settings { - use super::*; - #[doc = "Immutability state"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "State")] - pub enum State { - Disabled, - Unlocked, - Locked, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for State { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for State { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for State { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("State", 0u32, "Disabled"), - Self::Unlocked => serializer.serialize_unit_variant("State", 1u32, "Unlocked"), - Self::Locked => serializer.serialize_unit_variant("State", 2u32, "Locked"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Inner Error"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct InnerError { @@ -2402,36 +2073,6 @@ impl ItemLevelRestoreTargetInfo { } } } -#[doc = "Prefix criteria to be used to during restore"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ItemPathBasedRestoreCriteria { - #[serde(flatten)] - pub item_level_restore_criteria: ItemLevelRestoreCriteria, - #[doc = "The path of the item to be restored. It could be the full path of the item or the path relative to the backup item"] - #[serde(rename = "itemPath")] - pub item_path: String, - #[doc = "Flag to specify if the path is relative to backup item or full path"] - #[serde(rename = "isPathRelativeToBackupItem")] - pub is_path_relative_to_backup_item: bool, - #[doc = "The list of prefix strings to be used as filter criteria during restore. These are relative to the item path specified."] - #[serde( - rename = "subItemPathPrefix", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub sub_item_path_prefix: Vec, -} -impl ItemPathBasedRestoreCriteria { - pub fn new(item_level_restore_criteria: ItemLevelRestoreCriteria, item_path: String, is_path_relative_to_backup_item: bool) -> Self { - Self { - item_level_restore_criteria, - item_path, - is_path_relative_to_backup_item, - sub_item_path_prefix: Vec::new(), - } - } -} #[doc = "Extended Information about the job"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct JobExtendedInfo { @@ -2495,250 +2136,7 @@ impl JobSubTask { } } } -#[doc = "Parameters for Kubernetes Cluster Backup Datasource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesClusterBackupDatasourceParameters { - #[serde(flatten)] - pub backup_datasource_parameters: BackupDatasourceParameters, - #[doc = "Gets or sets the volume snapshot property. This property if enabled will take volume snapshots during backup."] - #[serde(rename = "snapshotVolumes")] - pub snapshot_volumes: bool, - #[doc = "Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources during backup."] - #[serde(rename = "includeClusterScopeResources")] - pub include_cluster_scope_resources: bool, - #[doc = "Gets or sets the include namespaces property. This property sets the namespaces to be included during backup."] - #[serde( - rename = "includedNamespaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub included_namespaces: Vec, - #[doc = "Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during backup."] - #[serde( - rename = "excludedNamespaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_namespaces: Vec, - #[doc = "Gets or sets the include resource types property. This property sets the resource types to be included during backup."] - #[serde( - rename = "includedResourceTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub included_resource_types: Vec, - #[doc = "Gets or sets the exclude resource types property. This property sets the resource types to be excluded during backup."] - #[serde( - rename = "excludedResourceTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_resource_types: Vec, - #[doc = "Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during backup."] - #[serde( - rename = "labelSelectors", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub label_selectors: Vec, - #[doc = "Gets or sets the backup hook references. This property sets the hook reference to be executed during backup."] - #[serde( - rename = "backupHookReferences", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub backup_hook_references: Vec, -} -impl KubernetesClusterBackupDatasourceParameters { - pub fn new( - backup_datasource_parameters: BackupDatasourceParameters, - snapshot_volumes: bool, - include_cluster_scope_resources: bool, - ) -> Self { - Self { - backup_datasource_parameters, - snapshot_volumes, - include_cluster_scope_resources, - included_namespaces: Vec::new(), - excluded_namespaces: Vec::new(), - included_resource_types: Vec::new(), - excluded_resource_types: Vec::new(), - label_selectors: Vec::new(), - backup_hook_references: Vec::new(), - } - } -} -#[doc = "kubernetes Cluster Backup target info for restore operation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesClusterRestoreCriteria { - #[serde(flatten)] - pub item_level_restore_criteria: ItemLevelRestoreCriteria, - #[doc = "Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources during restore."] - #[serde(rename = "includeClusterScopeResources")] - pub include_cluster_scope_resources: bool, - #[doc = "Gets or sets the include namespaces property. This property sets the namespaces to be included during restore."] - #[serde( - rename = "includedNamespaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub included_namespaces: Vec, - #[doc = "Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during restore."] - #[serde( - rename = "excludedNamespaces", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_namespaces: Vec, - #[doc = "Gets or sets the include resource types property. This property sets the resource types to be included during restore."] - #[serde( - rename = "includedResourceTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub included_resource_types: Vec, - #[doc = "Gets or sets the exclude resource types property. This property sets the resource types to be excluded during restore."] - #[serde( - rename = "excludedResourceTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_resource_types: Vec, - #[doc = "Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during restore."] - #[serde( - rename = "labelSelectors", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub label_selectors: Vec, - #[doc = "Gets or sets the PV (Persistent Volume) Restore Mode property. This property sets whether volumes needs to be restored."] - #[serde(rename = "persistentVolumeRestoreMode", default, skip_serializing_if = "Option::is_none")] - pub persistent_volume_restore_mode: Option, - #[doc = "Gets or sets the Conflict Policy property. This property sets policy during conflict of resources during restore."] - #[serde(rename = "conflictPolicy", default, skip_serializing_if = "Option::is_none")] - pub conflict_policy: Option, - #[doc = "Gets or sets the Namespace Mappings property. This property sets if namespace needs to be change during restore."] - #[serde(rename = "namespaceMappings", default, skip_serializing_if = "Option::is_none")] - pub namespace_mappings: Option, - #[doc = "Gets or sets the restore hook references. This property sets the hook reference to be executed during restore."] - #[serde( - rename = "restoreHookReferences", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub restore_hook_references: Vec, -} -impl KubernetesClusterRestoreCriteria { - pub fn new(item_level_restore_criteria: ItemLevelRestoreCriteria, include_cluster_scope_resources: bool) -> Self { - Self { - item_level_restore_criteria, - include_cluster_scope_resources, - included_namespaces: Vec::new(), - excluded_namespaces: Vec::new(), - included_resource_types: Vec::new(), - excluded_resource_types: Vec::new(), - label_selectors: Vec::new(), - persistent_volume_restore_mode: None, - conflict_policy: None, - namespace_mappings: None, - restore_hook_references: Vec::new(), - } - } -} -pub mod kubernetes_cluster_restore_criteria { - use super::*; - #[doc = "Gets or sets the PV (Persistent Volume) Restore Mode property. This property sets whether volumes needs to be restored."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "PersistentVolumeRestoreMode")] - pub enum PersistentVolumeRestoreMode { - RestoreWithVolumeData, - RestoreWithoutVolumeData, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for PersistentVolumeRestoreMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for PersistentVolumeRestoreMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for PersistentVolumeRestoreMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::RestoreWithVolumeData => { - serializer.serialize_unit_variant("PersistentVolumeRestoreMode", 0u32, "RestoreWithVolumeData") - } - Self::RestoreWithoutVolumeData => { - serializer.serialize_unit_variant("PersistentVolumeRestoreMode", 1u32, "RestoreWithoutVolumeData") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Gets or sets the Conflict Policy property. This property sets policy during conflict of resources during restore."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ConflictPolicy")] - pub enum ConflictPolicy { - Skip, - Patch, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ConflictPolicy { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ConflictPolicy { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ConflictPolicy { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Skip => serializer.serialize_unit_variant("ConflictPolicy", 0u32, "Skip"), - Self::Patch => serializer.serialize_unit_variant("ConflictPolicy", 1u32, "Patch"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Item Level kubernetes persistent volume target info for restore operation"] +#[doc = "Item Level kubernetes persistent volume target info for restore operation"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct KubernetesPvRestoreCriteria { #[serde(flatten)] @@ -2780,33 +2178,6 @@ impl KubernetesStorageClassRestoreCriteria { } } } -#[doc = "Monitoring Settings"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MonitoringSettings { - #[doc = "Settings for Azure Monitor based alerts"] - #[serde(rename = "azureMonitorAlertSettings", default, skip_serializing_if = "Option::is_none")] - pub azure_monitor_alert_settings: Option, -} -impl MonitoringSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Class to refer resources which contains namespace and name"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NamespacedNameResource { - #[doc = "Name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Namespace in which the resource exists"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, -} -impl NamespacedNameResource { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Operation Extended Info"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationExtendedInfo { @@ -2865,45 +2236,12 @@ impl OperationResource { Self::default() } } -#[doc = "Backup Vault Contract for Patch Backup Vault API."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PatchBackupVaultInput { - #[doc = "Monitoring Settings"] - #[serde(rename = "monitoringSettings", default, skip_serializing_if = "Option::is_none")] - pub monitoring_settings: Option, - #[doc = "Class containing security settings of vault"] - #[serde(rename = "securitySettings", default, skip_serializing_if = "Option::is_none")] - pub security_settings: Option, - #[doc = "Class containing feature settings of vault"] - #[serde(rename = "featureSettings", default, skip_serializing_if = "Option::is_none")] - pub feature_settings: Option, -} -impl PatchBackupVaultInput { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Patch Request content for Microsoft.DataProtection Resource Guard resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PatchResourceGuardInput { - #[doc = "Resource Guard tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl PatchResourceGuardInput { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Patch Request content for Microsoft.DataProtection resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PatchResourceRequestInput { #[doc = "Identity details"] #[serde(default, skip_serializing_if = "Option::is_none")] pub identity: Option, - #[doc = "Backup Vault Contract for Patch Backup Vault API."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, #[doc = "Resource tags."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option, @@ -2944,14 +2282,6 @@ pub struct PolicyParameters { skip_serializing_if = "Vec::is_empty" )] pub data_store_parameters_list: Vec, - #[doc = "Gets or sets the Backup Data Source Parameters"] - #[serde( - rename = "backupDatasourceParametersList", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub backup_datasource_parameters_list: Vec, } impl PolicyParameters { pub fn new() -> Self { @@ -3272,83 +2602,10 @@ impl ResourceGuardOperation { Self::default() } } -#[doc = "VaultCritical Operation protected by a resource guard"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceGuardOperationDetail { - #[serde(rename = "vaultCriticalOperation", default, skip_serializing_if = "Option::is_none")] - pub vault_critical_operation: Option, - #[serde(rename = "defaultResourceRequest", default, skip_serializing_if = "Option::is_none")] - pub default_resource_request: Option, -} -impl ResourceGuardOperationDetail { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "ResourceGuardProxyBase object, used in ResourceGuardProxyBaseResource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceGuardProxyBase { - #[serde(rename = "resourceGuardResourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_guard_resource_id: Option, - #[serde( - rename = "resourceGuardOperationDetails", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub resource_guard_operation_details: Vec, - #[serde(rename = "lastUpdatedTime", default, skip_serializing_if = "Option::is_none")] - pub last_updated_time: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl ResourceGuardProxyBase { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "ResourceGuardProxyBaseResource object, used for response and request bodies for ResourceGuardProxy APIs"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceGuardProxyBaseResource { - #[serde(flatten)] - pub dpp_resource: DppResource, - #[doc = "ResourceGuardProxyBase object, used in ResourceGuardProxyBaseResource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ResourceGuardProxyBaseResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "List of ResourceGuardProxyBase resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceGuardProxyBaseResourceList { - #[serde(flatten)] - pub dpp_resource_list: DppResourceList, - #[doc = "List of resources."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl azure_core::Continuable for ResourceGuardProxyBaseResourceList { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ResourceGuardProxyBaseResourceList { - pub fn new() -> Self { - Self::default() - } -} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ResourceGuardResource { #[serde(flatten)] - pub dpp_base_tracked_resource: DppBaseTrackedResource, + pub dpp_tracked_resource: DppTrackedResource, #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -3727,78 +2984,6 @@ pub mod secret_store_resource { } } } -#[doc = "Class containing security settings of vault"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecuritySettings { - #[doc = "Soft delete related settings"] - #[serde(rename = "softDeleteSettings", default, skip_serializing_if = "Option::is_none")] - pub soft_delete_settings: Option, - #[doc = "Immutability Settings at vault level"] - #[serde(rename = "immutabilitySettings", default, skip_serializing_if = "Option::is_none")] - pub immutability_settings: Option, -} -impl SecuritySettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Soft delete related settings"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SoftDeleteSettings { - #[doc = "State of soft delete"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "Soft delete retention duration"] - #[serde(rename = "retentionDurationInDays", default, skip_serializing_if = "Option::is_none")] - pub retention_duration_in_days: Option, -} -impl SoftDeleteSettings { - pub fn new() -> Self { - Self::default() - } -} -pub mod soft_delete_settings { - use super::*; - #[doc = "State of soft delete"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "State")] - pub enum State { - Off, - On, - AlwaysOn, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for State { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for State { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for State { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Off => serializer.serialize_unit_variant("State", 0u32, "Off"), - Self::On => serializer.serialize_unit_variant("State", 1u32, "On"), - Self::AlwaysOn => serializer.serialize_unit_variant("State", 2u32, "AlwaysOn"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} #[doc = "Source LifeCycle"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SourceLifeCycle { @@ -3847,7 +3032,7 @@ pub mod storage_setting { #[serde(remote = "DatastoreType")] pub enum DatastoreType { ArchiveStore, - OperationalStore, + SnapshotStore, VaultStore, #[serde(skip_deserializing)] UnknownValue(String), @@ -3875,7 +3060,7 @@ pub mod storage_setting { { match self { Self::ArchiveStore => serializer.serialize_unit_variant("DatastoreType", 0u32, "ArchiveStore"), - Self::OperationalStore => serializer.serialize_unit_variant("DatastoreType", 1u32, "OperationalStore"), + Self::SnapshotStore => serializer.serialize_unit_variant("DatastoreType", 1u32, "SnapshotStore"), Self::VaultStore => serializer.serialize_unit_variant("DatastoreType", 2u32, "VaultStore"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } @@ -3887,7 +3072,6 @@ pub mod storage_setting { pub enum Type { GeoRedundant, LocallyRedundant, - ZoneRedundant, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3915,7 +3099,6 @@ pub mod storage_setting { match self { Self::GeoRedundant => serializer.serialize_unit_variant("Type", 0u32, "GeoRedundant"), Self::LocallyRedundant => serializer.serialize_unit_variant("Type", 1u32, "LocallyRedundant"), - Self::ZoneRedundant => serializer.serialize_unit_variant("Type", 2u32, "ZoneRedundant"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4100,9 +3283,6 @@ pub struct TargetDetails { pub restore_target_location_type: target_details::RestoreTargetLocationType, #[doc = "Url denoting the restore destination. It can point to container / file share etc"] pub url: String, - #[doc = "Full ARM Id denoting the restore destination. It is the ARM Id pointing to container / file share\r\nThis is optional if the target subscription can be identified with the URL field. If not\r\nthen this is needed if CrossSubscriptionRestore field of BackupVault is in any of the disabled states"] - #[serde(rename = "targetResourceArmId", default, skip_serializing_if = "Option::is_none")] - pub target_resource_arm_id: Option, } impl TargetDetails { pub fn new(file_prefix: String, restore_target_location_type: target_details::RestoreTargetLocationType, url: String) -> Self { @@ -4110,7 +3290,6 @@ impl TargetDetails { file_prefix, restore_target_location_type, url, - target_resource_arm_id: None, } } } @@ -4180,36 +3359,6 @@ impl TriggerContext { Self { object_type } } } -#[doc = "Request body of unlock delete API."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UnlockDeleteRequest { - #[serde( - rename = "resourceGuardOperationRequests", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub resource_guard_operation_requests: Vec, - #[serde(rename = "resourceToBeDeleted", default, skip_serializing_if = "Option::is_none")] - pub resource_to_be_deleted: Option, -} -impl UnlockDeleteRequest { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Response of Unlock Delete API."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct UnlockDeleteResponse { - #[doc = "This is the time when unlock delete privileges will get expired."] - #[serde(rename = "unlockDeleteExpiryTime", default, skip_serializing_if = "Option::is_none")] - pub unlock_delete_expiry_time: Option, -} -impl UnlockDeleteResponse { - pub fn new() -> Self { - Self::default() - } -} #[doc = "Error object used by layers that have access to localized content, and propagate that to user"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserFacingError { @@ -4296,7 +3445,7 @@ pub struct SystemData { #[doc = "The type of identity that last modified the resource."] #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] + #[doc = "The type of identity that last modified the resource."] #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] pub last_modified_at: Option, } diff --git a/services/mgmt/devcenter/Cargo.toml b/services/mgmt/devcenter/Cargo.toml index eaed66c71e..483077a7cc 100644 --- a/services/mgmt/devcenter/Cargo.toml +++ b/services/mgmt/devcenter/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-01", "enable_reqwest"] +default = ["package-2023-04", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] "package-preview-2023-01" = [] "package-preview-2022-11" = [] "package-preview-2022-10" = [] -"package-2022-09-01-preview" = [] -"package-2022-08-01-preview" = [] \ No newline at end of file +"package-2023-04" = [] +"package-2022-09-01-preview" = [] \ No newline at end of file diff --git a/services/mgmt/devcenter/README.md b/services/mgmt/devcenter/README.md index 550a4981ec..c4ebbe2a01 100644 --- a/services/mgmt/devcenter/README.md +++ b/services/mgmt/devcenter/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/devcenter/ To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-01`. +The default tag is `package-2023-04`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: - `package-preview-2023-01` has 77 operations from 1 API versions: `2023-01-01-preview`. Use crate feature `package-preview-2023-01` to enable. The operations will be in the `package_preview_2023_01` module. - `package-preview-2022-11` has 76 operations from 1 API versions: `2022-11-11-preview`. Use crate feature `package-preview-2022-11` to enable. The operations will be in the `package_preview_2022_11` module. - `package-preview-2022-10` has 75 operations from 1 API versions: `2022-10-12-preview`. Use crate feature `package-preview-2022-10` to enable. The operations will be in the `package_preview_2022_10` module. -- `package-2022-09-01-preview` has 75 operations from 1 API versions: `2022-09-01-preview`. Use crate feature `package-2022-09-01-preview` to enable. The operations will be in the `package_2022_09_01_preview` module. -- `package-2022-08-01-preview` has 73 operations from 1 API versions: `2022-08-01-preview`. Use crate feature `package-2022-08-01-preview` to enable. The operations will be in the `package_2022_08_01_preview` module. \ No newline at end of file +- `package-2023-04` has 78 operations from 1 API versions: `2023-04-01`. Use crate feature `package-2023-04` to enable. The operations will be in the `package_2023_04` module. +- `package-2022-09-01-preview` has 75 operations from 1 API versions: `2022-09-01-preview`. Use crate feature `package-2022-09-01-preview` to enable. The operations will be in the `package_2022_09_01_preview` module. \ No newline at end of file diff --git a/services/mgmt/devcenter/src/lib.rs b/services/mgmt/devcenter/src/lib.rs index 410e8a3f94..d2f8509cea 100644 --- a/services/mgmt/devcenter/src/lib.rs +++ b/services/mgmt/devcenter/src/lib.rs @@ -15,11 +15,11 @@ pub use package_preview_2022_11::*; pub mod package_preview_2022_10; #[cfg(all(feature = "package-preview-2022-10", not(feature = "no-default-tag")))] pub use package_preview_2022_10::*; +#[cfg(feature = "package-2023-04")] +pub mod package_2023_04; +#[cfg(all(feature = "package-2023-04", not(feature = "no-default-tag")))] +pub use package_2023_04::*; #[cfg(feature = "package-2022-09-01-preview")] pub mod package_2022_09_01_preview; #[cfg(all(feature = "package-2022-09-01-preview", not(feature = "no-default-tag")))] pub use package_2022_09_01_preview::*; -#[cfg(feature = "package-2022-08-01-preview")] -pub mod package_2022_08_01_preview; -#[cfg(all(feature = "package-2022-08-01-preview", not(feature = "no-default-tag")))] -pub use package_2022_08_01_preview::*; diff --git a/services/mgmt/devcenter/src/package_2022_08_01_preview/mod.rs b/services/mgmt/devcenter/src/package_2023_04/mod.rs similarity index 90% rename from services/mgmt/devcenter/src/package_2022_08_01_preview/mod.rs rename to services/mgmt/devcenter/src/package_2023_04/mod.rs index a2f96b3d54..2cd05cb7fd 100644 --- a/services/mgmt/devcenter/src/package_2022_08_01_preview/mod.rs +++ b/services/mgmt/devcenter/src/package_2023_04/mod.rs @@ -109,6 +109,9 @@ impl Client { pub fn catalogs_client(&self) -> catalogs::Client { catalogs::Client(self.clone()) } + pub fn check_name_availability_client(&self) -> check_name_availability::Client { + check_name_availability::Client(self.clone()) + } pub fn dev_box_definitions_client(&self) -> dev_box_definitions::Client { dev_box_definitions::Client(self.clone()) } @@ -139,6 +142,9 @@ impl Client { pub fn pools_client(&self) -> pools::Client { pools::Client(self.clone()) } + pub fn project_allowed_environment_types_client(&self) -> project_allowed_environment_types::Client { + project_allowed_environment_types::Client(self.clone()) + } pub fn project_environment_types_client(&self) -> project_environment_types::Client { project_environment_types::Client(self.clone()) } @@ -162,7 +168,7 @@ pub mod dev_centers { #[doc = "Lists all devcenters in a subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { list_by_subscription::RequestBuilder { client: self.0.clone(), @@ -173,8 +179,8 @@ pub mod dev_centers { #[doc = "Lists all devcenters in a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] pub fn list_by_resource_group( &self, subscription_id: impl Into, @@ -190,8 +196,8 @@ pub mod dev_centers { #[doc = "Gets a devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn get( &self, @@ -209,8 +215,8 @@ pub mod dev_centers { #[doc = "Creates or updates a devcenter resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `body`: Represents a devcenter."] pub fn create_or_update( @@ -231,8 +237,8 @@ pub mod dev_centers { #[doc = "Partially updates a devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `body`: Updatable devcenter properties."] pub fn update( @@ -253,8 +259,8 @@ pub mod dev_centers { #[doc = "Deletes a devcenter"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn delete( &self, @@ -347,7 +353,7 @@ pub mod dev_centers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -363,7 +369,7 @@ pub mod dev_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -465,7 +471,7 @@ pub mod dev_centers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -481,7 +487,7 @@ pub mod dev_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -576,7 +582,7 @@ pub mod dev_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -671,7 +677,7 @@ pub mod dev_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -767,7 +773,7 @@ pub mod dev_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -839,7 +845,7 @@ pub mod dev_centers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -856,7 +862,7 @@ pub mod projects { #[doc = "Lists all projects in the subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { list_by_subscription::RequestBuilder { client: self.0.clone(), @@ -867,8 +873,8 @@ pub mod projects { #[doc = "Lists all projects in the resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] pub fn list_by_resource_group( &self, subscription_id: impl Into, @@ -884,8 +890,8 @@ pub mod projects { #[doc = "Gets a specific project."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] pub fn get( &self, @@ -903,8 +909,8 @@ pub mod projects { #[doc = "Creates or updates a project."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `body`: Represents a project."] pub fn create_or_update( @@ -925,8 +931,8 @@ pub mod projects { #[doc = "Partially updates a project."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `body`: Updatable project properties."] pub fn update( @@ -947,8 +953,8 @@ pub mod projects { #[doc = "Deletes a project resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] pub fn delete( &self, @@ -1041,7 +1047,7 @@ pub mod projects { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1057,7 +1063,7 @@ pub mod projects { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -1159,7 +1165,7 @@ pub mod projects { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1175,7 +1181,7 @@ pub mod projects { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -1270,7 +1276,7 @@ pub mod projects { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1365,7 +1371,7 @@ pub mod projects { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -1461,7 +1467,7 @@ pub mod projects { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -1533,7 +1539,7 @@ pub mod projects { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1550,8 +1556,8 @@ pub mod attached_networks { #[doc = "Lists the attached NetworkConnections for a Project."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] pub fn list_by_project( &self, @@ -1570,8 +1576,8 @@ pub mod attached_networks { #[doc = "Gets an attached NetworkConnection."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `attached_network_connection_name`: The name of the attached NetworkConnection."] pub fn get_by_project( @@ -1592,8 +1598,8 @@ pub mod attached_networks { #[doc = "Lists the attached NetworkConnections for a DevCenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn list_by_dev_center( &self, @@ -1612,8 +1618,8 @@ pub mod attached_networks { #[doc = "Gets an attached NetworkConnection."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `attached_network_connection_name`: The name of the attached NetworkConnection."] pub fn get_by_dev_center( @@ -1634,8 +1640,8 @@ pub mod attached_networks { #[doc = "Creates or updates an attached NetworkConnection."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `attached_network_connection_name`: The name of the attached NetworkConnection."] #[doc = "* `body`: Represents an attached NetworkConnection."] @@ -1659,8 +1665,8 @@ pub mod attached_networks { #[doc = "Un-attach a NetworkConnection."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `attached_network_connection_name`: The name of the attached NetworkConnection."] pub fn delete( @@ -1760,7 +1766,7 @@ pub mod attached_networks { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1776,7 +1782,7 @@ pub mod attached_networks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -1873,7 +1879,7 @@ pub mod attached_networks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1975,7 +1981,7 @@ pub mod attached_networks { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1991,7 +1997,7 @@ pub mod attached_networks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -2088,7 +2094,7 @@ pub mod attached_networks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2185,7 +2191,7 @@ pub mod attached_networks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -2259,7 +2265,7 @@ pub mod attached_networks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2276,8 +2282,8 @@ pub mod galleries { #[doc = "Lists galleries for a devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn list_by_dev_center( &self, @@ -2296,8 +2302,8 @@ pub mod galleries { #[doc = "Gets a gallery"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] pub fn get( @@ -2318,8 +2324,8 @@ pub mod galleries { #[doc = "Creates or updates a gallery."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] #[doc = "* `body`: Represents a gallery."] @@ -2343,8 +2349,8 @@ pub mod galleries { #[doc = "Deletes a gallery resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] pub fn delete( @@ -2444,7 +2450,7 @@ pub mod galleries { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2460,7 +2466,7 @@ pub mod galleries { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -2557,7 +2563,7 @@ pub mod galleries { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2654,7 +2660,7 @@ pub mod galleries { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -2728,7 +2734,7 @@ pub mod galleries { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2745,8 +2751,8 @@ pub mod images { #[doc = "Lists images for a devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn list_by_dev_center( &self, @@ -2765,8 +2771,8 @@ pub mod images { #[doc = "Lists images for a gallery."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] pub fn list_by_gallery( @@ -2788,8 +2794,8 @@ pub mod images { #[doc = "Gets a gallery image."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] #[doc = "* `image_name`: The name of the image."] @@ -2892,7 +2898,7 @@ pub mod images { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2908,7 +2914,7 @@ pub mod images { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -3014,7 +3020,7 @@ pub mod images { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3030,7 +3036,7 @@ pub mod images { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -3129,7 +3135,7 @@ pub mod images { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3158,8 +3164,8 @@ pub mod image_versions { #[doc = "Lists versions for an image."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] #[doc = "* `image_name`: The name of the image."] @@ -3183,8 +3189,8 @@ pub mod image_versions { #[doc = "Gets an image version."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `gallery_name`: The name of the gallery."] #[doc = "* `image_name`: The name of the image."] @@ -3280,7 +3286,7 @@ pub mod image_versions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3296,7 +3302,7 @@ pub mod image_versions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -3385,7 +3391,7 @@ pub mod image_versions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3414,8 +3420,8 @@ pub mod catalogs { #[doc = "Lists catalogs for a devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn list_by_dev_center( &self, @@ -3434,8 +3440,8 @@ pub mod catalogs { #[doc = "Gets a catalog"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `catalog_name`: The name of the Catalog."] pub fn get( @@ -3456,8 +3462,8 @@ pub mod catalogs { #[doc = "Creates or updates a catalog."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `catalog_name`: The name of the Catalog."] #[doc = "* `body`: Represents a catalog."] @@ -3481,8 +3487,8 @@ pub mod catalogs { #[doc = "Partially updates a catalog."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `catalog_name`: The name of the Catalog."] #[doc = "* `body`: Updatable catalog properties."] @@ -3506,8 +3512,8 @@ pub mod catalogs { #[doc = "Deletes a catalog resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `catalog_name`: The name of the Catalog."] pub fn delete( @@ -3528,8 +3534,8 @@ pub mod catalogs { #[doc = "Syncs templates for a template source."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `catalog_name`: The name of the Catalog."] pub fn sync( @@ -3629,7 +3635,7 @@ pub mod catalogs { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3645,7 +3651,7 @@ pub mod catalogs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -3742,7 +3748,7 @@ pub mod catalogs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3839,7 +3845,7 @@ pub mod catalogs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -3937,7 +3943,7 @@ pub mod catalogs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -4011,7 +4017,7 @@ pub mod catalogs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4072,7 +4078,7 @@ pub mod catalogs { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -4090,8 +4096,8 @@ pub mod environment_types { #[doc = "Lists environment types for the devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn list_by_dev_center( &self, @@ -4110,8 +4116,8 @@ pub mod environment_types { #[doc = "Gets an environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `environment_type_name`: The name of the environment type."] pub fn get( @@ -4132,8 +4138,8 @@ pub mod environment_types { #[doc = "Creates or updates an environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `environment_type_name`: The name of the environment type."] #[doc = "* `body`: Represents an Environment Type."] @@ -4157,8 +4163,8 @@ pub mod environment_types { #[doc = "Partially updates an environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `environment_type_name`: The name of the environment type."] #[doc = "* `body`: Updatable environment type properties."] @@ -4182,8 +4188,8 @@ pub mod environment_types { #[doc = "Deletes an environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `environment_type_name`: The name of the environment type."] pub fn delete( @@ -4283,7 +4289,7 @@ pub mod environment_types { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4299,7 +4305,7 @@ pub mod environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -4396,7 +4402,7 @@ pub mod environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4492,7 +4498,7 @@ pub mod environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -4589,7 +4595,7 @@ pub mod environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -4662,7 +4668,258 @@ pub mod environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod project_allowed_environment_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists allowed environment types for a project."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `project_name`: The name of the project."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + project_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + project_name: project_name.into(), + top: None, + } + } + #[doc = "Gets an allowed environment type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `project_name`: The name of the project."] + #[doc = "* `environment_type_name`: The name of the environment type."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + project_name: impl Into, + environment_type_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + project_name: project_name.into(), + environment_type_name: environment_type_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedEnvironmentTypeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) project_name: String, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The maximum number of resources to return from the operation. Example: '$top=10'."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DevCenter/projects/{}/allowedEnvironmentTypes", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.project_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedEnvironmentType = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) project_name: String, + pub(crate) environment_type_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DevCenter/projects/{}/allowedEnvironmentTypes/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.project_name, + &this.environment_type_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4670,6 +4927,18 @@ pub mod environment_types { }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } pub mod project_environment_types { @@ -4679,8 +4948,8 @@ pub mod project_environment_types { #[doc = "Lists environment types for a project."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] pub fn list( &self, @@ -4699,8 +4968,8 @@ pub mod project_environment_types { #[doc = "Gets a project environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `environment_type_name`: The name of the environment type."] pub fn get( @@ -4721,8 +4990,8 @@ pub mod project_environment_types { #[doc = "Creates or updates a project environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `environment_type_name`: The name of the environment type."] #[doc = "* `body`: Represents a Project Environment Type."] @@ -4746,8 +5015,8 @@ pub mod project_environment_types { #[doc = "Partially updates a project environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `environment_type_name`: The name of the environment type."] #[doc = "* `body`: Updatable project environment type properties."] @@ -4771,8 +5040,8 @@ pub mod project_environment_types { #[doc = "Deletes a project environment type."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `environment_type_name`: The name of the environment type."] pub fn delete( @@ -4872,7 +5141,7 @@ pub mod project_environment_types { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4888,7 +5157,7 @@ pub mod project_environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -4985,7 +5254,7 @@ pub mod project_environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5081,7 +5350,7 @@ pub mod project_environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -5178,7 +5447,7 @@ pub mod project_environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -5251,7 +5520,7 @@ pub mod project_environment_types { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5268,8 +5537,8 @@ pub mod dev_box_definitions { #[doc = "List Dev Box definitions for a devcenter."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] pub fn list_by_dev_center( &self, @@ -5288,8 +5557,8 @@ pub mod dev_box_definitions { #[doc = "Gets a Dev Box definition"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `dev_box_definition_name`: The name of the Dev Box definition."] pub fn get( @@ -5310,8 +5579,8 @@ pub mod dev_box_definitions { #[doc = "Creates or updates a Dev Box definition."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `dev_box_definition_name`: The name of the Dev Box definition."] #[doc = "* `body`: Represents a Dev Box definition."] @@ -5335,8 +5604,8 @@ pub mod dev_box_definitions { #[doc = "Partially updates a Dev Box definition."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `dev_box_definition_name`: The name of the Dev Box definition."] #[doc = "* `body`: Represents a Dev Box definition."] @@ -5360,8 +5629,8 @@ pub mod dev_box_definitions { #[doc = "Deletes a Dev Box definition"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `dev_center_name`: The name of the devcenter."] #[doc = "* `dev_box_definition_name`: The name of the Dev Box definition."] pub fn delete( @@ -5382,8 +5651,8 @@ pub mod dev_box_definitions { #[doc = "List Dev Box definitions configured for a project."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] pub fn list_by_project( &self, @@ -5402,8 +5671,8 @@ pub mod dev_box_definitions { #[doc = "Gets a Dev Box definition configured for a project"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `dev_box_definition_name`: The name of the Dev Box definition."] pub fn get_by_project( @@ -5503,7 +5772,7 @@ pub mod dev_box_definitions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5519,7 +5788,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -5616,7 +5885,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5713,7 +5982,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -5811,7 +6080,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -5885,7 +6154,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5975,7 +6244,7 @@ pub mod dev_box_definitions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5991,7 +6260,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -6088,7 +6357,7 @@ pub mod dev_box_definitions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6186,7 +6455,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6202,7 +6471,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -6231,7 +6500,7 @@ pub mod operation_statuses { #[doc = "Gets the current status of an async operation."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `location`: The Azure region"] #[doc = "* `operation_id`: The ID of an ongoing async operation"] pub fn get( @@ -6320,7 +6589,7 @@ pub mod operation_statuses { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6349,7 +6618,7 @@ pub mod usages { #[doc = "Lists the current usages and limits in this location for the provided subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `location`: The Azure region"] pub fn list_by_location( &self, @@ -6436,7 +6705,7 @@ pub mod usages { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6452,7 +6721,7 @@ pub mod usages { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -6473,29 +6742,142 @@ pub mod usages { } } } -pub mod skus { +pub mod check_name_availability { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists the Microsoft.DevCenter SKUs available in a subscription"] + #[doc = "Check the availability of name for resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `name_availability_request`: The required parameters for checking if resource name is available."] + pub fn execute( + &self, + subscription_id: impl Into, + name_availability_request: impl Into, + ) -> execute::RequestBuilder { + execute::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - top: None, + name_availability_request: name_availability_request.into(), } } } - pub mod list_by_subscription { + pub mod execute { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SkuListResult = serde_json::from_slice(&bytes)?; + let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) name_availability_request: models::CheckNameAvailabilityRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DevCenter/checkNameAvailability", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.name_availability_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod skus { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the Microsoft.DevCenter SKUs available in a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + top: None, + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SkuListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6566,7 +6948,7 @@ pub mod skus { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6582,7 +6964,7 @@ pub mod skus { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -6613,8 +6995,8 @@ pub mod pools { #[doc = "Lists pools for a project"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] pub fn list_by_project( &self, @@ -6633,8 +7015,8 @@ pub mod pools { #[doc = "Gets a machine pool"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] pub fn get( @@ -6655,8 +7037,8 @@ pub mod pools { #[doc = "Creates or updates a machine pool"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] #[doc = "* `body`: Represents a machine pool"] @@ -6680,8 +7062,8 @@ pub mod pools { #[doc = "Partially updates a machine pool"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] #[doc = "* `body`: Represents a machine pool"] @@ -6705,8 +7087,8 @@ pub mod pools { #[doc = "Deletes a machine pool"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] pub fn delete( @@ -6724,6 +7106,28 @@ pub mod pools { pool_name: pool_name.into(), } } + #[doc = "Triggers a refresh of the pool status."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `project_name`: The name of the project."] + #[doc = "* `pool_name`: Name of the pool."] + pub fn run_health_checks( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + project_name: impl Into, + pool_name: impl Into, + ) -> run_health_checks::RequestBuilder { + run_health_checks::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + project_name: project_name.into(), + pool_name: pool_name.into(), + } + } } pub mod list_by_project { use super::models; @@ -6806,7 +7210,7 @@ pub mod pools { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6822,7 +7226,7 @@ pub mod pools { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -6919,7 +7323,7 @@ pub mod pools { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7016,7 +7420,7 @@ pub mod pools { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -7114,7 +7518,7 @@ pub mod pools { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -7188,7 +7592,7 @@ pub mod pools { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7197,6 +7601,68 @@ pub mod pools { } } } + pub mod run_health_checks { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) project_name: String, + pub(crate) pool_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DevCenter/projects/{}/pools/{}/runHealthChecks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.project_name, + &this.pool_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } pub mod schedules { use super::models; @@ -7205,8 +7671,8 @@ pub mod schedules { #[doc = "Lists schedules for a pool"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] pub fn list_by_pool( @@ -7228,8 +7694,8 @@ pub mod schedules { #[doc = "Gets a schedule resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] #[doc = "* `schedule_name`: The name of the schedule that uniquely identifies it."] @@ -7254,8 +7720,8 @@ pub mod schedules { #[doc = "Creates or updates a Schedule."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] #[doc = "* `schedule_name`: The name of the schedule that uniquely identifies it."] @@ -7283,8 +7749,8 @@ pub mod schedules { #[doc = "Partially updates a Scheduled."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] #[doc = "* `schedule_name`: The name of the schedule that uniquely identifies it."] @@ -7312,8 +7778,8 @@ pub mod schedules { #[doc = "Deletes a Scheduled."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `project_name`: The name of the project."] #[doc = "* `pool_name`: Name of the pool."] #[doc = "* `schedule_name`: The name of the schedule that uniquely identifies it."] @@ -7419,7 +7885,7 @@ pub mod schedules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7435,7 +7901,7 @@ pub mod schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -7540,7 +8006,7 @@ pub mod schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -7648,7 +8114,7 @@ pub mod schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -7676,6 +8142,29 @@ pub mod schedules { pub mod update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Schedule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -7734,7 +8223,7 @@ pub mod schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -7746,6 +8235,18 @@ pub mod schedules { }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } pub mod delete { use super::models; @@ -7807,7 +8308,7 @@ pub mod schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -7827,7 +8328,7 @@ pub mod network_connections { #[doc = "Lists network connections in a subscription"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { list_by_subscription::RequestBuilder { client: self.0.clone(), @@ -7838,8 +8339,8 @@ pub mod network_connections { #[doc = "Lists network connections in a resource group"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] pub fn list_by_resource_group( &self, subscription_id: impl Into, @@ -7855,8 +8356,8 @@ pub mod network_connections { #[doc = "Gets a network connection resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] pub fn get( &self, @@ -7874,8 +8375,8 @@ pub mod network_connections { #[doc = "Creates or updates a Network Connections resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] #[doc = "* `body`: Represents network connection"] pub fn create_or_update( @@ -7896,8 +8397,8 @@ pub mod network_connections { #[doc = "Partially updates a Network Connection"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] #[doc = "* `body`: Represents network connection"] pub fn update( @@ -7918,8 +8419,8 @@ pub mod network_connections { #[doc = "Deletes a Network Connections resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] pub fn delete( &self, @@ -7937,8 +8438,8 @@ pub mod network_connections { #[doc = "Lists health check status details"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] pub fn list_health_details( &self, @@ -7957,8 +8458,8 @@ pub mod network_connections { #[doc = "Gets health check status details."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] pub fn get_health_details( &self, @@ -7976,8 +8477,8 @@ pub mod network_connections { #[doc = "Triggers a new health check run. The execution and health check result can be tracked via the network Connection health check details"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] - #[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] pub fn run_health_checks( &self, @@ -7992,6 +8493,26 @@ pub mod network_connections { network_connection_name: network_connection_name.into(), } } + #[doc = "Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs should be allowed for outbound access in order for the Dev Box service to function."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `network_connection_name`: Name of the Network Connection that can be applied to a Pool."] + pub fn list_outbound_network_dependencies_endpoints( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + network_connection_name: impl Into, + ) -> list_outbound_network_dependencies_endpoints::RequestBuilder { + list_outbound_network_dependencies_endpoints::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + network_connection_name: network_connection_name.into(), + top: None, + } + } } pub mod list_by_subscription { use super::models; @@ -8070,7 +8591,7 @@ pub mod network_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8086,7 +8607,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -8188,7 +8709,7 @@ pub mod network_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8204,7 +8725,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -8299,7 +8820,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8394,7 +8915,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -8490,7 +9011,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); @@ -8562,7 +9083,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8652,7 +9173,7 @@ pub mod network_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -8668,7 +9189,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); if let Some(top) = &this.top { req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); } @@ -8763,7 +9284,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8809,6 +9330,7 @@ pub mod network_connections { pub(crate) network_connection_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8833,7 +9355,7 @@ pub mod network_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -8843,4 +9365,118 @@ pub mod network_connections { } } } + pub mod list_outbound_network_dependencies_endpoints { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OutboundEnvironmentEndpointCollection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) network_connection_name: String, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The maximum number of resources to return from the operation. Example: '$top=10'."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DevCenter/networkConnections/{}/outboundNetworkDependenciesEndpoints" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_connection_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } } diff --git a/services/mgmt/devcenter/src/package_2022_08_01_preview/models.rs b/services/mgmt/devcenter/src/package_2023_04/models.rs similarity index 77% rename from services/mgmt/devcenter/src/package_2022_08_01_preview/models.rs rename to services/mgmt/devcenter/src/package_2023_04/models.rs index 45e49050b6..b0f9fecc79 100644 --- a/services/mgmt/devcenter/src/package_2022_08_01_preview/models.rs +++ b/services/mgmt/devcenter/src/package_2023_04/models.rs @@ -3,6 +3,57 @@ use serde::de::{value, Deserializer, IntoDeserializer}; use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; +#[doc = "Represents an allowed environment type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedEnvironmentType { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of an allowed environment type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AllowedEnvironmentType { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the allowed environment type list operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedEnvironmentTypeListResult { + #[doc = "Current page of results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AllowedEnvironmentTypeListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AllowedEnvironmentTypeListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of an allowed environment type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedEnvironmentTypeProperties { + #[doc = "Provisioning state of the resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl AllowedEnvironmentTypeProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Represents an attached NetworkConnection."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AttachedNetworkConnection { @@ -134,6 +185,9 @@ pub struct CatalogProperties { #[doc = "Provisioning state of the resource."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "The synchronization state of the catalog."] + #[serde(rename = "syncState", default, skip_serializing_if = "Option::is_none")] + pub sync_state: Option, #[doc = "When the catalog was last synced."] #[serde(rename = "lastSyncTime", default, with = "azure_core::date::rfc3339::option")] pub last_sync_time: Option, @@ -143,6 +197,50 @@ impl CatalogProperties { Self::default() } } +pub mod catalog_properties { + use super::*; + #[doc = "The synchronization state of the catalog."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SyncState")] + pub enum SyncState { + Succeeded, + InProgress, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SyncState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SyncState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SyncState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("SyncState", 0u32, "Succeeded"), + Self::InProgress => serializer.serialize_unit_variant("SyncState", 1u32, "InProgress"), + Self::Failed => serializer.serialize_unit_variant("SyncState", 2u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("SyncState", 3u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "The catalog's properties for partial update. Properties not provided in the update request will not be changed."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct CatalogUpdate { @@ -173,6 +271,79 @@ impl CatalogUpdateProperties { Self::default() } } +#[doc = "The check availability request body."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityRequest { + #[doc = "The name of the resource for which availability needs to be checked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl CheckNameAvailabilityRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The check availability result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityResponse { + #[doc = "Indicates if the resource name is available."] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "The reason why the given name is not available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Detailed reason why the given name is available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl CheckNameAvailabilityResponse { + pub fn new() -> Self { + Self::default() + } +} +pub mod check_name_availability_response { + use super::*; + #[doc = "The reason why the given name is not available."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Reason")] + pub enum Reason { + Invalid, + AlreadyExists, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Reason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Reason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Reason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Invalid => serializer.serialize_unit_variant("Reason", 0u32, "Invalid"), + Self::AlreadyExists => serializer.serialize_unit_variant("Reason", 1u32, "AlreadyExists"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "An error response from the DevCenter service."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CloudError { @@ -315,6 +486,9 @@ pub struct DevBoxDefinitionUpdateProperties { #[doc = "The storage type used for the Operating System disk of Dev Boxes created using this definition."] #[serde(rename = "osStorageType", default, skip_serializing_if = "Option::is_none")] pub os_storage_type: Option, + #[doc = "Indicates whether hibernate is enabled/disabled."] + #[serde(rename = "hibernateSupport", default, skip_serializing_if = "Option::is_none")] + pub hibernate_support: Option, } impl DevBoxDefinitionUpdateProperties { pub fn new() -> Self { @@ -373,6 +547,9 @@ pub struct DevCenterProperties { #[doc = "Provisioning state of the resource."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "The URI of the resource."] + #[serde(rename = "devCenterUri", default, skip_serializing_if = "Option::is_none")] + pub dev_center_uri: Option, } impl DevCenterProperties { pub fn new() -> Self { @@ -426,6 +603,7 @@ impl DevCenterUpdate { Self::default() } } +pub type DevCenterUri = String; #[doc = "Active Directory join type"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "DomainJoinType")] @@ -465,41 +643,39 @@ impl Serialize for DomainJoinType { } } } -#[doc = "Enable or disable status. Indicates whether the property applied to is either enabled or disabled."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "EnableStatus")] -pub enum EnableStatus { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), +#[doc = "A domain name and connection details used to access a dependency."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EndpointDependency { + #[doc = "The domain name of the dependency. Domain names may be fully qualified or may contain a * wildcard."] + #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] + pub domain_name: Option, + #[doc = "Human-readable supplemental information about the dependency and when it is applicable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The list of connection details for this endpoint."] + #[serde( + rename = "endpointDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoint_details: Vec, } -impl FromStr for EnableStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) +impl EndpointDependency { + pub fn new() -> Self { + Self::default() } } -impl<'de> Deserialize<'de> for EnableStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } +#[doc = "Details about the connection between the Batch service and the endpoint."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EndpointDetail { + #[doc = "The port an endpoint is connected to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, } -impl Serialize for EnableStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("EnableStatus", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("EnableStatus", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } +impl EndpointDetail { + pub fn new() -> Self { + Self::default() } } #[doc = "A role that can be assigned to a user."] @@ -534,6 +710,43 @@ impl EnvironmentType { Self::default() } } +#[doc = "Indicates whether the environment type is either enabled or disabled."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "EnvironmentTypeEnableStatus")] +pub enum EnvironmentTypeEnableStatus { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for EnvironmentTypeEnableStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for EnvironmentTypeEnableStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for EnvironmentTypeEnableStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("EnvironmentTypeEnableStatus", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("EnvironmentTypeEnableStatus", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Result of the environment type list operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EnvironmentTypeListResult { @@ -583,6 +796,66 @@ impl EnvironmentTypeUpdate { Self::default() } } +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Represents a gallery."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Gallery { @@ -695,12 +968,12 @@ impl HealthCheck { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "HealthCheckStatus")] pub enum HealthCheckStatus { + Unknown, Pending, Running, Passed, - Failed, Warning, - Unknown, + Failed, #[serde(skip_deserializing)] UnknownValue(String), } @@ -726,12 +999,12 @@ impl Serialize for HealthCheckStatus { S: Serializer, { match self { - Self::Pending => serializer.serialize_unit_variant("HealthCheckStatus", 0u32, "Pending"), - Self::Running => serializer.serialize_unit_variant("HealthCheckStatus", 1u32, "Running"), - Self::Passed => serializer.serialize_unit_variant("HealthCheckStatus", 2u32, "Passed"), - Self::Failed => serializer.serialize_unit_variant("HealthCheckStatus", 3u32, "Failed"), + Self::Unknown => serializer.serialize_unit_variant("HealthCheckStatus", 0u32, "Unknown"), + Self::Pending => serializer.serialize_unit_variant("HealthCheckStatus", 1u32, "Pending"), + Self::Running => serializer.serialize_unit_variant("HealthCheckStatus", 2u32, "Running"), + Self::Passed => serializer.serialize_unit_variant("HealthCheckStatus", 3u32, "Passed"), Self::Warning => serializer.serialize_unit_variant("HealthCheckStatus", 4u32, "Warning"), - Self::Unknown => serializer.serialize_unit_variant("HealthCheckStatus", 5u32, "Unknown"), + Self::Failed => serializer.serialize_unit_variant("HealthCheckStatus", 5u32, "Failed"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -798,6 +1071,101 @@ impl HealthCheckStatusDetailsProperties { Self::default() } } +#[doc = "Health status indicating whether a pool is available to create Dev Boxes."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "HealthStatus")] +pub enum HealthStatus { + Unknown, + Pending, + Healthy, + Warning, + Unhealthy, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for HealthStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for HealthStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for HealthStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("HealthStatus", 0u32, "Unknown"), + Self::Pending => serializer.serialize_unit_variant("HealthStatus", 1u32, "Pending"), + Self::Healthy => serializer.serialize_unit_variant("HealthStatus", 2u32, "Healthy"), + Self::Warning => serializer.serialize_unit_variant("HealthStatus", 3u32, "Warning"), + Self::Unhealthy => serializer.serialize_unit_variant("HealthStatus", 4u32, "Unhealthy"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Pool health status detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HealthStatusDetail { + #[doc = "An identifier for the issue."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "A message describing the issue, intended to be suitable for display in a user interface"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl HealthStatusDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Indicates whether hibernate is enabled/disabled."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "HibernateSupport")] +pub enum HibernateSupport { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for HibernateSupport { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for HibernateSupport { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for HibernateSupport { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("HibernateSupport", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("HibernateSupport", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Represents an image."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Image { @@ -858,6 +1226,9 @@ pub struct ImageProperties { #[doc = "Provisioning state of the resource."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "Indicates whether hibernate is enabled/disabled."] + #[serde(rename = "hibernateSupport", default, skip_serializing_if = "Option::is_none")] + pub hibernate_support: Option, } impl ImageProperties { pub fn new() -> Self { @@ -873,15 +1244,6 @@ pub struct ImageReference { #[doc = "The actual version of the image after use. When id references a gallery image latest version, this will indicate the actual version in use."] #[serde(rename = "exactVersion", default, skip_serializing_if = "Option::is_none")] pub exact_version: Option, - #[doc = "The image publisher."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub publisher: Option, - #[doc = "The image offer."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub offer: Option, - #[doc = "The image sku."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, } impl ImageReference { pub fn new() -> Self { @@ -1436,57 +1798,113 @@ impl OperationListResult { } } #[doc = "The current status of an async operation"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OperationStatus { - #[doc = "Fully qualified ID for the operation status."] + #[serde(flatten)] + pub operation_status_result: OperationStatusResult, + #[doc = "The id of the resource."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Custom operation properties, populated only for a successful operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl OperationStatus { + pub fn new(operation_status_result: OperationStatusResult) -> Self { + Self { + operation_status_result, + resource_id: None, + properties: None, + } + } +} +#[doc = "The current status of an async operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationStatusResult { + #[doc = "Fully qualified ID for the async operation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, - #[doc = "The operation id name"] + #[doc = "Name of the async operation."] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - #[doc = "Provisioning state of the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The id of the resource."] - #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] - pub resource_id: Option, - #[doc = "The start time of the operation"] + #[doc = "Operation status."] + pub status: String, + #[doc = "Percent of the operation that is complete."] + #[serde(rename = "percentComplete", default, skip_serializing_if = "Option::is_none")] + pub percent_complete: Option, + #[doc = "The start time of the operation."] #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] pub start_time: Option, - #[doc = "The end time of the operation"] + #[doc = "The end time of the operation."] #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] pub end_time: Option, - #[doc = "Percent of the operation that is complete"] - #[serde(rename = "percentComplete", default, skip_serializing_if = "Option::is_none")] - pub percent_complete: Option, - #[doc = "Custom operation properties, populated only for a successful operation."] + #[doc = "The operations list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub operations: Vec, + #[doc = "The error detail."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Operation Error message"] + pub error: Option, +} +impl OperationStatusResult { + pub fn new(status: String) -> Self { + Self { + id: None, + name: None, + status, + percent_complete: None, + start_time: None, + end_time: None, + operations: Vec::new(), + error: None, + } + } +} +#[doc = "A collection of related endpoints from the same service for which the agent requires outbound access."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OutboundEnvironmentEndpoint { + #[doc = "The type of service that the agent connects to."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, + pub category: Option, + #[doc = "The endpoints for this service for which the agent requires outbound access."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub endpoints: Vec, } -impl OperationStatus { +impl OutboundEnvironmentEndpoint { pub fn new() -> Self { Self::default() } } -pub mod operation_status { - use super::*; - #[doc = "Operation Error message"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Error { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, +#[doc = "Values returned by the List operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OutboundEnvironmentEndpointCollection { + #[doc = "The collection of outbound network dependency endpoints returned by the listing operation."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The continuation token."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OutboundEnvironmentEndpointCollection { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() } - impl Error { - pub fn new() -> Self { - Self::default() - } +} +impl OutboundEnvironmentEndpointCollection { + pub fn new() -> Self { + Self::default() } } #[doc = "A pool of Virtual Machines."] @@ -1536,6 +1954,17 @@ impl PoolListResult { pub struct PoolProperties { #[serde(flatten)] pub pool_update_properties: PoolUpdateProperties, + #[doc = "Health status indicating whether a pool is available to create Dev Boxes."] + #[serde(rename = "healthStatus", default, skip_serializing_if = "Option::is_none")] + pub health_status: Option, + #[doc = "Details on the Pool health status to help diagnose issues. This is only populated when the pool status indicates the pool is in a non-healthy state"] + #[serde( + rename = "healthStatusDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub health_status_details: Vec, #[doc = "Provisioning state of the resource."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1544,6 +1973,8 @@ impl PoolProperties { pub fn new() -> Self { Self { pool_update_properties: PoolUpdateProperties::default(), + health_status: None, + health_status_details: Vec::new(), provisioning_state: None, } } @@ -1576,6 +2007,9 @@ pub struct PoolUpdateProperties { pub license_type: Option, #[serde(rename = "localAdministrator", default, skip_serializing_if = "Option::is_none")] pub local_administrator: Option, + #[doc = "Stop on disconnect configuration settings for Dev Boxes created in this pool."] + #[serde(rename = "stopOnDisconnect", default, skip_serializing_if = "Option::is_none")] + pub stop_on_disconnect: Option, } impl PoolUpdateProperties { pub fn new() -> Self { @@ -1685,9 +2119,9 @@ pub struct ProjectEnvironmentTypeUpdateProperties { #[doc = "Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription."] #[serde(rename = "deploymentTargetId", default, skip_serializing_if = "Option::is_none")] pub deployment_target_id: Option, - #[doc = "Enable or disable status. Indicates whether the property applied to is either enabled or disabled."] + #[doc = "Indicates whether the environment type is either enabled or disabled."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, #[doc = "The role definition assigned to the environment creator on backing resources."] #[serde(rename = "creatorRoleAssignment", default, skip_serializing_if = "Option::is_none")] pub creator_role_assignment: Option, @@ -1748,6 +2182,9 @@ pub struct ProjectProperties { #[doc = "Provisioning state of the resource."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "The URI of the resource."] + #[serde(rename = "devCenterUri", default, skip_serializing_if = "Option::is_none")] + pub dev_center_uri: Option, } impl ProjectProperties { pub fn new() -> Self { @@ -1777,13 +2214,80 @@ pub struct ProjectUpdateProperties { #[doc = "Description of the project."] #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, + #[doc = "When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project. This will have no effect on existing Dev Boxes when reduced."] + #[serde(rename = "maxDevBoxesPerUser", default, skip_serializing_if = "Option::is_none")] + pub max_dev_boxes_per_user: Option, } impl ProjectUpdateProperties { pub fn new() -> Self { Self::default() } } -pub type ProvisioningState = String; +#[doc = "Provisioning state of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ProvisioningState")] +pub enum ProvisioningState { + NotSpecified, + Accepted, + Running, + Creating, + Created, + Updating, + Updated, + Deleting, + Deleted, + Succeeded, + Failed, + Canceled, + MovingResources, + TransientFailure, + RolloutInProgress, + StorageProvisioningFailed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NotSpecified => serializer.serialize_unit_variant("ProvisioningState", 0u32, "NotSpecified"), + Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Accepted"), + Self::Running => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Running"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Creating"), + Self::Created => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Created"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Updating"), + Self::Updated => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Updated"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 7u32, "Deleting"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 8u32, "Deleted"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 9u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 10u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 11u32, "Canceled"), + Self::MovingResources => serializer.serialize_unit_variant("ProvisioningState", 12u32, "MovingResources"), + Self::TransientFailure => serializer.serialize_unit_variant("ProvisioningState", 13u32, "TransientFailure"), + Self::RolloutInProgress => serializer.serialize_unit_variant("ProvisioningState", 14u32, "RolloutInProgress"), + Self::StorageProvisioningFailed => serializer.serialize_unit_variant("ProvisioningState", 15u32, "StorageProvisioningFailed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { @@ -1860,6 +2364,43 @@ impl Schedule { Self::default() } } +#[doc = "Schedule enable or disable status. Indicates whether the schedule applied to is either enabled or disabled."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScheduleEnableStatus")] +pub enum ScheduleEnableStatus { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScheduleEnableStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScheduleEnableStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScheduleEnableStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("ScheduleEnableStatus", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("ScheduleEnableStatus", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Result of the schedule list operation."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ScheduleListResult { @@ -1931,9 +2472,9 @@ pub struct ScheduleUpdateProperties { #[doc = "The IANA timezone id at which the schedule should execute."] #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] pub time_zone: Option, - #[doc = "Enable or disable status. Indicates whether the property applied to is either enabled or disabled."] + #[doc = "Schedule enable or disable status. Indicates whether the schedule applied to is either enabled or disabled."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, + pub state: Option, } impl ScheduleUpdateProperties { pub fn new() -> Self { @@ -2072,6 +2613,58 @@ pub enum SkuTier { Standard, Premium, } +#[doc = "Stop on disconnect configuration settings for Dev Boxes created in this pool."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StopOnDisconnectConfiguration { + #[doc = "Stop on disconnect enable or disable status. Indicates whether stop on disconnect to is either enabled or disabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The specified time in minutes to wait before stopping a Dev Box once disconnect is detected."] + #[serde(rename = "gracePeriodMinutes", default, skip_serializing_if = "Option::is_none")] + pub grace_period_minutes: Option, +} +impl StopOnDisconnectConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Stop on disconnect enable or disable status. Indicates whether stop on disconnect to is either enabled or disabled."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "StopOnDisconnectEnableStatus")] +pub enum StopOnDisconnectEnableStatus { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for StopOnDisconnectEnableStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for StopOnDisconnectEnableStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for StopOnDisconnectEnableStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("StopOnDisconnectEnableStatus", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("StopOnDisconnectEnableStatus", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} #[doc = "Resource tags."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Tags {} diff --git a/services/mgmt/dns/Cargo.toml b/services/mgmt/dns/Cargo.toml index e32f523220..d6e0d4d4db 100644 --- a/services/mgmt/dns/Cargo.toml +++ b/services/mgmt/dns/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2018-05", "enable_reqwest"] +default = ["profile-hybrid-2020-09-01", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] "profile-hybrid-2020-09-01" = [] +"package-2023-07-preview" = [] "package-2018-05" = [] "package-2018-03-preview" = [] -"package-2017-10" = [] -"package-2017-09" = [] \ No newline at end of file +"package-2017-10" = [] \ No newline at end of file diff --git a/services/mgmt/dns/README.md b/services/mgmt/dns/README.md index 56e62c48ae..9cc4acd4ba 100644 --- a/services/mgmt/dns/README.md +++ b/services/mgmt/dns/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/dns/resour To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2018-05`. +The default tag is `profile-hybrid-2020-09-01`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: - `profile-hybrid-2020-09-01` has 11 operations from 1 API versions: `2016-04-01`. Use crate feature `profile-hybrid-2020-09-01` to enable. The operations will be in the `profile_hybrid_2020_09_01` module. +- `package-2023-07-preview` has 18 operations from 1 API versions: `2023-07-01-preview`. Use crate feature `package-2023-07-preview` to enable. The operations will be in the `package_2023_07_preview` module. - `package-2018-05` has 14 operations from 1 API versions: `2018-05-01`. Use crate feature `package-2018-05` to enable. The operations will be in the `package_2018_05` module. - `package-2018-03-preview` has 13 operations from 1 API versions: `2018-03-01-preview`. Use crate feature `package-2018-03-preview` to enable. The operations will be in the `package_2018_03_preview` module. -- `package-2017-10` has 13 operations from 1 API versions: `2017-10-01`. Use crate feature `package-2017-10` to enable. The operations will be in the `package_2017_10` module. -- `package-2017-09` has 11 operations from 1 API versions: `2017-09-01`. Use crate feature `package-2017-09` to enable. The operations will be in the `package_2017_09` module. \ No newline at end of file +- `package-2017-10` has 13 operations from 1 API versions: `2017-10-01`. Use crate feature `package-2017-10` to enable. The operations will be in the `package_2017_10` module. \ No newline at end of file diff --git a/services/mgmt/dns/src/lib.rs b/services/mgmt/dns/src/lib.rs index 65091573c3..03516bd614 100644 --- a/services/mgmt/dns/src/lib.rs +++ b/services/mgmt/dns/src/lib.rs @@ -7,6 +7,10 @@ pub mod profile_hybrid_2020_09_01; #[cfg(all(feature = "profile-hybrid-2020-09-01", not(feature = "no-default-tag")))] pub use profile_hybrid_2020_09_01::*; +#[cfg(feature = "package-2023-07-preview")] +pub mod package_2023_07_preview; +#[cfg(all(feature = "package-2023-07-preview", not(feature = "no-default-tag")))] +pub use package_2023_07_preview::*; #[cfg(feature = "package-2018-05")] pub mod package_2018_05; #[cfg(all(feature = "package-2018-05", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_2018_03_preview::*; pub mod package_2017_10; #[cfg(all(feature = "package-2017-10", not(feature = "no-default-tag")))] pub use package_2017_10::*; -#[cfg(feature = "package-2017-09")] -pub mod package_2017_09; -#[cfg(all(feature = "package-2017-09", not(feature = "no-default-tag")))] -pub use package_2017_09::*; diff --git a/services/mgmt/dns/src/package_2017_09/models.rs b/services/mgmt/dns/src/package_2017_09/models.rs deleted file mode 100644 index b5df150aca..0000000000 --- a/services/mgmt/dns/src/package_2017_09/models.rs +++ /dev/null @@ -1,496 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "An A record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ARecord { - #[doc = "The IPv4 address of this A record."] - #[serde(rename = "ipv4Address", default, skip_serializing_if = "Option::is_none")] - pub ipv4_address: Option, -} -impl ARecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An AAAA record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AaaaRecord { - #[doc = "The IPv6 address of this AAAA record."] - #[serde(rename = "ipv6Address", default, skip_serializing_if = "Option::is_none")] - pub ipv6_address: Option, -} -impl AaaaRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A CAA record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CaaRecord { - #[doc = "The flags for this CAA record as an integer between 0 and 255."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flags: Option, - #[doc = "The tag for this CAA record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag: Option, - #[doc = "The value for this CAA record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} -impl CaaRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An error response from the service."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudError { - #[doc = "An error response from the service."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for CloudError { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl CloudError { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An error response from the service."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudErrorBody { - #[doc = "An identifier for the error. Codes are invariant and are intended to be consumed programmatically."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "A message describing the error, intended to be suitable for display in a user interface."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The target of the particular error. For example, the name of the property in error."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "A list of additional details about the error."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, -} -impl CloudErrorBody { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A CNAME record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CnameRecord { - #[doc = "The canonical name for this CNAME record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cname: Option, -} -impl CnameRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An MX record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MxRecord { - #[doc = "The preference value for this MX record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preference: Option, - #[doc = "The domain name of the mail host for this MX record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub exchange: Option, -} -impl MxRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An NS record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NsRecord { - #[doc = "The name server name for this NS record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nsdname: Option, -} -impl NsRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A PTR record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PtrRecord { - #[doc = "The PTR target domain name for this PTR record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ptrdname: Option, -} -impl PtrRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes a DNS record set (a collection of DNS records with the same name and type)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecordSet { - #[doc = "The ID of the record set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the record set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the record set."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The etag of the record set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "Represents the properties of the records in the record set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl RecordSet { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The response to a record set List operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecordSetListResult { - #[doc = "Information about the record sets in the response."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The continuation token for the next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for RecordSetListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl RecordSetListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents the properties of the records in the record set."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecordSetProperties { - #[doc = "The metadata attached to the record set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[doc = "The TTL (time-to-live) of the records in the record set."] - #[serde(rename = "TTL", default, skip_serializing_if = "Option::is_none")] - pub ttl: Option, - #[doc = "Fully qualified domain name of the record set."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fqdn: Option, - #[doc = "The list of A records in the record set."] - #[serde( - rename = "ARecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub a_records: Vec, - #[doc = "The list of AAAA records in the record set."] - #[serde( - rename = "AAAARecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub aaaa_records: Vec, - #[doc = "The list of MX records in the record set."] - #[serde( - rename = "MXRecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub mx_records: Vec, - #[doc = "The list of NS records in the record set."] - #[serde( - rename = "NSRecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub ns_records: Vec, - #[doc = "The list of PTR records in the record set."] - #[serde( - rename = "PTRRecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub ptr_records: Vec, - #[doc = "The list of SRV records in the record set."] - #[serde( - rename = "SRVRecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub srv_records: Vec, - #[doc = "The list of TXT records in the record set."] - #[serde( - rename = "TXTRecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub txt_records: Vec, - #[doc = "A CNAME record."] - #[serde(rename = "CNAMERecord", default, skip_serializing_if = "Option::is_none")] - pub cname_record: Option, - #[doc = "An SOA record."] - #[serde(rename = "SOARecord", default, skip_serializing_if = "Option::is_none")] - pub soa_record: Option, - #[doc = "The list of CAA records in the record set."] - #[serde( - rename = "caaRecords", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub caa_records: Vec, -} -impl RecordSetProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters supplied to update a record set."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecordSetUpdateParameters { - #[doc = "Describes a DNS record set (a collection of DNS records with the same name and type)."] - #[serde(rename = "RecordSet", default, skip_serializing_if = "Option::is_none")] - pub record_set: Option, -} -impl RecordSetUpdateParameters { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An SOA record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SoaRecord { - #[doc = "The domain name of the authoritative name server for this SOA record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub host: Option, - #[doc = "The email contact for this SOA record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub email: Option, - #[doc = "The serial number for this SOA record."] - #[serde(rename = "serialNumber", default, skip_serializing_if = "Option::is_none")] - pub serial_number: Option, - #[doc = "The refresh value for this SOA record."] - #[serde(rename = "refreshTime", default, skip_serializing_if = "Option::is_none")] - pub refresh_time: Option, - #[doc = "The retry time for this SOA record."] - #[serde(rename = "retryTime", default, skip_serializing_if = "Option::is_none")] - pub retry_time: Option, - #[doc = "The expire time for this SOA record."] - #[serde(rename = "expireTime", default, skip_serializing_if = "Option::is_none")] - pub expire_time: Option, - #[doc = "The minimum value for this SOA record. By convention this is used to determine the negative caching duration."] - #[serde(rename = "minimumTTL", default, skip_serializing_if = "Option::is_none")] - pub minimum_ttl: Option, -} -impl SoaRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An SRV record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SrvRecord { - #[doc = "The priority value for this SRV record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option, - #[doc = "The weight value for this SRV record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub weight: Option, - #[doc = "The port value for this SRV record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub port: Option, - #[doc = "The target domain name for this SRV record."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, -} -impl SrvRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A reference to a another resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SubResource { - #[doc = "Resource Id."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, -} -impl SubResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The geo-location where the resource lives"] - pub location: String, -} -impl TrackedResource { - pub fn new(location: String) -> Self { - Self { - resource: Resource::default(), - tags: None, - location, - } - } -} -#[doc = "A TXT record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TxtRecord { - #[doc = "The text value of this TXT record."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl TxtRecord { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes a DNS zone."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Zone { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "The etag of the zone."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, - #[doc = "Represents the properties of the zone."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Zone { - pub fn new(tracked_resource: TrackedResource) -> Self { - Self { - tracked_resource, - etag: None, - properties: None, - } - } -} -#[doc = "The response to a Zone List or ListAll operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ZoneListResult { - #[doc = "Information about the DNS zones."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The continuation token for the next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ZoneListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ZoneListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents the properties of the zone."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ZoneProperties { - #[doc = "The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] - #[serde(rename = "maxNumberOfRecordSets", default, skip_serializing_if = "Option::is_none")] - pub max_number_of_record_sets: Option, - #[doc = "The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] - #[serde(rename = "maxNumberOfRecordsPerRecordSet", default, skip_serializing_if = "Option::is_none")] - pub max_number_of_records_per_record_set: Option, - #[doc = "The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] - #[serde(rename = "numberOfRecordSets", default, skip_serializing_if = "Option::is_none")] - pub number_of_record_sets: Option, - #[doc = "The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] - #[serde( - rename = "nameServers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub name_servers: Vec, - #[doc = "The type of this DNS zone (Public or Private)."] - #[serde(rename = "zoneType", default, skip_serializing_if = "Option::is_none")] - pub zone_type: Option, -} -impl ZoneProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod zone_properties { - use super::*; - #[doc = "The type of this DNS zone (Public or Private)."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum ZoneType { - Public, - Private, - } - impl Default for ZoneType { - fn default() -> Self { - Self::Public - } - } -} diff --git a/services/mgmt/elastic/src/package_2021_10_01_preview/mod.rs b/services/mgmt/dns/src/package_2023_07_preview/mod.rs similarity index 76% rename from services/mgmt/elastic/src/package_2021_10_01_preview/mod.rs rename to services/mgmt/dns/src/package_2023_07_preview/mod.rs index ad96272d53..fa3ac23481 100644 --- a/services/mgmt/elastic/src/package_2021_10_01_preview/mod.rs +++ b/services/mgmt/dns/src/package_2023_07_preview/mod.rs @@ -103,56 +103,110 @@ impl Client { pipeline, } } - pub fn deployment_info_client(&self) -> deployment_info::Client { - deployment_info::Client(self.clone()) + pub fn dns_resource_reference_client(&self) -> dns_resource_reference::Client { + dns_resource_reference::Client(self.clone()) } - pub fn external_user_client(&self) -> external_user::Client { - external_user::Client(self.clone()) + pub fn dnssec_configs_client(&self) -> dnssec_configs::Client { + dnssec_configs::Client(self.clone()) } - pub fn monitor_client(&self) -> monitor::Client { - monitor::Client(self.clone()) + pub fn record_sets_client(&self) -> record_sets::Client { + record_sets::Client(self.clone()) } - pub fn monitored_resources_client(&self) -> monitored_resources::Client { - monitored_resources::Client(self.clone()) - } - pub fn monitors_client(&self) -> monitors::Client { - monitors::Client(self.clone()) - } - pub fn operations_client(&self) -> operations::Client { - operations::Client(self.clone()) - } - pub fn tag_rules_client(&self) -> tag_rules::Client { - tag_rules::Client(self.clone()) - } - pub fn upgradable_versions_client(&self) -> upgradable_versions::Client { - upgradable_versions::Client(self.clone()) - } - pub fn vm_collection_client(&self) -> vm_collection::Client { - vm_collection::Client(self.clone()) - } - pub fn vm_host_client(&self) -> vm_host::Client { - vm_host::Client(self.clone()) - } - pub fn vm_ingestion_client(&self) -> vm_ingestion::Client { - vm_ingestion::Client(self.clone()) + pub fn zones_client(&self) -> zones::Client { + zones::Client(self.clone()) } } -pub mod operations { +pub mod dnssec_configs { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List all operations provided by Microsoft.Elastic."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } + #[doc = "Gets the DNSSEC configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Creates or updates the DNSSEC configuration on a DNS zone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), + if_match: None, + if_none_match: None, + } + } + #[doc = "Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Lists the DNSSEC configurations in a DNS zone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_dns_zone( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, + ) -> list_by_dns_zone::RequestBuilder { + list_by_dns_zone::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), + } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + let body: models::DnssecConfig = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -189,183 +243,243 @@ pub mod operations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = - azure_core::Url::parse(&format!("{}/providers/Microsoft.Elastic/operations", this.client.endpoint(),))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/dnssecConfigs/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.zone_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } -} -pub mod monitors { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all monitors under the specified subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DnssecConfig = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "List all monitors under the specified resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - pub fn list_by_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Get the properties of a specific monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Create a monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - body: None, + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + pub(crate) if_none_match: Option, + } + impl RequestBuilder { + #[doc = "The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing DNSSEC configuration. Other values will be ignored."] + pub fn if_none_match(mut self, if_none_match: impl Into) -> Self { + self.if_none_match = Some(if_none_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/dnssecConfigs/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.zone_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + if let Some(if_none_match) = &this.if_none_match { + req.insert_header("if-none-match", if_none_match); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } - #[doc = "Update a monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - body: None, + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } - #[doc = "Delete a monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + } + impl RequestBuilder { + #[doc = "The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/dnssecConfigs/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.zone_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } } - pub mod list { + pub mod list_by_dns_zone { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ElasticMonitorResourceListResponse = serde_json::from_slice(&bytes)?; + let body: models::DnssecConfigListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -402,17 +516,21 @@ pub mod monitors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) zone_name: String, pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Elastic/monitors", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/dnssecConfigs", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.zone_name ))?; let rsp = match continuation { Some(value) => { @@ -430,7 +548,7 @@ pub mod monitors { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -446,7 +564,7 @@ pub mod monitors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -466,112 +584,185 @@ pub mod monitors { } } } - pub mod list_by_resource_group { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ElasticMonitorResourceListResponse = serde_json::from_slice(&bytes)?; - Ok(body) +} +pub mod record_sets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a record set."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] + #[doc = "* `record_type`: The type of DNS record in this record set."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + relative_record_set_name: impl Into, + record_type: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + relative_record_set_name: relative_record_set_name.into(), + record_type: record_type.into(), + subscription_id: subscription_id.into(), } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] + #[doc = "* `record_type`: The type of DNS record in this record set."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + relative_record_set_name: impl Into, + record_type: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + relative_record_set_name: relative_record_set_name.into(), + record_type: record_type.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + if_none_match: None, } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Updates a record set within a DNS zone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] + #[doc = "* `record_type`: The type of DNS record in this record set."] + #[doc = "* `parameters`: Parameters supplied to the Update operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + relative_record_set_name: impl Into, + record_type: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + relative_record_set_name: relative_record_set_name.into(), + record_type: record_type.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `relative_record_set_name`: The name of the record set, relative to the name of the zone."] + #[doc = "* `record_type`: The type of DNS record in this record set."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + relative_record_set_name: impl Into, + record_type: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + relative_record_set_name: relative_record_set_name.into(), + record_type: record_type.into(), + subscription_id: subscription_id.into(), + if_match: None, } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Lists the record sets of a specified type in a DNS zone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `record_type`: The type of DNS record in this record set."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_type( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + record_type: impl Into, + subscription_id: impl Into, + ) -> list_by_type::RequestBuilder { + list_by_type::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + record_type: record_type.into(), + subscription_id: subscription_id.into(), + top: None, + recordsetnamesuffix: None, + } + } + #[doc = "Lists all record sets in a DNS zone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_dns_zone( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, + ) -> list_by_dns_zone::RequestBuilder { + list_by_dns_zone::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), + top: None, + recordsetnamesuffix: None, } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) + #[doc = "Lists all record sets in a DNS zone."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_all_by_dns_zone( + &self, + resource_group_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, + ) -> list_all_by_dns_zone::RequestBuilder { + list_all_by_dns_zone::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), + top: None, + recordsetnamesuffix: None, } } } @@ -579,9 +770,9 @@ pub mod monitors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ElasticMonitorResource = serde_json::from_slice(&bytes)?; + let body: models::RecordSet = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -618,9 +809,11 @@ pub mod monitors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) zone_name: String, + pub(crate) relative_record_set_name: String, + pub(crate) record_type: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -632,11 +825,13 @@ pub mod monitors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name, + &this.record_type, + &this.relative_record_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -647,7 +842,7 @@ pub mod monitors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -656,8 +851,8 @@ pub mod monitors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -668,13 +863,13 @@ pub mod monitors { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ElasticMonitorResource = serde_json::from_slice(&bytes)?; + let body: models::RecordSet = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -711,18 +906,26 @@ pub mod monitors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) body: Option, + pub(crate) zone_name: String, + pub(crate) relative_record_set_name: String, + pub(crate) record_type: String, + pub(crate) parameters: models::RecordSet, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + pub(crate) if_none_match: Option, } impl RequestBuilder { - #[doc = "Elastic monitor resource model"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); + #[doc = "The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored."] + pub fn if_none_match(mut self, if_none_match: impl Into) -> Self { + self.if_none_match = Some(if_none_match.into()); self } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -732,11 +935,13 @@ pub mod monitors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name, + &this.record_type, + &this.relative_record_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -747,13 +952,15 @@ pub mod monitors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + if let Some(if_none_match) = &this.if_none_match { + req.insert_header("if-none-match", if_none_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -761,8 +968,8 @@ pub mod monitors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -777,9 +984,9 @@ pub mod monitors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ElasticMonitorResource = serde_json::from_slice(&bytes)?; + let body: models::RecordSet = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -816,15 +1023,18 @@ pub mod monitors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) body: Option, + pub(crate) zone_name: String, + pub(crate) relative_record_set_name: String, + pub(crate) record_type: String, + pub(crate) parameters: models::RecordSet, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "Elastic resource model update parameters."] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); + #[doc = "The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwriting concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); self } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -836,11 +1046,13 @@ pub mod monitors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name, + &this.record_type, + &this.relative_record_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -851,13 +1063,12 @@ pub mod monitors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -865,8 +1076,8 @@ pub mod monitors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -897,12 +1108,19 @@ pub mod monitors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) zone_name: String, + pub(crate) relative_record_set_name: String, + pub(crate) record_type: String, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -912,11 +1130,13 @@ pub mod monitors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name, + &this.record_type, + &this.relative_record_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -927,7 +1147,10 @@ pub mod monitors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -936,38 +1159,13 @@ pub mod monitors { } } } -} -pub mod monitored_resources { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List the resources currently being monitored by the Elastic monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - } - } - } - pub mod list { + pub mod list_by_type { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MonitoredResourceListResponse = serde_json::from_slice(&bytes)?; + let body: models::RecordSetListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1004,27 +1202,41 @@ pub mod monitored_resources { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) zone_name: String, + pub(crate) record_type: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) recordsetnamesuffix: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with ."] + pub fn recordsetnamesuffix(mut self, recordsetnamesuffix: impl Into) -> Self { + self.recordsetnamesuffix = Some(recordsetnamesuffix.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listMonitoredResources", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name, + &this.record_type ))?; let rsp = match continuation { Some(value) => { url.set_path(""); url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1036,14 +1248,14 @@ pub mod monitored_resources { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1052,9 +1264,16 @@ pub mod monitored_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(recordsetnamesuffix) = &this.recordsetnamesuffix { + req.url_mut() + .query_pairs_mut() + .append_pair("$recordsetnamesuffix", recordsetnamesuffix); + } let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); this.client.send(&mut req).await? } @@ -1073,38 +1292,13 @@ pub mod monitored_resources { } } } -} -pub mod deployment_info { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - } - } - } - pub mod list { + pub mod list_by_dns_zone { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DeploymentInfoResponse = serde_json::from_slice(&bytes)?; + let body: models::RecordSetListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1141,90 +1335,101 @@ pub mod deployment_info { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) recordsetnamesuffix: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with ."] + pub fn recordsetnamesuffix(mut self, recordsetnamesuffix: impl Into) -> Self { + self.recordsetnamesuffix = Some(recordsetnamesuffix.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listDeploymentInfo", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/recordsets", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(recordsetnamesuffix) = &this.recordsetnamesuffix { + req.url_mut() + .query_pairs_mut() + .append_pair("$recordsetnamesuffix", recordsetnamesuffix); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod external_user { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Create User inside elastic deployment which are used by customers to perform operations on the elastic deployment"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - body: None, + }; + azure_core::Pageable::new(make_request) } } } - pub mod create_or_update { + pub mod list_all_by_dns_zone { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ExternalUserCreationResponse = serde_json::from_slice(&bytes)?; + let body: models::RecordSetListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1261,166 +1466,221 @@ pub mod external_user { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) body: Option, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, + pub(crate) recordsetnamesuffix: Option, } impl RequestBuilder { - #[doc = "Elastic External User Creation Parameters"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); + #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with ."] + pub fn recordsetnamesuffix(mut self, recordsetnamesuffix: impl Into) -> Self { + self.recordsetnamesuffix = Some(recordsetnamesuffix.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/createOrUpdateExternalUser", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}/all", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(recordsetnamesuffix) = &this.recordsetnamesuffix { + req.url_mut() + .query_pairs_mut() + .append_pair("$recordsetnamesuffix", recordsetnamesuffix); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod tag_rules { +pub mod zones { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List the tag rules for a given monitor resource."] + #[doc = "Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn list( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( &self, - subscription_id: impl Into, resource_group_name: impl Into, - monitor_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + zone_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), + zone_name: zone_name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Get a tag rule set for a given monitor resource."] + #[doc = "Creates or updates a DNS zone. Does not modify DNS records within the zone."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - #[doc = "* `rule_set_name`: Tag Rule Set resource name"] - pub fn get( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `parameters`: Parameters supplied to the CreateOrUpdate operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( &self, - subscription_id: impl Into, resource_group_name: impl Into, - monitor_name: impl Into, - rule_set_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + zone_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - rule_set_name: rule_set_name.into(), + zone_name: zone_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, + if_none_match: None, } } - #[doc = "Create or update a tag rule set for a given monitor resource."] + #[doc = "Updates a DNS zone. Does not modify DNS records within the zone."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - #[doc = "* `rule_set_name`: Tag Rule Set resource name"] - pub fn create_or_update( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `parameters`: Parameters supplied to the Update operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn update( &self, - subscription_id: impl Into, resource_group_name: impl Into, - monitor_name: impl Into, - rule_set_name: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + zone_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - rule_set_name: rule_set_name.into(), - body: None, + zone_name: zone_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + if_match: None, } } - #[doc = "Delete a tag rule set for a given monitor resource."] + #[doc = "Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - #[doc = "* `rule_set_name`: Tag Rule Set resource name"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `zone_name`: The name of the DNS zone (without a terminating dot)."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, - subscription_id: impl Into, resource_group_name: impl Into, - monitor_name: impl Into, - rule_set_name: impl Into, + zone_name: impl Into, + subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + zone_name: zone_name.into(), subscription_id: subscription_id.into(), + if_match: None, + } + } + #[doc = "Lists the DNS zones within a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_resource_group( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - rule_set_name: rule_set_name.into(), + subscription_id: subscription_id.into(), + top: None, + } + } + #[doc = "Lists the DNS zones in all resource groups in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + top: None, } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MonitoringTagRulesListResponse = serde_json::from_slice(&bytes)?; + let body: models::Zone = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1457,81 +1717,63 @@ pub mod tag_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name + &this.zone_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MonitoringTagRules = serde_json::from_slice(&bytes)?; + let body: models::Zone = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1568,12 +1810,24 @@ pub mod tag_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) rule_set_name: String, + pub(crate) zone_name: String, + pub(crate) parameters: models::Zone, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, + pub(crate) if_none_match: Option, } impl RequestBuilder { + #[doc = "The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } + #[doc = "Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored."] + pub fn if_none_match(mut self, if_none_match: impl Into) -> Self { + self.if_none_match = Some(if_none_match.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1583,14 +1837,13 @@ pub mod tag_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name, - &this.rule_set_name + &this.zone_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1599,8 +1852,15 @@ pub mod tag_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } + if let Some(if_none_match) = &this.if_none_match { + req.insert_header("if-none-match", if_none_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1608,8 +1868,8 @@ pub mod tag_rules { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1620,13 +1880,13 @@ pub mod tag_rules { } } } - pub mod create_or_update { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MonitoringTagRules = serde_json::from_slice(&bytes)?; + let body: models::Zone = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1663,16 +1923,16 @@ pub mod tag_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) rule_set_name: String, - pub(crate) body: Option, + pub(crate) zone_name: String, + pub(crate) parameters: models::ZoneUpdate, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { - #[doc = "request body of MonitoringTagRules"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); + #[doc = "The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); self } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1684,14 +1944,13 @@ pub mod tag_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name, - &this.rule_set_name + &this.zone_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1700,13 +1959,12 @@ pub mod tag_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1714,8 +1972,8 @@ pub mod tag_rules { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1746,12 +2004,17 @@ pub mod tag_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) rule_set_name: String, + pub(crate) zone_name: String, + pub(crate) subscription_id: String, + pub(crate) if_match: Option, } impl RequestBuilder { + #[doc = "The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes."] + pub fn if_match(mut self, if_match: impl Into) -> Self { + self.if_match = Some(if_match.into()); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1762,12 +2025,11 @@ pub mod tag_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.monitor_name, - &this.rule_set_name + &this.zone_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -1778,7 +2040,10 @@ pub mod tag_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(if_match) = &this.if_match { + req.insert_header("if-match", if_match); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1787,38 +2052,13 @@ pub mod tag_rules { } } } -} -pub mod vm_host { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List the vm resources currently being monitored by the Elastic monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - } - } - } - pub mod list { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::VmHostListResponse = serde_json::from_slice(&bytes)?; + let body: models::ZoneListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1855,27 +2095,31 @@ pub mod vm_host { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) subscription_id: String, + pub(crate) top: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "The maximum number of record sets to return. If not specified, returns up to 100 record sets."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listVMHost", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dnsZones", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.monitor_name + &this.resource_group_name ))?; let rsp = match continuation { Some(value) => { url.set_path(""); url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1887,14 +2131,14 @@ pub mod vm_host { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1903,9 +2147,11 @@ pub mod vm_host { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); this.client.send(&mut req).await? } @@ -1924,38 +2170,13 @@ pub mod vm_host { } } } -} -pub mod vm_ingestion { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List the vm ingestion details that will be monitored by the Elastic monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn details( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> details::RequestBuilder { - details::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - } - } - } - pub mod details { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::VmIngestionDetailsResponse = serde_json::from_slice(&bytes)?; + let body: models::ZoneListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1993,183 +2214,107 @@ pub mod vm_ingestion { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/vmIngestionDetails", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.monitor_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod vm_collection { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Update the vm details that will be monitored by the Elastic monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - body: None, - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) body: Option, + pub(crate) top: Option, } impl RequestBuilder { - #[doc = "VM resource Id"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); + #[doc = "The maximum number of DNS zones to return. If not specified, returns up to 100 zones."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/vmCollectionUpdate", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Network/dnszones", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.monitor_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod upgradable_versions { +pub mod dns_resource_reference { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List of upgradable versions for a given monitor resource."] + #[doc = "Returns the DNS records specified by the referencing targetResourceIds."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn details( + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `parameters`: Properties for dns resource reference request."] + pub fn get_by_target_resources( &self, subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> details::RequestBuilder { - details::RequestBuilder { + parameters: impl Into, + ) -> get_by_target_resources::RequestBuilder { + get_by_target_resources::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), + parameters: parameters.into(), } } } - pub mod details { + pub mod get_by_target_resources { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::UpgradableVersionsList = serde_json::from_slice(&bytes)?; + let body: models::DnsResourceReferenceResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2207,8 +2352,7 @@ pub mod upgradable_versions { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, + pub(crate) parameters: models::DnsResourceReferenceRequest, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2220,11 +2364,9 @@ pub mod upgradable_versions { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listUpgradableVersions", + "{}/subscriptions/{}/providers/Microsoft.Network/getDnsResourceReference", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.monitor_name + &this.subscription_id ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); @@ -2235,9 +2377,9 @@ pub mod upgradable_versions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2023-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2245,8 +2387,8 @@ pub mod upgradable_versions { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2258,99 +2400,3 @@ pub mod upgradable_versions { } } } -pub mod monitor { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Upgradable version for a monitor resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] - #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] - #[doc = "* `monitor_name`: Monitor resource name"] - pub fn upgrade( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - monitor_name: impl Into, - ) -> upgrade::RequestBuilder { - upgrade::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - monitor_name: monitor_name.into(), - body: None, - } - } - } - pub mod upgrade { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) monitor_name: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "Elastic Monitor Upgrade Parameters"] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/upgrade", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.monitor_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} diff --git a/services/mgmt/dns/src/package_2023_07_preview/models.rs b/services/mgmt/dns/src/package_2023_07_preview/models.rs new file mode 100644 index 0000000000..5549541974 --- /dev/null +++ b/services/mgmt/dns/src/package_2023_07_preview/models.rs @@ -0,0 +1,952 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "An A record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ARecord { + #[doc = "The IPv4 address of this A record."] + #[serde(rename = "ipv4Address", default, skip_serializing_if = "Option::is_none")] + pub ipv4_address: Option, +} +impl ARecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An AAAA record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AaaaRecord { + #[doc = "The IPv6 address of this AAAA record."] + #[serde(rename = "ipv6Address", default, skip_serializing_if = "Option::is_none")] + pub ipv6_address: Option, +} +impl AaaaRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A CAA record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CaaRecord { + #[doc = "The flags for this CAA record as an integer between 0 and 255."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option, + #[doc = "The tag for this CAA record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tag: Option, + #[doc = "The value for this CAA record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl CaaRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An error response from the service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudError { + #[doc = "An error response from the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for CloudError { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl CloudError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An error response from the service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudErrorBody { + #[doc = "An identifier for the error. Codes are invariant and are intended to be consumed programmatically."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "A message describing the error, intended to be suitable for display in a user interface."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The target of the particular error. For example, the name of the property in error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "A list of additional details about the error."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl CloudErrorBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A CNAME record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CnameRecord { + #[doc = "The canonical name for this CNAME record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cname: Option, +} +impl CnameRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The delegation signer information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DelegationSignerInfo { + #[doc = "The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml"] + #[serde(rename = "digestAlgorithmType", default, skip_serializing_if = "Option::is_none")] + pub digest_algorithm_type: Option, + #[doc = "The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record."] + #[serde(rename = "digestValue", default, skip_serializing_if = "Option::is_none")] + pub digest_value: Option, + #[doc = "The record represents a delegation signer (DS) record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub record: Option, +} +impl DelegationSignerInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A digest."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Digest { + #[doc = "The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml"] + #[serde(rename = "algorithmType", default, skip_serializing_if = "Option::is_none")] + pub algorithm_type: Option, + #[doc = "The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl Digest { + pub fn new() -> Self { + Self::default() + } +} +pub type DigestAlgorithmType = i32; +#[doc = "Represents a single Azure resource and its referencing DNS records."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnsResourceReference { + #[doc = "A list of dns Records "] + #[serde( + rename = "dnsResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dns_resources: Vec, + #[doc = "A reference to a another resource"] + #[serde(rename = "targetResource", default, skip_serializing_if = "Option::is_none")] + pub target_resource: Option, +} +impl DnsResourceReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the properties of the Dns Resource Reference Request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnsResourceReferenceRequest { + #[doc = "Represents the properties of the Dns Resource Reference Request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DnsResourceReferenceRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the properties of the Dns Resource Reference Request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnsResourceReferenceRequestProperties { + #[doc = "A list of references to azure resources for which referencing dns records need to be queried."] + #[serde( + rename = "targetResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub target_resources: Vec, +} +impl DnsResourceReferenceRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the properties of the Dns Resource Reference Result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnsResourceReferenceResult { + #[doc = "The result of dns resource reference request. Returns a list of dns resource references for each of the azure resource in the request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DnsResourceReferenceResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The result of dns resource reference request. Returns a list of dns resource references for each of the azure resource in the request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnsResourceReferenceResultProperties { + #[doc = "The result of dns resource reference request. A list of dns resource references for each of the azure resource in the request"] + #[serde( + rename = "dnsResourceReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dns_resource_references: Vec, +} +impl DnsResourceReferenceResultProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the DNSSEC configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnssecConfig { + #[doc = "Represents the DNSSEC properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "The ID of the DNSSEC configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the DNSSEC configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the DNSSEC configuration."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The etag of the DNSSEC configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl DnssecConfig { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response to a List DNSSEC configurations operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnssecConfigListResult { + #[doc = "Information about the DNSSEC configurations in the response."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The continuation token for the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DnssecConfigListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DnssecConfigListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the DNSSEC properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DnssecProperties { + #[doc = "Provisioning State of the DNSSEC configuration."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The list of signing keys."] + #[serde( + rename = "signingKeys", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub signing_keys: Vec, +} +impl DnssecProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A DS record. For more information about the DS record format, see RFC 4034: https://www.rfc-editor.org/rfc/rfc4034"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DsRecord { + #[doc = "The key tag value is used to determine which DNSKEY Resource Record is used for signature verification."] + #[serde(rename = "keyTag", default, skip_serializing_if = "Option::is_none")] + pub key_tag: Option, + #[doc = "The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub algorithm: Option, + #[doc = "A digest."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub digest: Option, +} +impl DsRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An MX record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MxRecord { + #[doc = "The preference value for this MX record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preference: Option, + #[doc = "The domain name of the mail host for this MX record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exchange: Option, +} +impl MxRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A NAPTR record. For more information about the NAPTR record format, see RFC 3403: https://www.rfc-editor.org/rfc/rfc3403"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NaptrRecord { + #[doc = "The order in which the NAPTR records MUST be processed in order to accurately represent the ordered list of rules. The ordering is from lowest to highest. Valid values: 0-65535."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "The preference specifies the order in which NAPTR records with equal 'order' values should be processed, low numbers being processed before high numbers. Valid values: 0-65535."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preference: Option, + #[doc = "The flags specific to DDDS applications. Values currently defined in RFC 3404 are uppercase and lowercase letters \"A\", \"P\", \"S\", and \"U\", and the empty string, \"\". Enclose Flags in quotation marks."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option, + #[doc = "The services specific to DDDS applications. Enclose Services in quotation marks."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub services: Option, + #[doc = "The regular expression that the DDDS application uses to convert an input value into an output value. For example: an IP phone system might use a regular expression to convert a phone number that is entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for 'regexp' or a value for 'replacement'."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub regexp: Option, + #[doc = "The replacement is a fully qualified domain name (FQDN) of the next domain name that you want the DDDS application to submit a DNS query for. The DDDS application replaces the input value with the value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you specify a value for 'regexp', specify a dot (.) for 'replacement'."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub replacement: Option, +} +impl NaptrRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An NS record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NsRecord { + #[doc = "The name server name for this NS record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsdname: Option, +} +impl NsRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A PTR record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PtrRecord { + #[doc = "The PTR target domain name for this PTR record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ptrdname: Option, +} +impl PtrRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes a DNS record set (a collection of DNS records with the same name and type)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RecordSet { + #[doc = "The ID of the record set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the record set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the record set."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The etag of the record set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "Represents the properties of the records in the record set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RecordSet { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response to a record set List operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RecordSetListResult { + #[doc = "Information about the record sets in the response."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The continuation token for the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RecordSetListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RecordSetListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the properties of the records in the record set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RecordSetProperties { + #[doc = "The metadata attached to the record set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + #[doc = "The TTL (time-to-live) of the records in the record set."] + #[serde(rename = "TTL", default, skip_serializing_if = "Option::is_none")] + pub ttl: Option, + #[doc = "Fully qualified domain name of the record set."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fqdn: Option, + #[doc = "provisioning State of the record set."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "A reference to a another resource"] + #[serde(rename = "targetResource", default, skip_serializing_if = "Option::is_none")] + pub target_resource: Option, + #[doc = "The list of A records in the record set."] + #[serde( + rename = "ARecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub a_records: Vec, + #[doc = "The list of AAAA records in the record set."] + #[serde( + rename = "AAAARecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub aaaa_records: Vec, + #[doc = "The list of MX records in the record set."] + #[serde( + rename = "MXRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub mx_records: Vec, + #[doc = "The list of NS records in the record set."] + #[serde( + rename = "NSRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ns_records: Vec, + #[doc = "The list of PTR records in the record set."] + #[serde( + rename = "PTRRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ptr_records: Vec, + #[doc = "The list of SRV records in the record set."] + #[serde( + rename = "SRVRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub srv_records: Vec, + #[doc = "The list of TXT records in the record set."] + #[serde( + rename = "TXTRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub txt_records: Vec, + #[doc = "A CNAME record."] + #[serde(rename = "CNAMERecord", default, skip_serializing_if = "Option::is_none")] + pub cname_record: Option, + #[doc = "An SOA record."] + #[serde(rename = "SOARecord", default, skip_serializing_if = "Option::is_none")] + pub soa_record: Option, + #[doc = "The list of CAA records in the record set."] + #[serde( + rename = "caaRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub caa_records: Vec, + #[doc = "The list of DS records in the record set."] + #[serde( + rename = "DSRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ds_records: Vec, + #[doc = "The list of TLSA records in the record set."] + #[serde( + rename = "TLSARecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub tlsa_records: Vec, + #[doc = "The list of NAPTR records in the record set."] + #[serde( + rename = "NAPTRRecords", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub naptr_records: Vec, +} +impl RecordSetProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Parameters supplied to update a record set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RecordSetUpdateParameters { + #[doc = "Describes a DNS record set (a collection of DNS records with the same name and type)."] + #[serde(rename = "RecordSet", default, skip_serializing_if = "Option::is_none")] + pub record_set: Option, +} +impl RecordSetUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common properties of an Azure Resource Manager resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Resource { + #[doc = "Resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Resource location."] + pub location: String, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl Resource { + pub fn new(location: String) -> Self { + Self { + id: None, + name: None, + type_: None, + location, + tags: None, + } + } +} +pub type SecurityAlgorithmType = i32; +#[doc = "Represents the signing key."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SigningKey { + #[doc = "The delegation signer information."] + #[serde( + rename = "delegationSignerInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delegation_signer_info: Vec, + #[doc = "The flags specifies how the key is used."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub flags: Option, + #[doc = "The key tag value of the DNSKEY Resource Record."] + #[serde(rename = "keyTag", default, skip_serializing_if = "Option::is_none")] + pub key_tag: Option, + #[doc = "The protocol value. The value is always 3."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub protocol: Option, + #[doc = "The public key, represented as a Base64 encoding."] + #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] + pub public_key: Option, + #[doc = "The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml"] + #[serde(rename = "securityAlgorithmType", default, skip_serializing_if = "Option::is_none")] + pub security_algorithm_type: Option, +} +impl SigningKey { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An SOA record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoaRecord { + #[doc = "The domain name of the authoritative name server for this SOA record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub host: Option, + #[doc = "The email contact for this SOA record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, + #[doc = "The serial number for this SOA record."] + #[serde(rename = "serialNumber", default, skip_serializing_if = "Option::is_none")] + pub serial_number: Option, + #[doc = "The refresh value for this SOA record."] + #[serde(rename = "refreshTime", default, skip_serializing_if = "Option::is_none")] + pub refresh_time: Option, + #[doc = "The retry time for this SOA record."] + #[serde(rename = "retryTime", default, skip_serializing_if = "Option::is_none")] + pub retry_time: Option, + #[doc = "The expire time for this SOA record."] + #[serde(rename = "expireTime", default, skip_serializing_if = "Option::is_none")] + pub expire_time: Option, + #[doc = "The minimum value for this SOA record. By convention this is used to determine the negative caching duration."] + #[serde(rename = "minimumTTL", default, skip_serializing_if = "Option::is_none")] + pub minimum_ttl: Option, +} +impl SoaRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An SRV record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SrvRecord { + #[doc = "The priority value for this SRV record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub priority: Option, + #[doc = "The weight value for this SRV record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, + #[doc = "The port value for this SRV record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "The target domain name for this SRV record."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, +} +impl SrvRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A reference to a another resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubResource { + #[doc = "Resource Id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl SubResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A TLSA record. For more information about the TLSA record format, see RFC 6698: https://www.rfc-editor.org/rfc/rfc6698"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TlsaRecord { + #[doc = "The usage specifies the provided association that will be used to match the certificate presented in the TLS handshake."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, + #[doc = "The selector specifies which part of the TLS certificate presented by the server will be matched against the association data."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub selector: Option, + #[doc = "The matching type specifies how the certificate association is presented."] + #[serde(rename = "matchingType", default, skip_serializing_if = "Option::is_none")] + pub matching_type: Option, + #[doc = "This specifies the certificate association data to be matched."] + #[serde(rename = "certAssociationData", default, skip_serializing_if = "Option::is_none")] + pub cert_association_data: Option, +} +impl TlsaRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A TXT record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TxtRecord { + #[doc = "The text value of this TXT record."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl TxtRecord { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes a DNS zone."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Zone { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The etag of the zone."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "Represents the properties of the zone."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Zone { + pub fn new(resource: Resource) -> Self { + Self { + resource, + etag: None, + properties: None, + system_data: None, + } + } +} +#[doc = "The response to a Zone List or ListAll operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ZoneListResult { + #[doc = "Information about the DNS zones."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The continuation token for the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ZoneListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ZoneListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the properties of the zone."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ZoneProperties { + #[doc = "The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] + #[serde(rename = "maxNumberOfRecordSets", default, skip_serializing_if = "Option::is_none")] + pub max_number_of_record_sets: Option, + #[doc = "The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] + #[serde(rename = "maxNumberOfRecordsPerRecordSet", default, skip_serializing_if = "Option::is_none")] + pub max_number_of_records_per_record_set: Option, + #[doc = "The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] + #[serde(rename = "numberOfRecordSets", default, skip_serializing_if = "Option::is_none")] + pub number_of_record_sets: Option, + #[doc = "The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored."] + #[serde( + rename = "nameServers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub name_servers: Vec, + #[doc = "The type of this DNS zone (Public or Private)."] + #[serde(rename = "zoneType", default, skip_serializing_if = "Option::is_none")] + pub zone_type: Option, + #[doc = "A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private."] + #[serde( + rename = "registrationVirtualNetworks", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub registration_virtual_networks: Vec, + #[doc = "A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private."] + #[serde( + rename = "resolutionVirtualNetworks", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resolution_virtual_networks: Vec, + #[doc = "The list of signing keys."] + #[serde( + rename = "signingKeys", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub signing_keys: Vec, +} +impl ZoneProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod zone_properties { + use super::*; + #[doc = "The type of this DNS zone (Public or Private)."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ZoneType { + Public, + Private, + } + impl Default for ZoneType { + fn default() -> Self { + Self::Public + } + } +} +#[doc = "Describes a request to update a DNS zone."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ZoneUpdate { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl ZoneUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/elastic/Cargo.toml b/services/mgmt/elastic/Cargo.toml index e40eba6f0b..be1fa70288 100644 --- a/services/mgmt/elastic/Cargo.toml +++ b/services/mgmt/elastic/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2023-02-01-preview", "enable_reqwest"] +default = ["package-2023-05-01-preview", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-2023-05-01-preview" = [] "package-2023-02-01-preview" = [] "package-2022-09-01-preview" = [] "package-2022-07-01-preview" = [] -"package-2022-05-05-preview" = [] -"package-2021-10-01-preview" = [] \ No newline at end of file +"package-2022-05-05-preview" = [] \ No newline at end of file diff --git a/services/mgmt/elastic/README.md b/services/mgmt/elastic/README.md index 636dd4655b..4dc7954f8a 100644 --- a/services/mgmt/elastic/README.md +++ b/services/mgmt/elastic/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/elastic/re To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2023-02-01-preview`. +The default tag is `package-2023-05-01-preview`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-2023-05-01-preview` has 29 operations from 1 API versions: `2023-05-01-preview`. Use crate feature `package-2023-05-01-preview` to enable. The operations will be in the `package_2023_05_01_preview` module. - `package-2023-02-01-preview` has 29 operations from 1 API versions: `2023-02-01-preview`. Use crate feature `package-2023-02-01-preview` to enable. The operations will be in the `package_2023_02_01_preview` module. - `package-2022-09-01-preview` has 27 operations from 1 API versions: `2022-09-01-preview`. Use crate feature `package-2022-09-01-preview` to enable. The operations will be in the `package_2022_09_01_preview` module. - `package-2022-07-01-preview` has 27 operations from 1 API versions: `2022-07-01-preview`. Use crate feature `package-2022-07-01-preview` to enable. The operations will be in the `package_2022_07_01_preview` module. -- `package-2022-05-05-preview` has 27 operations from 1 API versions: `2022-05-05-preview`. Use crate feature `package-2022-05-05-preview` to enable. The operations will be in the `package_2022_05_05_preview` module. -- `package-2021-10-01-preview` has 19 operations from 1 API versions: `2021-10-01-preview`. Use crate feature `package-2021-10-01-preview` to enable. The operations will be in the `package_2021_10_01_preview` module. \ No newline at end of file +- `package-2022-05-05-preview` has 27 operations from 1 API versions: `2022-05-05-preview`. Use crate feature `package-2022-05-05-preview` to enable. The operations will be in the `package_2022_05_05_preview` module. \ No newline at end of file diff --git a/services/mgmt/elastic/src/lib.rs b/services/mgmt/elastic/src/lib.rs index c0b96567cc..dd137e5cba 100644 --- a/services/mgmt/elastic/src/lib.rs +++ b/services/mgmt/elastic/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-05-01-preview")] +pub mod package_2023_05_01_preview; +#[cfg(all(feature = "package-2023-05-01-preview", not(feature = "no-default-tag")))] +pub use package_2023_05_01_preview::*; #[cfg(feature = "package-2023-02-01-preview")] pub mod package_2023_02_01_preview; #[cfg(all(feature = "package-2023-02-01-preview", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_2022_07_01_preview::*; pub mod package_2022_05_05_preview; #[cfg(all(feature = "package-2022-05-05-preview", not(feature = "no-default-tag")))] pub use package_2022_05_05_preview::*; -#[cfg(feature = "package-2021-10-01-preview")] -pub mod package_2021_10_01_preview; -#[cfg(all(feature = "package-2021-10-01-preview", not(feature = "no-default-tag")))] -pub use package_2021_10_01_preview::*; diff --git a/services/mgmt/elastic/src/package_2023_02_01_preview/mod.rs b/services/mgmt/elastic/src/package_2023_02_01_preview/mod.rs index 6d9d72ee42..22c7b3ef77 100644 --- a/services/mgmt/elastic/src/package_2023_02_01_preview/mod.rs +++ b/services/mgmt/elastic/src/package_2023_02_01_preview/mod.rs @@ -1031,48 +1031,66 @@ pub mod elastic_versions { pub(crate) region: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( + let mut url = azure_core::Url::parse(&format!( "{}/subscriptions/{}/providers/Microsoft.Elastic/elasticVersions", this.client.endpoint(), &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let region = &this.region; - req.url_mut().query_pairs_mut().append_pair("region", region); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let region = &this.region; + req.url_mut().query_pairs_mut().append_pair("region", region); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } diff --git a/services/mgmt/elastic/src/package_2023_02_01_preview/models.rs b/services/mgmt/elastic/src/package_2023_02_01_preview/models.rs index 1375189b05..a27a66f82c 100644 --- a/services/mgmt/elastic/src/package_2023_02_01_preview/models.rs +++ b/services/mgmt/elastic/src/package_2023_02_01_preview/models.rs @@ -364,6 +364,30 @@ impl ElasticTrafficFilterRule { Self::default() } } +#[doc = "Elastic Version List Format"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticVersionListFormat { + #[doc = "Elastic Version Properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ElasticVersionListFormat { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Elastic Version Properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticVersionListProperties { + #[doc = "Available elastic version of the given region"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl ElasticVersionListProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "List of elastic versions available in a region."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ElasticVersionsListResponse { @@ -373,11 +397,17 @@ pub struct ElasticVersionsListResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "Link to the next set of results, if any."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, } +impl azure_core::Continuable for ElasticVersionsListResponse { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} impl ElasticVersionsListResponse { pub fn new() -> Self { Self::default() @@ -1071,11 +1101,21 @@ impl UpgradableVersionsList { #[doc = "The User Api Key created for the Organization associated with the User Email Id that was passed in the request"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserApiKeyResponse { - #[doc = "The User Api Key Generated based on ReturnApiKey flag. This is applicable for non-Portal clients only."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl UserApiKeyResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserApiKeyResponseProperties { + #[doc = "The User Api Key Generated based on GenerateApiKey flag. This is applicable for non-Portal clients only."] #[serde(rename = "apiKey", default, skip_serializing_if = "Option::is_none")] pub api_key: Option, } -impl UserApiKeyResponse { +impl UserApiKeyResponseProperties { pub fn new() -> Self { Self::default() } diff --git a/services/mgmt/redis/src/package_2020_06/mod.rs b/services/mgmt/elastic/src/package_2023_05_01_preview/mod.rs similarity index 74% rename from services/mgmt/redis/src/package_2020_06/mod.rs rename to services/mgmt/elastic/src/package_2023_05_01_preview/mod.rs index ec77d85b62..293fdda03f 100644 --- a/services/mgmt/redis/src/package_2020_06/mod.rs +++ b/services/mgmt/elastic/src/package_2023_05_01_preview/mod.rs @@ -103,33 +103,75 @@ impl Client { pipeline, } } - pub fn firewall_rules_client(&self) -> firewall_rules::Client { - firewall_rules::Client(self.clone()) + pub fn all_traffic_filters_client(&self) -> all_traffic_filters::Client { + all_traffic_filters::Client(self.clone()) } - pub fn linked_server_client(&self) -> linked_server::Client { - linked_server::Client(self.clone()) + pub fn associate_traffic_filter_client(&self) -> associate_traffic_filter::Client { + associate_traffic_filter::Client(self.clone()) + } + pub fn create_and_associate_ip_filter_client(&self) -> create_and_associate_ip_filter::Client { + create_and_associate_ip_filter::Client(self.clone()) + } + pub fn create_and_associate_pl_filter_client(&self) -> create_and_associate_pl_filter::Client { + create_and_associate_pl_filter::Client(self.clone()) + } + pub fn deployment_info_client(&self) -> deployment_info::Client { + deployment_info::Client(self.clone()) + } + pub fn detach_and_delete_traffic_filter_client(&self) -> detach_and_delete_traffic_filter::Client { + detach_and_delete_traffic_filter::Client(self.clone()) + } + pub fn detach_traffic_filter_client(&self) -> detach_traffic_filter::Client { + detach_traffic_filter::Client(self.clone()) + } + pub fn elastic_versions_client(&self) -> elastic_versions::Client { + elastic_versions::Client(self.clone()) + } + pub fn external_user_client(&self) -> external_user::Client { + external_user::Client(self.clone()) + } + pub fn list_associated_traffic_filters_client(&self) -> list_associated_traffic_filters::Client { + list_associated_traffic_filters::Client(self.clone()) + } + pub fn monitor_client(&self) -> monitor::Client { + monitor::Client(self.clone()) + } + pub fn monitored_resources_client(&self) -> monitored_resources::Client { + monitored_resources::Client(self.clone()) + } + pub fn monitors_client(&self) -> monitors::Client { + monitors::Client(self.clone()) } pub fn operations_client(&self) -> operations::Client { operations::Client(self.clone()) } - pub fn patch_schedules_client(&self) -> patch_schedules::Client { - patch_schedules::Client(self.clone()) + pub fn organizations_client(&self) -> organizations::Client { + organizations::Client(self.clone()) + } + pub fn tag_rules_client(&self) -> tag_rules::Client { + tag_rules::Client(self.clone()) } - pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { - private_endpoint_connections::Client(self.clone()) + pub fn traffic_filters_client(&self) -> traffic_filters::Client { + traffic_filters::Client(self.clone()) } - pub fn private_link_resources_client(&self) -> private_link_resources::Client { - private_link_resources::Client(self.clone()) + pub fn upgradable_versions_client(&self) -> upgradable_versions::Client { + upgradable_versions::Client(self.clone()) } - pub fn redis_client(&self) -> redis::Client { - redis::Client(self.clone()) + pub fn vm_collection_client(&self) -> vm_collection::Client { + vm_collection::Client(self.clone()) + } + pub fn vm_host_client(&self) -> vm_host::Client { + vm_host::Client(self.clone()) + } + pub fn vm_ingestion_client(&self) -> vm_ingestion::Client { + vm_ingestion::Client(self.clone()) } } pub mod operations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all of the available REST API operations of the Microsoft.Cache provider."] + #[doc = "List all operations provided by Microsoft.Elastic."] pub fn list(&self) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone() } } @@ -183,7 +225,8 @@ pub mod operations { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!("{}/providers/Microsoft.Cache/operations", this.client.endpoint(),))?; + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.Elastic/operations", this.client.endpoint(),))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -200,7 +243,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -216,7 +259,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -237,327 +280,122 @@ pub mod operations { } } } -pub mod redis { +pub mod monitors { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Checks that the redis cache name is valid and is not already in use."] + #[doc = "List all monitors under the specified subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `parameters`: Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'"] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn check_name_availability( - &self, - parameters: impl Into, - subscription_id: impl Into, - ) -> check_name_availability::RequestBuilder { - check_name_availability::RequestBuilder { + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), - parameters: parameters.into(), subscription_id: subscription_id.into(), } } - #[doc = "Gets any upgrade notifications for a Redis cache."] + #[doc = "List all monitors under the specified resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `history`: how many minutes in past to look for upgrade notifications"] - pub fn list_upgrade_notifications( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + pub fn list_by_resource_group( &self, - resource_group_name: impl Into, - name: impl Into, subscription_id: impl Into, - history: f64, - ) -> list_upgrade_notifications::RequestBuilder { - list_upgrade_notifications::RequestBuilder { + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), subscription_id: subscription_id.into(), - history, + resource_group_name: resource_group_name.into(), } } - #[doc = "Gets a Redis cache (resource description)."] + #[doc = "Get the properties of a specific monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] pub fn get( &self, - resource_group_name: impl Into, - name: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), } } - #[doc = "Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache."] + #[doc = "Create a monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `parameters`: Parameters supplied to the Create Redis operation."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] pub fn create( &self, - resource_group_name: impl Into, - name: impl Into, - parameters: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + body: None, } } - #[doc = "Update an existing Redis cache."] + #[doc = "Update a monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `parameters`: Parameters supplied to the Update Redis operation."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] pub fn update( &self, - resource_group_name: impl Into, - name: impl Into, - parameters: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + body: None, } } - #[doc = "Deletes a Redis cache."] + #[doc = "Delete a monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] pub fn delete( &self, - resource_group_name: impl Into, - name: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Lists all Redis caches in a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_resource_group( - &self, - resource_group_name: impl Into, - subscription_id: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets all Redis caches in the specified subscription."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { - list_by_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn list_keys( - &self, - resource_group_name: impl Into, - name: impl Into, - subscription_id: impl Into, - ) -> list_keys::RequestBuilder { - list_keys::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Regenerate Redis cache's access keys. This operation requires write permission to the cache resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `parameters`: Specifies which key to regenerate."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn regenerate_key( - &self, - resource_group_name: impl Into, - name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> regenerate_key::RequestBuilder { - regenerate_key::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `parameters`: Specifies which Redis node(s) to reboot."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn force_reboot( - &self, - resource_group_name: impl Into, - name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> force_reboot::RequestBuilder { - force_reboot::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Import data into Redis cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `parameters`: Parameters for Redis import operation."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn import_data( - &self, - resource_group_name: impl Into, - name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> import_data::RequestBuilder { - import_data::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), - } - } - #[doc = "Export data from the redis cache to blobs in a container."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `parameters`: Parameters for Redis export operation."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn export_data( - &self, - resource_group_name: impl Into, - name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> export_data::RequestBuilder { - export_data::RequestBuilder { - client: self.0.clone(), resource_group_name: resource_group_name.into(), - name: name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - } - pub mod check_name_availability { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) parameters: models::CheckNameAvailabilityParameters, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Cache/CheckNameAvailability", - this.client.endpoint(), - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + monitor_name: monitor_name.into(), } } } - pub mod list_upgrade_notifications { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::NotificationListResponse = serde_json::from_slice(&bytes)?; + let body: models::ElasticMonitorResourceListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -594,66 +432,77 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, pub(crate) subscription_id: String, - pub(crate) history: f64, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/listUpgradeNotifications", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Elastic/monitors", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let history = &this.history; - req.url_mut().query_pairs_mut().append_pair("history", &history.to_string()); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod get { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisResource = serde_json::from_slice(&bytes)?; + let body: models::ElasticMonitorResourceListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -690,27 +539,136 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.name + &this.resource_group_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ElasticMonitorResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.monitor_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -719,7 +677,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -728,8 +686,8 @@ pub mod redis { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -744,9 +702,9 @@ pub mod redis { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisResource = serde_json::from_slice(&bytes)?; + let body: models::ElasticMonitorResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -783,12 +741,17 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) parameters: models::RedisCreateParameters, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "Elastic monitor resource model"] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -799,11 +762,11 @@ pub mod redis { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name + &this.monitor_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -814,9 +777,13 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -824,8 +791,8 @@ pub mod redis { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -840,9 +807,9 @@ pub mod redis { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisResource = serde_json::from_slice(&bytes)?; + let body: models::ElasticMonitorResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -879,12 +846,17 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) parameters: models::RedisUpdateParameters, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "Elastic resource model update parameters."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -894,11 +866,11 @@ pub mod redis { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name + &this.monitor_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -909,9 +881,13 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -919,8 +895,8 @@ pub mod redis { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -951,9 +927,9 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -966,11 +942,11 @@ pub mod redis { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name + &this.monitor_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -981,7 +957,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -990,13 +966,31 @@ pub mod redis { } } } - pub mod list_by_resource_group { +} +pub mod elastic_versions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of available versions for a region."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `region`: Region where elastic deployment will take place."] + pub fn list(&self, subscription_id: impl Into, region: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + region: region.into(), + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisListResult = serde_json::from_slice(&bytes)?; + let body: models::ElasticVersionsListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1033,19 +1027,18 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, pub(crate) subscription_id: String, + pub(crate) region: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis", + "{}/subscriptions/{}/providers/Microsoft.Elastic/elasticVersions", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name + &this.subscription_id ))?; let rsp = match continuation { Some(value) => { @@ -1063,7 +1056,7 @@ pub mod redis { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1079,7 +1072,9 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let region = &this.region; + req.url_mut().query_pairs_mut().append_pair("region", region); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1099,13 +1094,38 @@ pub mod redis { } } } - pub mod list_by_subscription { +} +pub mod monitored_resources { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the resources currently being monitored by the Elastic monitor resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisListResult = serde_json::from_slice(&bytes)?; + let body: models::MonitoredResourceListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1143,22 +1163,26 @@ pub mod redis { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Cache/redis", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listMonitoredResources", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.monitor_name ))?; let rsp = match continuation { Some(value) => { url.set_path(""); url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1170,14 +1194,14 @@ pub mod redis { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1186,8 +1210,9 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); this.client.send(&mut req).await? } @@ -1206,202 +1231,38 @@ pub mod redis { } } } - pub mod list_keys { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RedisAccessKeys = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/listKeys", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod regenerate_key { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RedisAccessKeys = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) parameters: models::RedisRegenerateKeyParameters, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/regenerateKey", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) +} +pub mod deployment_info { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), } } } - pub mod force_reboot { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisForceRebootResponse = serde_json::from_slice(&bytes)?; + let body: models::DeploymentInfoResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1410,89 +1271,17 @@ pub mod redis { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) parameters: models::RedisRebootParameters, - pub(crate) subscription_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/forceReboot", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - } - pub mod import_data { - use super::models; - pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1510,13 +1299,11 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) parameters: models::ImportRdbParameters, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1526,11 +1313,11 @@ pub mod redis { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/import", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listDeploymentInfo", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name + &this.monitor_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); @@ -1541,19 +1328,80 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod external_user { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create User inside elastic deployment which are used by customers to perform operations on the elastic deployment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + body: None, + } + } } - pub mod export_data { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalUserCreationResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1571,13 +1419,17 @@ pub mod redis { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) parameters: models::ExportRdbParameters, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) body: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Elastic External User Creation Parameters"] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1587,11 +1439,11 @@ pub mod redis { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/export", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/createOrUpdateExternalUser", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name + &this.monitor_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); @@ -1602,107 +1454,121 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod firewall_rules { +pub mod tag_rules { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all firewall rules in the specified redis cache."] + #[doc = "List the tag rules for a given monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - cache_name: impl Into, + monitor_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), + monitor_name: monitor_name.into(), } } - #[doc = "Gets a single firewall rule in a specified redis cache."] + #[doc = "Get a tag rule set for a given monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `rule_name`: The name of the firewall rule."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + #[doc = "* `rule_set_name`: Tag Rule Set resource name"] pub fn get( &self, - resource_group_name: impl Into, - cache_name: impl Into, - rule_name: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + rule_set_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - rule_name: rule_name.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + rule_set_name: rule_set_name.into(), } } - #[doc = "Create or update a redis cache firewall rule"] + #[doc = "Create or update a tag rule set for a given monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `rule_name`: The name of the firewall rule."] - #[doc = "* `parameters`: Parameters supplied to the create or update redis firewall rule operation."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + #[doc = "* `rule_set_name`: Tag Rule Set resource name"] pub fn create_or_update( &self, - resource_group_name: impl Into, - cache_name: impl Into, - rule_name: impl Into, - parameters: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + rule_set_name: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - rule_name: rule_name.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + rule_set_name: rule_set_name.into(), + body: None, } } - #[doc = "Deletes a single firewall rule in a specified redis cache."] + #[doc = "Delete a tag rule set for a given monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `rule_name`: The name of the firewall rule."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + #[doc = "* `rule_set_name`: Tag Rule Set resource name"] pub fn delete( &self, - resource_group_name: impl Into, - cache_name: impl Into, - rule_name: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + rule_set_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - rule_name: rule_name.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + rule_set_name: rule_set_name.into(), } } } @@ -1710,9 +1576,9 @@ pub mod firewall_rules { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisFirewallRuleListResult = serde_json::from_slice(&bytes)?; + let body: models::MonitoringTagRulesListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1751,19 +1617,19 @@ pub mod firewall_rules { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) cache_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name + &this.monitor_name ))?; let rsp = match continuation { Some(value) => { @@ -1781,7 +1647,7 @@ pub mod firewall_rules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1797,7 +1663,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1821,9 +1687,9 @@ pub mod firewall_rules { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisFirewallRule = serde_json::from_slice(&bytes)?; + let body: models::MonitoringTagRules = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1860,10 +1726,10 @@ pub mod firewall_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, - pub(crate) rule_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) rule_set_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1875,12 +1741,12 @@ pub mod firewall_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.rule_name + &this.monitor_name, + &this.rule_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -1891,7 +1757,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1900,8 +1766,8 @@ pub mod firewall_rules { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1916,9 +1782,9 @@ pub mod firewall_rules { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisFirewallRule = serde_json::from_slice(&bytes)?; + let body: models::MonitoringTagRules = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1955,13 +1821,18 @@ pub mod firewall_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, - pub(crate) rule_name: String, - pub(crate) parameters: models::RedisFirewallRuleCreateParameters, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) rule_set_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "request body of MonitoringTagRules"] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1971,12 +1842,12 @@ pub mod firewall_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.rule_name + &this.monitor_name, + &this.rule_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -1987,9 +1858,13 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1997,8 +1872,8 @@ pub mod firewall_rules { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2029,12 +1904,13 @@ pub mod firewall_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, - pub(crate) rule_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) rule_set_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2044,12 +1920,12 @@ pub mod firewall_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/tagRules/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.rule_name + &this.monitor_name, + &this.rule_set_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -2060,7 +1936,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2070,106 +1946,37 @@ pub mod firewall_rules { } } } -pub mod patch_schedules { +pub mod vm_host { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all patch schedules in the specified redis cache (there is only one)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - pub fn list_by_redis_resource( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - cache_name: impl Into, - ) -> list_by_redis_resource::RequestBuilder { - list_by_redis_resource::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - } - } - #[doc = "Gets the patching schedule of a redis cache."] + #[doc = "List the vm resources currently being monitored by the Elastic monitor resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the redis cache."] - #[doc = "* `default`: Default string modeled as parameter for auto generation to work correctly."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn list( &self, - resource_group_name: impl Into, - name: impl Into, - default: impl Into, subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - default: default.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Create or replace the patching schedule for Redis cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `default`: Default string modeled as parameter for auto generation to work correctly."] - #[doc = "* `parameters`: Parameters to set the patching schedule for Redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create_or_update( - &self, resource_group_name: impl Into, - name: impl Into, - default: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + monitor_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - default: default.into(), - parameters: parameters.into(), subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes the patching schedule of a redis cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the redis cache."] - #[doc = "* `default`: Default string modeled as parameter for auto generation to work correctly."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - name: impl Into, - default: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), resource_group_name: resource_group_name.into(), - name: name.into(), - default: default.into(), - subscription_id: subscription_id.into(), + monitor_name: monitor_name.into(), } } } - pub mod list_by_redis_resource { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisPatchScheduleListResult = serde_json::from_slice(&bytes)?; + let body: models::VmHostListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2208,25 +2015,25 @@ pub mod patch_schedules { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) cache_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listVMHost", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name + &this.monitor_name ))?; let rsp = match continuation { Some(value) => { url.set_path(""); url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2238,14 +2045,14 @@ pub mod patch_schedules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2254,8 +2061,9 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); this.client.send(&mut req).await? } @@ -2274,13 +2082,38 @@ pub mod patch_schedules { } } } - pub mod get { +} +pub mod vm_ingestion { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the vm ingestion details that will be monitored by the Elastic monitor resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn details( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> details::RequestBuilder { + details::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + } + } + } + pub mod details { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisPatchSchedule = serde_json::from_slice(&bytes)?; + let body: models::VmIngestionDetailsResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2317,12 +2150,114 @@ pub mod patch_schedules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) default: String, + pub(crate) monitor_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/vmIngestionDetails", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.monitor_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod vm_collection { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Update the vm details that will be monitored by the Elastic monitor resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + body: None, + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "VM resource Id"] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2332,14 +2267,13 @@ pub mod patch_schedules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/vmCollectionUpdate", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name, - &this.default + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2348,34 +2282,52 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod upgradable_versions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of upgradable versions for a given monitor resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn details( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> details::RequestBuilder { + details::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), } } } - pub mod create_or_update { + pub mod details { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisPatchSchedule = serde_json::from_slice(&bytes)?; + let body: models::UpgradableVersionsList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2412,11 +2364,9 @@ pub mod patch_schedules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) default: String, - pub(crate) parameters: models::RedisPatchSchedule, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2428,14 +2378,13 @@ pub mod patch_schedules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listUpgradableVersions", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name, - &this.default + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2444,9 +2393,9 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2454,8 +2403,8 @@ pub mod patch_schedules { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2466,7 +2415,33 @@ pub mod patch_schedules { } } } - pub mod delete { +} +pub mod monitor { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Upgradable version for a monitor resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn upgrade( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> upgrade::RequestBuilder { + upgrade::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + body: None, + } + } + } + pub mod upgrade { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -2486,12 +2461,18 @@ pub mod patch_schedules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) default: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "Elastic Monitor Upgrade Parameters"] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2501,14 +2482,13 @@ pub mod patch_schedules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/upgrade", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name, - &this.default + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2517,8 +2497,13 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2527,106 +2512,37 @@ pub mod patch_schedules { } } } -pub mod linked_server { +pub mod all_traffic_filters { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets the detailed information about a linked server of a redis cache (requires Premium SKU)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the redis cache."] - #[doc = "* `linked_server_name`: The name of the linked server."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn get( - &self, - resource_group_name: impl Into, - name: impl Into, - linked_server_name: impl Into, - subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - linked_server_name: linked_server_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Adds a linked server to the Redis cache (requires Premium SKU)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the Redis cache."] - #[doc = "* `linked_server_name`: The name of the linked server that is being added to the Redis cache."] - #[doc = "* `parameters`: Parameters supplied to the Create Linked server operation."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn create( - &self, - resource_group_name: impl Into, - name: impl Into, - linked_server_name: impl Into, - parameters: impl Into, - subscription_id: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - linked_server_name: linked_server_name.into(), - parameters: parameters.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Deletes the linked server from a redis cache (requires Premium SKU)."] + #[doc = "Get the list of all traffic filters for the account."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the redis cache."] - #[doc = "* `linked_server_name`: The name of the linked server that is being added to the Redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] - pub fn delete( - &self, - resource_group_name: impl Into, - name: impl Into, - linked_server_name: impl Into, - subscription_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), - linked_server_name: linked_server_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the list of linked servers associated with this redis cache (requires Premium SKU)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `name`: The name of the redis cache."] - #[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] pub fn list( &self, - resource_group_name: impl Into, - name: impl Into, subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - name: name.into(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), } } } - pub mod get { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisLinkedServerWithProperties = serde_json::from_slice(&bytes)?; + let body: models::ElasticTrafficFilterResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2663,10 +2579,9 @@ pub mod linked_server { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) linked_server_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2678,14 +2593,13 @@ pub mod linked_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listAllTrafficFilters", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name, - &this.linked_server_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2694,8 +2608,9 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2703,8 +2618,8 @@ pub mod linked_server { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2715,13 +2630,38 @@ pub mod linked_server { } } } - pub mod create { +} +pub mod list_associated_traffic_filters { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the list of all associated traffic filters for the given deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RedisLinkedServerWithProperties = serde_json::from_slice(&bytes)?; + let body: models::ElasticTrafficFilterResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2758,14 +2698,11 @@ pub mod linked_server { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) linked_server_name: String, - pub(crate) parameters: models::RedisLinkedServerCreateParameters, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2775,14 +2712,13 @@ pub mod linked_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/listAssociatedTrafficFilters", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name, - &this.linked_server_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2791,9 +2727,9 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2801,8 +2737,8 @@ pub mod linked_server { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2813,7 +2749,34 @@ pub mod linked_server { } } } - pub mod delete { +} +pub mod create_and_associate_ip_filter { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create and Associate IP traffic filter for the given deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + ips: None, + name: None, + } + } + } + pub mod create { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -2833,12 +2796,24 @@ pub mod linked_server { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, - pub(crate) linked_server_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) ips: Option, + pub(crate) name: Option, } impl RequestBuilder { + #[doc = "List of ips"] + pub fn ips(mut self, ips: impl Into) -> Self { + self.ips = Some(ips.into()); + self + } + #[doc = "Name of the traffic filter"] + pub fn name(mut self, name: impl Into) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2848,14 +2823,13 @@ pub mod linked_server { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/createAndAssociateIPFilter", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.name, - &this.linked_server_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2864,8 +2838,15 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(ips) = &this.ips { + req.url_mut().query_pairs_mut().append_pair("ips", ips); + } + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2873,32 +2854,37 @@ pub mod linked_server { } } } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RedisLinkedServerWithPropertiesList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() +} +pub mod create_and_associate_pl_filter { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create and Associate private link traffic filter for the given deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + name: None, + private_endpoint_guid: None, + private_endpoint_name: None, } } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -2916,194 +2902,106 @@ pub mod linked_server { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) name: String, pub(crate) subscription_id: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) name: Option, + pub(crate) private_endpoint_guid: Option, + pub(crate) private_endpoint_name: Option, + } + impl RequestBuilder { + #[doc = "Name of the traffic filter"] + pub fn name(mut self, name: impl Into) -> Self { + self.name = Some(name.into()); + self + } + #[doc = "Guid of the private endpoint"] + pub fn private_endpoint_guid(mut self, private_endpoint_guid: impl Into) -> Self { + self.private_endpoint_guid = Some(private_endpoint_guid.into()); + self + } + #[doc = "Name of the private endpoint"] + pub fn private_endpoint_name(mut self, private_endpoint_name: impl Into) -> Self { + self.private_endpoint_name = Some(private_endpoint_name.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/createAndAssociatePLFilter", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.monitor_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(private_endpoint_guid) = &this.private_endpoint_guid { + req.url_mut() + .query_pairs_mut() + .append_pair("privateEndpointGuid", private_endpoint_guid); + } + if let Some(private_endpoint_name) = &this.private_endpoint_name { + req.url_mut() + .query_pairs_mut() + .append_pair("privateEndpointName", private_endpoint_name); + } + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } } -pub mod private_endpoint_connections { +pub mod associate_traffic_filter { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List all the private endpoint connections associated with the redis cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list( - &self, - resource_group_name: impl Into, - cache_name: impl Into, - subscription_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Gets the specified private endpoint connection associated with the redis cache."] + #[doc = "Associate traffic filter for the given deployment."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the Azure resource"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn get( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn associate( &self, - resource_group_name: impl Into, - cache_name: impl Into, - private_endpoint_connection_name: impl Into, subscription_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - subscription_id: subscription_id.into(), - } - } - #[doc = "Update the state of specified private endpoint connection associated with the redis cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the Azure resource"] - #[doc = "* `properties`: The private endpoint connection properties."] - pub fn put( - &self, resource_group_name: impl Into, - cache_name: impl Into, - subscription_id: impl Into, - private_endpoint_connection_name: impl Into, - properties: impl Into, - ) -> put::RequestBuilder { - put::RequestBuilder { + monitor_name: impl Into, + ) -> associate::RequestBuilder { + associate::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), subscription_id: subscription_id.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), - properties: properties.into(), - } - } - #[doc = "Deletes the specified private endpoint connection associated with the redis cache."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the Azure resource"] - pub fn delete( - &self, - resource_group_name: impl Into, - cache_name: impl Into, - subscription_id: impl Into, - private_endpoint_connection_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), - subscription_id: subscription_id.into(), - private_endpoint_connection_name: private_endpoint_connection_name.into(), + monitor_name: monitor_name.into(), + ruleset_id: None, } } } - pub mod list { + pub mod associate { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3121,12 +3019,18 @@ pub mod private_endpoint_connections { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) ruleset_id: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Ruleset Id of the filter"] + pub fn ruleset_id(mut self, ruleset_id: impl Into) -> Self { + self.ruleset_id = Some(ruleset_id.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3136,13 +3040,13 @@ pub mod private_endpoint_connections { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/associateTrafficFilter", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3151,8 +3055,12 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(ruleset_id) = &this.ruleset_id { + req.url_mut().query_pairs_mut().append_pair("rulesetId", ruleset_id); + } let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3160,32 +3068,35 @@ pub mod private_endpoint_connections { } } } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() +} +pub mod detach_and_delete_traffic_filter { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Detach and Delete traffic filter from the given deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + ruleset_id: None, } } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3203,12 +3114,17 @@ pub mod private_endpoint_connections { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, - pub(crate) private_endpoint_connection_name: String, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) ruleset_id: Option, } impl RequestBuilder { + #[doc = "Ruleset Id of the filter"] + pub fn ruleset_id(mut self, ruleset_id: impl Into) -> Self { + self.ruleset_id = Some(ruleset_id.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3218,14 +3134,13 @@ pub mod private_endpoint_connections { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/detachAndDeleteTrafficFilter", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.private_endpoint_connection_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3234,53 +3149,48 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(ruleset_id) = &this.ruleset_id { + req.url_mut().query_pairs_mut().append_pair("rulesetId", ruleset_id); + } let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod detach_traffic_filter { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Detach traffic filter for the given deployment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + ruleset_id: None, } } } - pub mod put { + pub mod update { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3298,13 +3208,17 @@ pub mod private_endpoint_connections { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, pub(crate) subscription_id: String, - pub(crate) private_endpoint_connection_name: String, - pub(crate) properties: models::PrivateEndpointConnection, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) ruleset_id: Option, } impl RequestBuilder { + #[doc = "Ruleset Id of the filter"] + pub fn ruleset_id(mut self, ruleset_id: impl Into) -> Self { + self.ruleset_id = Some(ruleset_id.into()); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3315,14 +3229,13 @@ pub mod private_endpoint_connections { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/detachTrafficFilter", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.private_endpoint_connection_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3331,25 +3244,42 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.properties)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(ruleset_id) = &this.ruleset_id { + req.url_mut().query_pairs_mut().append_pair("rulesetId", ruleset_id); + } + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod traffic_filters { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Delete traffic filter from the account."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + #[doc = "* `resource_group_name`: The name of the resource group to which the Elastic resource belongs."] + #[doc = "* `monitor_name`: Monitor resource name"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + monitor_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + monitor_name: monitor_name.into(), + ruleset_id: None, } } } @@ -3373,12 +3303,17 @@ pub mod private_endpoint_connections { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, pub(crate) subscription_id: String, - pub(crate) private_endpoint_connection_name: String, + pub(crate) resource_group_name: String, + pub(crate) monitor_name: String, + pub(crate) ruleset_id: Option, } impl RequestBuilder { + #[doc = "Ruleset Id of the filter"] + pub fn ruleset_id(mut self, ruleset_id: impl Into) -> Self { + self.ruleset_id = Some(ruleset_id.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3388,14 +3323,13 @@ pub mod private_endpoint_connections { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Elastic/monitors/{}/deleteTrafficFilter", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.cache_name, - &this.private_endpoint_connection_name + &this.monitor_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3404,8 +3338,12 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(ruleset_id) = &this.ruleset_id { + req.url_mut().query_pairs_mut().append_pair("rulesetId", ruleset_id); + } let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3414,37 +3352,30 @@ pub mod private_endpoint_connections { } } } -pub mod private_link_resources { +pub mod organizations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets the private link resources that need to be created for a redis cache."] + #[doc = "Fetch User API Key from internal database, if it was generated and stored while creating the Elasticsearch Organization."] + #[doc = "Fetch User API Key from internal database, if it was generated and stored while creating the Elasticsearch Organization."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `resource_group_name`: The name of the resource group."] - #[doc = "* `cache_name`: The name of the Redis cache."] - #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list_by_redis_cache( - &self, - resource_group_name: impl Into, - cache_name: impl Into, - subscription_id: impl Into, - ) -> list_by_redis_cache::RequestBuilder { - list_by_redis_cache::RequestBuilder { + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)"] + pub fn get_api_key(&self, subscription_id: impl Into) -> get_api_key::RequestBuilder { + get_api_key::RequestBuilder { client: self.0.clone(), - resource_group_name: resource_group_name.into(), - cache_name: cache_name.into(), subscription_id: subscription_id.into(), + body: None, } } } - pub mod list_by_redis_cache { + pub mod get_api_key { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PrivateLinkResourceListResult = serde_json::from_slice(&bytes)?; + let body: models::UserApiKeyResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3481,12 +3412,15 @@ pub mod private_link_resources { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) resource_group_name: String, - pub(crate) cache_name: String, pub(crate) subscription_id: String, + pub(crate) body: Option, } impl RequestBuilder { - #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Email Id parameter of the User Organization, of which the API Key must be returned"] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3496,13 +3430,11 @@ pub mod private_link_resources { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateLinkResources", + "{}/subscriptions/{}/providers/Microsoft.Elastic/getOrganizationApiKey", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.cache_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3511,13 +3443,30 @@ pub mod private_link_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-06-01"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } diff --git a/services/mgmt/elastic/src/package_2021_10_01_preview/models.rs b/services/mgmt/elastic/src/package_2023_05_01_preview/models.rs similarity index 81% rename from services/mgmt/elastic/src/package_2021_10_01_preview/models.rs rename to services/mgmt/elastic/src/package_2023_05_01_preview/models.rs index c6625c706d..c6537ccda9 100644 --- a/services/mgmt/elastic/src/package_2021_10_01_preview/models.rs +++ b/services/mgmt/elastic/src/package_2023_05_01_preview/models.rs @@ -42,6 +42,12 @@ pub struct DeploymentInfoResponse { #[doc = "Disk capacity of the elasticsearch in Elastic cloud deployment."] #[serde(rename = "diskCapacity", default, skip_serializing_if = "Option::is_none")] pub disk_capacity: Option, + #[doc = "Deployment URL of the elasticsearch in Elastic cloud deployment."] + #[serde(rename = "deploymentUrl", default, skip_serializing_if = "Option::is_none")] + pub deployment_url: Option, + #[doc = "Marketplace SAAS Info of the resource."] + #[serde(rename = "marketplaceSaasInfo", default, skip_serializing_if = "Option::is_none")] + pub marketplace_saas_info: Option, } impl DeploymentInfoResponse { pub fn new() -> Self { @@ -242,6 +248,171 @@ impl ElasticProperties { Self::default() } } +#[doc = "Elastic traffic filter object"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticTrafficFilter { + #[doc = "Id of the elastic filter"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the elastic filter"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Description of the elastic filter"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Region of the elastic filter"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "Type of the elastic filter"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "IncludeByDefault for the elastic filter"] + #[serde(rename = "includeByDefault", default, skip_serializing_if = "Option::is_none")] + pub include_by_default: Option, + #[doc = "Rules in the elastic filter"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, +} +impl ElasticTrafficFilter { + pub fn new() -> Self { + Self::default() + } +} +pub mod elastic_traffic_filter { + use super::*; + #[doc = "Type of the elastic filter"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + #[serde(rename = "ip")] + Ip, + #[serde(rename = "azure_private_endpoint")] + AzurePrivateEndpoint, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Ip => serializer.serialize_unit_variant("Type", 0u32, "ip"), + Self::AzurePrivateEndpoint => serializer.serialize_unit_variant("Type", 1u32, "azure_private_endpoint"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of elastic traffic filters in the account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticTrafficFilterResponse { + #[doc = "List of elastic traffic filters in the account"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rulesets: Vec, +} +impl ElasticTrafficFilterResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Elastic traffic filter rule object"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticTrafficFilterRule { + #[doc = "IP of the elastic filter rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "Description of the elastic filter rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Guid of Private Endpoint in the elastic filter rule"] + #[serde(rename = "azureEndpointGuid", default, skip_serializing_if = "Option::is_none")] + pub azure_endpoint_guid: Option, + #[doc = "Name of the Private Endpoint in the elastic filter rule"] + #[serde(rename = "azureEndpointName", default, skip_serializing_if = "Option::is_none")] + pub azure_endpoint_name: Option, + #[doc = "Id of the elastic filter rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ElasticTrafficFilterRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Elastic Version List Format"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticVersionListFormat { + #[doc = "Elastic Version Properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ElasticVersionListFormat { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Elastic Version Properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticVersionListProperties { + #[doc = "Available elastic version of the given region"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl ElasticVersionListProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of elastic versions available in a region."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ElasticVersionsListResponse { + #[doc = "Results of a list operation."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to the next set of results, if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ElasticVersionsListResponse { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ElasticVersionsListResponse { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Error response body."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorResponseBody { @@ -440,6 +611,42 @@ impl Serialize for ManagedIdentityTypes { } } } +#[doc = "Marketplace SAAS Info of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MarketplaceSaaSInfo { + #[doc = "Marketplace Subscription"] + #[serde(rename = "marketplaceSubscription", default, skip_serializing_if = "Option::is_none")] + pub marketplace_subscription: Option, + #[doc = "Marketplace Subscription Details: SAAS Name"] + #[serde(rename = "marketplaceName", default, skip_serializing_if = "Option::is_none")] + pub marketplace_name: Option, + #[doc = "Marketplace Subscription Details: Resource URI"] + #[serde(rename = "marketplaceResourceId", default, skip_serializing_if = "Option::is_none")] + pub marketplace_resource_id: Option, + #[doc = "Marketplace Subscription Details: SaaS Subscription Status"] + #[serde(rename = "marketplaceStatus", default, skip_serializing_if = "Option::is_none")] + pub marketplace_status: Option, +} +impl MarketplaceSaaSInfo { + pub fn new() -> Self { + Self::default() + } +} +pub mod marketplace_saa_s_info { + use super::*; + #[doc = "Marketplace Subscription"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MarketplaceSubscription { + #[doc = "Marketplace Subscription Id. This is a GUID-formatted string."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + } + impl MarketplaceSubscription { + pub fn new() -> Self { + Self::default() + } + } +} #[doc = "Properties specific to the monitor resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MonitorProperties { @@ -463,6 +670,9 @@ pub struct MonitorProperties { #[doc = "The priority of the resource."] #[serde(rename = "liftrResourcePreference", default, skip_serializing_if = "Option::is_none")] pub liftr_resource_preference: Option, + #[doc = "Flag to determine if User API Key has to be generated and shared."] + #[serde(rename = "generateApiKey", default, skip_serializing_if = "Option::is_none")] + pub generate_api_key: Option, } impl MonitorProperties { pub fn new() -> Self { @@ -891,6 +1101,40 @@ impl UpgradableVersionsList { Self::default() } } +#[doc = "The User Api Key created for the Organization associated with the User Email Id that was passed in the request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserApiKeyResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl UserApiKeyResponse { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserApiKeyResponseProperties { + #[doc = "The User Api Key Generated based on GenerateApiKey flag. This is applicable for non-Portal clients only."] + #[serde(rename = "apiKey", default, skip_serializing_if = "Option::is_none")] + pub api_key: Option, +} +impl UserApiKeyResponseProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Email Id of the User Organization, of which the API Key must be returned"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserEmailId { + #[doc = "The User email Id"] + #[serde(rename = "emailId", default, skip_serializing_if = "Option::is_none")] + pub email_id: Option, +} +impl UserEmailId { + pub fn new() -> Self { + Self::default() + } +} #[doc = "User Information to be passed to partners."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct UserInfo { diff --git a/services/mgmt/eventgrid/Cargo.toml b/services/mgmt/eventgrid/Cargo.toml index 39b047c749..c2d7b5d77e 100644 --- a/services/mgmt/eventgrid/Cargo.toml +++ b/services/mgmt/eventgrid/Cargo.toml @@ -36,6 +36,7 @@ default = ["package-2022-06", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-2023-06-preview" = [] "package-2022-06" = [] "package-2021-12" = [] "package-2021-10-preview" = [] \ No newline at end of file diff --git a/services/mgmt/eventgrid/README.md b/services/mgmt/eventgrid/README.md index 9694e85d62..9a8e4a745c 100644 --- a/services/mgmt/eventgrid/README.md +++ b/services/mgmt/eventgrid/README.md @@ -10,6 +10,7 @@ The default tag is `package-2022-06`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-2023-06-preview` has 174 operations from 1 API versions: `2023-06-01-preview`. Use crate feature `package-2023-06-preview` to enable. The operations will be in the `package_2023_06_preview` module. - `package-2022-06` has 127 operations from 1 API versions: `2022-06-15`. Use crate feature `package-2022-06` to enable. The operations will be in the `package_2022_06` module. - `package-2021-12` has 61 operations from 1 API versions: `2021-12-01`. Use crate feature `package-2021-12` to enable. The operations will be in the `package_2021_12` module. - `package-2021-10-preview` has 138 operations from 1 API versions: `2021-10-15-preview`. Use crate feature `package-2021-10-preview` to enable. The operations will be in the `package_2021_10_preview` module. \ No newline at end of file diff --git a/services/mgmt/eventgrid/src/lib.rs b/services/mgmt/eventgrid/src/lib.rs index 2535d7b026..b1a9b68d41 100644 --- a/services/mgmt/eventgrid/src/lib.rs +++ b/services/mgmt/eventgrid/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-06-preview")] +pub mod package_2023_06_preview; +#[cfg(all(feature = "package-2023-06-preview", not(feature = "no-default-tag")))] +pub use package_2023_06_preview::*; #[cfg(feature = "package-2022-06")] pub mod package_2022_06; #[cfg(all(feature = "package-2022-06", not(feature = "no-default-tag")))] diff --git a/services/mgmt/eventgrid/src/package_2023_06_preview/mod.rs b/services/mgmt/eventgrid/src/package_2023_06_preview/mod.rs new file mode 100644 index 0000000000..3f46d46c93 --- /dev/null +++ b/services/mgmt/eventgrid/src/package_2023_06_preview/mod.rs @@ -0,0 +1,20867 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn ca_certificates_client(&self) -> ca_certificates::Client { + ca_certificates::Client(self.clone()) + } + pub fn channels_client(&self) -> channels::Client { + channels::Client(self.clone()) + } + pub fn client_groups_client(&self) -> client_groups::Client { + client_groups::Client(self.clone()) + } + pub fn clients_client(&self) -> clients::Client { + clients::Client(self.clone()) + } + pub fn domain_event_subscriptions_client(&self) -> domain_event_subscriptions::Client { + domain_event_subscriptions::Client(self.clone()) + } + pub fn domain_topic_event_subscriptions_client(&self) -> domain_topic_event_subscriptions::Client { + domain_topic_event_subscriptions::Client(self.clone()) + } + pub fn domain_topics_client(&self) -> domain_topics::Client { + domain_topics::Client(self.clone()) + } + pub fn domains_client(&self) -> domains::Client { + domains::Client(self.clone()) + } + pub fn event_subscriptions_client(&self) -> event_subscriptions::Client { + event_subscriptions::Client(self.clone()) + } + pub fn extension_topics_client(&self) -> extension_topics::Client { + extension_topics::Client(self.clone()) + } + pub fn namespace_topic_event_subscriptions_client(&self) -> namespace_topic_event_subscriptions::Client { + namespace_topic_event_subscriptions::Client(self.clone()) + } + pub fn namespace_topics_client(&self) -> namespace_topics::Client { + namespace_topics::Client(self.clone()) + } + pub fn namespaces_client(&self) -> namespaces::Client { + namespaces::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn partner_configurations_client(&self) -> partner_configurations::Client { + partner_configurations::Client(self.clone()) + } + pub fn partner_destinations_client(&self) -> partner_destinations::Client { + partner_destinations::Client(self.clone()) + } + pub fn partner_namespaces_client(&self) -> partner_namespaces::Client { + partner_namespaces::Client(self.clone()) + } + pub fn partner_registrations_client(&self) -> partner_registrations::Client { + partner_registrations::Client(self.clone()) + } + pub fn partner_topic_event_subscriptions_client(&self) -> partner_topic_event_subscriptions::Client { + partner_topic_event_subscriptions::Client(self.clone()) + } + pub fn partner_topics_client(&self) -> partner_topics::Client { + partner_topics::Client(self.clone()) + } + pub fn permission_bindings_client(&self) -> permission_bindings::Client { + permission_bindings::Client(self.clone()) + } + pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { + private_endpoint_connections::Client(self.clone()) + } + pub fn private_link_resources_client(&self) -> private_link_resources::Client { + private_link_resources::Client(self.clone()) + } + pub fn system_topic_event_subscriptions_client(&self) -> system_topic_event_subscriptions::Client { + system_topic_event_subscriptions::Client(self.clone()) + } + pub fn system_topics_client(&self) -> system_topics::Client { + system_topics::Client(self.clone()) + } + pub fn topic_event_subscriptions_client(&self) -> topic_event_subscriptions::Client { + topic_event_subscriptions::Client(self.clone()) + } + pub fn topic_spaces_client(&self) -> topic_spaces::Client { + topic_spaces::Client(self.clone()) + } + pub fn topic_types_client(&self) -> topic_types::Client { + topic_types::Client(self.clone()) + } + pub fn topics_client(&self) -> topics::Client { + topics::Client(self.clone()) + } + pub fn verified_partners_client(&self) -> verified_partners::Client { + verified_partners::Client(self.clone()) + } +} +pub mod ca_certificates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a CA certificate."] + #[doc = "Get properties of a CA certificate."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `ca_certificate_name`: Name of the CA certificate."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ca_certificate_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + ca_certificate_name: ca_certificate_name.into(), + } + } + #[doc = "Create or update a CA certificate."] + #[doc = "Create or update a CA certificate with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `ca_certificate_name`: The CA certificate name."] + #[doc = "* `ca_certificate_info`: CA certificate information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ca_certificate_name: impl Into, + ca_certificate_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + ca_certificate_name: ca_certificate_name.into(), + ca_certificate_info: ca_certificate_info.into(), + } + } + #[doc = "Delete a CA certificate."] + #[doc = "Delete an existing CA certificate."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `ca_certificate_name`: Name of the CA certificate."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ca_certificate_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + ca_certificate_name: ca_certificate_name.into(), + } + } + #[doc = "List all CA certificates under a namespace."] + #[doc = "Get all the CA certificates under a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_by_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_by_namespace::RequestBuilder { + list_by_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CaCertificate = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) ca_certificate_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/caCertificates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.ca_certificate_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CaCertificate = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) ca_certificate_name: String, + pub(crate) ca_certificate_info: models::CaCertificate, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/caCertificates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.ca_certificate_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.ca_certificate_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) ca_certificate_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/caCertificates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.ca_certificate_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CaCertificatesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/caCertificates", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod channels { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a channel."] + #[doc = "Get properties of a channel."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the partners subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `channel_name`: Name of the channel."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + channel_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + channel_name: channel_name.into(), + } + } + #[doc = "Create or update a channel."] + #[doc = "Synchronously creates or updates a new channel with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the partners subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `channel_name`: Name of the channel."] + #[doc = "* `channel_info`: Channel information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + channel_name: impl Into, + channel_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + channel_name: channel_name.into(), + channel_info: channel_info.into(), + } + } + #[doc = "Update a Channel."] + #[doc = "Synchronously updates a channel with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the partners subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `channel_name`: Name of the channel."] + #[doc = "* `channel_update_parameters`: Channel update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + channel_name: impl Into, + channel_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + channel_name: channel_name.into(), + channel_update_parameters: channel_update_parameters.into(), + } + } + #[doc = "Delete a channel."] + #[doc = "Delete an existing channel."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the partners subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `channel_name`: Name of the channel."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + channel_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + channel_name: channel_name.into(), + } + } + #[doc = "List channels."] + #[doc = "List all the channels in a partner namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the partners subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + pub fn list_by_partner_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + ) -> list_by_partner_namespace::RequestBuilder { + list_by_partner_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + filter: None, + top: None, + } + } + #[doc = "Get full URL of partner destination channel."] + #[doc = "Get the full endpoint URL of a partner destination channel."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the partners subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `channel_name`: Name of the Channel."] + pub fn get_full_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + channel_name: impl Into, + ) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + channel_name: channel_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Channel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) channel_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/channels/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name, + &this.channel_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Channel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) channel_name: String, + pub(crate) channel_info: models::Channel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/channels/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name, + &this.channel_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.channel_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) channel_name: String, + pub(crate) channel_update_parameters: models::ChannelUpdateParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/channels/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name, + &this.channel_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.channel_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) channel_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/channels/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name, + &this.channel_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_partner_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ChannelsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/channels", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) channel_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/channels/{}/getFullUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . partner_namespace_name , & this . channel_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod client_groups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a client group."] + #[doc = "Get properties of a client group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `client_group_name`: Name of the client group."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + client_group_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + client_group_name: client_group_name.into(), + } + } + #[doc = "Create or update a client group."] + #[doc = "Create or update a client group with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `client_group_name`: The client group name."] + #[doc = "* `client_group_info`: Client group information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + client_group_name: impl Into, + client_group_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + client_group_name: client_group_name.into(), + client_group_info: client_group_info.into(), + } + } + #[doc = "Delete a client group."] + #[doc = "Delete an existing client group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `client_group_name`: Name of the client group."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + client_group_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + client_group_name: client_group_name.into(), + } + } + #[doc = "List all client groups under a namespace."] + #[doc = "Get all the client groups under a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_by_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_by_namespace::RequestBuilder { + list_by_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClientGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) client_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clientGroups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.client_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClientGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) client_group_name: String, + pub(crate) client_group_info: models::ClientGroup, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clientGroups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.client_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.client_group_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) client_group_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clientGroups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.client_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClientGroupsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clientGroups", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod clients { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a client."] + #[doc = "Get properties of a client."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `client_name`: Name of the client."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + client_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + client_name: client_name.into(), + } + } + #[doc = "Create or update a client."] + #[doc = "Create or update a client with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `client_name`: The client name."] + #[doc = "* `client_info`: Client information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + client_name: impl Into, + client_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + client_name: client_name.into(), + client_info: client_info.into(), + } + } + #[doc = "Delete a client."] + #[doc = "Delete an existing client."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `client_name`: Name of the client."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + client_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + client_name: client_name.into(), + } + } + #[doc = "List all permission bindings under a namespace."] + #[doc = "Get all the permission bindings under a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_by_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_by_namespace::RequestBuilder { + list_by_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Client = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) client_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clients/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.client_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Client = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) client_name: String, + pub(crate) client_info: models::Client, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clients/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.client_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.client_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) client_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clients/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.client_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClientsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/clients", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod domains { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a domain."] + #[doc = "Get properties of a domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + } + } + #[doc = "Create or update a domain."] + #[doc = "Asynchronously creates or updates a new domain with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `domain_info`: Domain information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + domain_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + domain_info: domain_info.into(), + } + } + #[doc = "Update a domain."] + #[doc = "Asynchronously updates a domain with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `domain_update_parameters`: Domain update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + domain_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + domain_update_parameters: domain_update_parameters.into(), + } + } + #[doc = "Delete a domain."] + #[doc = "Delete existing domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + } + } + #[doc = "List domains under an Azure subscription."] + #[doc = "List all the domains under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List domains under a resource group."] + #[doc = "List all the domains under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "List keys for a domain."] + #[doc = "List the two keys used to publish to a domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + pub fn list_shared_access_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + ) -> list_shared_access_keys::RequestBuilder { + list_shared_access_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + } + } + #[doc = "Regenerate key for a domain."] + #[doc = "Regenerate a shared access key for a domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `regenerate_key_request`: Request body to regenerate key."] + pub fn regenerate_key( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + regenerate_key_request: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + regenerate_key_request: regenerate_key_request.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Domain = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Domain = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) domain_info: models::Domain, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.domain_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) domain_update_parameters: models::DomainUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.domain_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/domains", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_shared_access_keys { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/listKeys", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_key { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) regenerate_key_request: models::DomainRegenerateKeyRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/regenerateKey", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.regenerate_key_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod domain_topics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a domain topic."] + #[doc = "Get properties of a domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `domain_topic_name`: Name of the topic."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + domain_topic_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + domain_topic_name: domain_topic_name.into(), + } + } + #[doc = "Create or update a domain topic."] + #[doc = "Asynchronously creates or updates a new domain topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `domain_topic_name`: Name of the domain topic."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + domain_topic_name: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + domain_topic_name: domain_topic_name.into(), + } + } + #[doc = "Delete a domain topic."] + #[doc = "Delete existing domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `domain_topic_name`: Name of the domain topic."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + domain_topic_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + domain_topic_name: domain_topic_name.into(), + } + } + #[doc = "List domain topics."] + #[doc = "List all the topics in a domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Domain name."] + pub fn list_by_domain( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + ) -> list_by_domain::RequestBuilder { + list_by_domain::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) domain_topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.domain_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) domain_topic_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.domain_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) domain_topic_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.domain_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_domain { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DomainTopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod domain_topic_event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get delivery attributes for an event subscription for domain topic."] + #[doc = "Get all delivery attributes for an event subscription for domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_delivery_attributes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_delivery_attributes::RequestBuilder { + get_delivery_attributes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get a nested event subscription for domain topic."] + #[doc = "Get properties of a nested event subscription for a domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update a nested event subscription to a domain topic."] + #[doc = "Asynchronously creates a new event subscription or updates an existing event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the destination and filter information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update a nested event subscription for a domain topic."] + #[doc = "Update an existing event subscription for a domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be updated."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete a nested event subscription for a domain topic."] + #[doc = "Delete a nested existing event subscription for a domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get full URL of a nested event subscription for domain topic."] + #[doc = "Get the full endpoint URL for a nested event subscription for domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_full_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "List all nested event subscriptions for a specific domain topic."] + #[doc = "List all event subscriptions that have been created for a specific domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + filter: None, + top: None, + } + } + } + pub mod get_delivery_attributes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryAttributeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions/{}/getDeliveryAttributes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::EventSubscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::EventSubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions/{}/getFullUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.topic_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod topic_event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get delivery attributes for an event subscription for topic."] + #[doc = "Get all delivery attributes for an event subscription for topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_delivery_attributes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_delivery_attributes::RequestBuilder { + get_delivery_attributes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get an event subscription of a topic."] + #[doc = "Get properties of an event subscription of a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update an event subscription to a topic."] + #[doc = "Asynchronously creates a new event subscription or updates an existing event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the destination and filter information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update an event subscription for a topic."] + #[doc = "Update an existing event subscription for a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the domain."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be updated."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete an event subscription for a topic."] + #[doc = "Delete an existing event subscription for a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get full URL of an event subscription for topic."] + #[doc = "Get the full endpoint URL for an event subscription for topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_full_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "List all event subscriptions for a specific topic."] + #[doc = "List all event subscriptions that have been created for a specific topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + filter: None, + top: None, + } + } + } + pub mod get_delivery_attributes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryAttributeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions/{}/getDeliveryAttributes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::EventSubscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::EventSubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions/{}/getFullUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod domain_event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get delivery attributes for an event subscription for domain."] + #[doc = "Get all delivery attributes for an event subscription for domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_delivery_attributes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + event_subscription_name: impl Into, + ) -> get_delivery_attributes::RequestBuilder { + get_delivery_attributes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get an event subscription of a domain."] + #[doc = "Get properties of an event subscription of a domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + event_subscription_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update an event subscription to a domain."] + #[doc = "Asynchronously creates a new event subscription or updates an existing event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the destination and filter information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update an event subscription for a domain."] + #[doc = "Update an existing event subscription for a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be updated."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete an event subscription for a domain."] + #[doc = "Delete an existing event subscription for a domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + event_subscription_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get full URL of an event subscription for domain."] + #[doc = "Get the full endpoint URL for an event subscription for domain."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_full_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + event_subscription_name: impl Into, + ) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "List all event subscriptions for a specific domain."] + #[doc = "List all event subscriptions that have been created for a specific topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the domain."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + filter: None, + top: None, + } + } + } + pub mod get_delivery_attributes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryAttributeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions/{}/getDeliveryAttributes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::EventSubscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::EventSubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions/{}/getFullUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.domain_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get delivery attributes for an event subscription."] + #[doc = "Get all delivery attributes for an event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_delivery_attributes( + &self, + scope: impl Into, + event_subscription_name: impl Into, + ) -> get_delivery_attributes::RequestBuilder { + get_delivery_attributes::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get an event subscription."] + #[doc = "Get properties of an event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get(&self, scope: impl Into, event_subscription_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update an event subscription."] + #[doc = "Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The identifier of the resource to which the event subscription needs to be created or updated. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the destination and filter information."] + pub fn create_or_update( + &self, + scope: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update an event subscription."] + #[doc = "Asynchronously updates an existing event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be updated."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + scope: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete an event subscription."] + #[doc = "Delete an existing event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn delete(&self, scope: impl Into, event_subscription_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get full URL of an event subscription."] + #[doc = "Get the full endpoint URL for an event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription."] + pub fn get_full_url(&self, scope: impl Into, event_subscription_name: impl Into) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get an aggregated list of all global event subscriptions under an Azure subscription."] + #[doc = "List all aggregated global event subscriptions under a specific Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_global_by_subscription(&self, subscription_id: impl Into) -> list_global_by_subscription::RequestBuilder { + list_global_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List all global event subscriptions for a topic type."] + #[doc = "List all global event subscriptions under an Azure subscription for a topic type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `topic_type_name`: Name of the topic type."] + pub fn list_global_by_subscription_for_topic_type( + &self, + subscription_id: impl Into, + topic_type_name: impl Into, + ) -> list_global_by_subscription_for_topic_type::RequestBuilder { + list_global_by_subscription_for_topic_type::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + topic_type_name: topic_type_name.into(), + filter: None, + top: None, + } + } + #[doc = "List all global event subscriptions under an Azure subscription and resource group."] + #[doc = "List all global event subscriptions under a specific Azure subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_global_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_global_by_resource_group::RequestBuilder { + list_global_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "List all global event subscriptions under a resource group for a topic type."] + #[doc = "List all global event subscriptions under a resource group for a specific topic type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_type_name`: Name of the topic type."] + pub fn list_global_by_resource_group_for_topic_type( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_type_name: impl Into, + ) -> list_global_by_resource_group_for_topic_type::RequestBuilder { + list_global_by_resource_group_for_topic_type::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_type_name: topic_type_name.into(), + filter: None, + top: None, + } + } + #[doc = "List all regional event subscriptions under an Azure subscription."] + #[doc = "List all event subscriptions from the given location under a specific Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: Name of the location."] + pub fn list_regional_by_subscription( + &self, + subscription_id: impl Into, + location: impl Into, + ) -> list_regional_by_subscription::RequestBuilder { + list_regional_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + filter: None, + top: None, + } + } + #[doc = "List all regional event subscriptions under an Azure subscription and resource group."] + #[doc = "List all event subscriptions from the given location under a specific Azure subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `location`: Name of the location."] + pub fn list_regional_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + location: impl Into, + ) -> list_regional_by_resource_group::RequestBuilder { + list_regional_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + location: location.into(), + filter: None, + top: None, + } + } + #[doc = "List all regional event subscriptions under an Azure subscription for a topic type."] + #[doc = "List all event subscriptions from the given location under a specific Azure subscription and topic type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: Name of the location."] + #[doc = "* `topic_type_name`: Name of the topic type."] + pub fn list_regional_by_subscription_for_topic_type( + &self, + subscription_id: impl Into, + location: impl Into, + topic_type_name: impl Into, + ) -> list_regional_by_subscription_for_topic_type::RequestBuilder { + list_regional_by_subscription_for_topic_type::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + topic_type_name: topic_type_name.into(), + filter: None, + top: None, + } + } + #[doc = "List all regional event subscriptions under an Azure subscription and resource group for a topic type."] + #[doc = "List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `location`: Name of the location."] + #[doc = "* `topic_type_name`: Name of the topic type."] + pub fn list_regional_by_resource_group_for_topic_type( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + location: impl Into, + topic_type_name: impl Into, + ) -> list_regional_by_resource_group_for_topic_type::RequestBuilder { + list_regional_by_resource_group_for_topic_type::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + location: location.into(), + topic_type_name: topic_type_name.into(), + filter: None, + top: None, + } + } + #[doc = "List all event subscriptions."] + #[doc = "List all event subscriptions that have been created for a specific resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `provider_namespace`: Namespace of the provider of the topic."] + #[doc = "* `resource_type_name`: Name of the resource type."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + provider_namespace: impl Into, + resource_type_name: impl Into, + resource_name: impl Into, + ) -> list_by_resource::RequestBuilder { + list_by_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + provider_namespace: provider_namespace.into(), + resource_type_name: resource_type_name.into(), + resource_name: resource_name.into(), + filter: None, + top: None, + } + } + #[doc = "List all event subscriptions for a specific domain topic."] + #[doc = "List all event subscriptions that have been created for a specific domain topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `domain_name`: Name of the top level domain."] + #[doc = "* `topic_name`: Name of the domain topic."] + pub fn list_by_domain_topic( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain_name: impl Into, + topic_name: impl Into, + ) -> list_by_domain_topic::RequestBuilder { + list_by_domain_topic::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain_name: domain_name.into(), + topic_name: topic_name.into(), + filter: None, + top: None, + } + } + } + pub mod get_delivery_attributes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryAttributeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/eventSubscriptions/{}/getDeliveryAttributes", + this.client.endpoint(), + &this.scope, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/eventSubscriptions/{}", + this.client.endpoint(), + &this.scope, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::EventSubscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/eventSubscriptions/{}", + this.client.endpoint(), + &this.scope, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::EventSubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/eventSubscriptions/{}", + this.client.endpoint(), + &this.scope, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/eventSubscriptions/{}", + this.client.endpoint(), + &this.scope, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/eventSubscriptions/{}/getFullUrl", + this.client.endpoint(), + &this.scope, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_global_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_global_by_subscription_for_topic_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) topic_type_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/topicTypes/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.topic_type_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_global_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_global_by_resource_group_for_topic_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_type_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topicTypes/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_type_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_regional_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/locations/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_regional_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) location: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/locations/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_regional_by_subscription_for_topic_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) topic_type_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/locations/{}/topicTypes/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.topic_type_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_regional_by_resource_group_for_topic_type { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) location: String, + pub(crate) topic_type_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/locations/{}/topicTypes/{}/eventSubscriptions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . location , & this . topic_type_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) provider_namespace: String, + pub(crate) resource_type_name: String, + pub(crate) resource_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.EventGrid/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.provider_namespace, + &this.resource_type_name, + &this.resource_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_domain_topic { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain_name: String, + pub(crate) topic_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/domains/{}/topics/{}/providers/Microsoft.EventGrid/eventSubscriptions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . domain_name , & this . topic_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod system_topic_event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get delivery attributes for an event subscription."] + #[doc = "Get all delivery attributes for an event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get_delivery_attributes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_delivery_attributes::RequestBuilder { + get_delivery_attributes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get an event subscription of a system topic."] + #[doc = "Get an event subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update an event subscription for a system topic."] + #[doc = "Asynchronously creates or updates an event subscription with the specified parameters. Existing event subscriptions will be updated with this API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the destination and filter information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update event subscription of a system topic."] + #[doc = "Update an existing event subscription of a system topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete an event subscription of a system topic."] + #[doc = "Delete an existing event subscription of a system topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get full URL of an event subscription of a system topic"] + #[doc = "Get the full endpoint URL for an event subscription of a system topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get_full_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "List event subscriptions of a system topic."] + #[doc = "List event subscriptions that belong to a specific system topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + pub fn list_by_system_topic( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + ) -> list_by_system_topic::RequestBuilder { + list_by_system_topic::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + filter: None, + top: None, + } + } + } + pub mod get_delivery_attributes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryAttributeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions/{}/getDeliveryAttributes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . system_topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::EventSubscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::EventSubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions/{}/getFullUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . system_topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_system_topic { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod namespace_topic_event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get an event subscription of a namespace topic."] + #[doc = "Get properties of an event subscription of a namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update an event subscription of a namespace topic."] + #[doc = "Asynchronously creates or updates an event subscription of a namespace topic with the specified parameters. Existing event subscriptions will be updated with this API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the delivery mode, filter information, and others."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update event subscription of a namespace topic."] + #[doc = "Update an existing event subscription of a namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete an event subscription of a namespace topic."] + #[doc = "Delete an existing event subscription of a namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + event_subscription_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "List event subscriptions of a namespace topic."] + #[doc = "List event subscriptions that belong to a specific namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + pub fn list_by_namespace_topic( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + ) -> list_by_namespace_topic::RequestBuilder { + list_by_namespace_topic::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Subscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . namespace_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Subscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::Subscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . namespace_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Subscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::SubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . namespace_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/eventSubscriptions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . namespace_name , & this . topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace_topic { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/eventSubscriptions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . namespace_name , & this . topic_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod partner_topic_event_subscriptions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get an event subscription of a partner topic."] + #[doc = "Get properties of an event subscription of a partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Create or update an event subscription of a partner topic."] + #[doc = "Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. Existing event subscriptions will be updated with this API."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_info`: Event subscription properties containing the destination and filter information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_info: event_subscription_info.into(), + } + } + #[doc = "Update event subscription of a partner topic."] + #[doc = "Update an existing event subscription of a partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + #[doc = "* `event_subscription_update_parameters`: Updated event subscription information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + event_subscription_name: impl Into, + event_subscription_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + event_subscription_update_parameters: event_subscription_update_parameters.into(), + } + } + #[doc = "Delete an event subscription of a partner topic."] + #[doc = "Delete an existing event subscription of a partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "Get full URL of an event subscription of a partner topic."] + #[doc = "Get the full endpoint URL for an event subscription of a partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get_full_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_full_url::RequestBuilder { + get_full_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + #[doc = "List event subscriptions of a partner topic."] + #[doc = "List event subscriptions that belong to a specific partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + pub fn list_by_partner_topic( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + ) -> list_by_partner_topic::RequestBuilder { + list_by_partner_topic::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + filter: None, + top: None, + } + } + #[doc = "Get delivery attributes for an event subscription of a partner topic."] + #[doc = "Get all delivery attributes for an event subscription of a partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `event_subscription_name`: Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only."] + pub fn get_delivery_attributes( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + event_subscription_name: impl Into, + ) -> get_delivery_attributes::RequestBuilder { + get_delivery_attributes::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + event_subscription_name: event_subscription_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_info: models::EventSubscription, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscription = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) event_subscription_name: String, + pub(crate) event_subscription_update_parameters: models::EventSubscriptionUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.event_subscription_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name, + &this.event_subscription_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_full_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionFullUrl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions/{}/getFullUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . partner_topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_partner_topic { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventSubscriptionsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_delivery_attributes { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeliveryAttributeListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) event_subscription_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/eventSubscriptions/{}/getDeliveryAttributes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . partner_topic_name , & this . event_subscription_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod namespaces { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a namespace."] + #[doc = "Get properties of a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + } + } + #[doc = "Create or update a namespace."] + #[doc = "Asynchronously creates or updates a new namespace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `namespace_info`: Namespace information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + namespace_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + namespace_info: namespace_info.into(), + } + } + #[doc = "Update a namespace."] + #[doc = "Asynchronously updates a namespace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `namespace_update_parameters`: Namespace update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + namespace_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + namespace_update_parameters: namespace_update_parameters.into(), + } + } + #[doc = "Delete a namespace."] + #[doc = "Delete existing namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + } + } + #[doc = "List namespaces under an Azure subscription."] + #[doc = "List all the namespaces under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List namespaces under a resource group."] + #[doc = "List all the namespaces under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "List keys for a namespace."] + #[doc = "List the two keys used to publish to a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_shared_access_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_shared_access_keys::RequestBuilder { + list_shared_access_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + } + } + #[doc = "Regenerate key for a namespace."] + #[doc = "Regenerate a shared access key for a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the Namespace."] + #[doc = "* `regenerate_key_request`: Request body to regenerate key."] + pub fn regenerate_key( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + regenerate_key_request: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + regenerate_key_request: regenerate_key_request.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Namespace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Namespace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) namespace_info: models::Namespace, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.namespace_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Namespace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) namespace_update_parameters: models::NamespaceUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.namespace_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespacesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/namespaces", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespacesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_shared_access_keys { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespaceSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/listKeys", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_key { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespaceSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) regenerate_key_request: models::NamespaceRegenerateKeyRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/regenerateKey", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.regenerate_key_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod namespace_topics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a namespace topic."] + #[doc = "Get properties of a namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + } + } + #[doc = "Create a namespace topic."] + #[doc = "Asynchronously creates a new namespace topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + #[doc = "* `namespace_topic_info`: Namespace topic information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + namespace_topic_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + namespace_topic_info: namespace_topic_info.into(), + } + } + #[doc = "Update a namespace topic."] + #[doc = "Asynchronously updates a namespace topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the namespace topic."] + #[doc = "* `namespace_topic_update_parameters`: Namespace topic update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + namespace_topic_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + namespace_topic_update_parameters: namespace_topic_update_parameters.into(), + } + } + #[doc = "Delete a namespace topic."] + #[doc = "Delete existing namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the topic."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + } + } + #[doc = "List namespace topics under a namespace."] + #[doc = "List all the namespace topics under a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_by_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_by_namespace::RequestBuilder { + list_by_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + filter: None, + top: None, + } + } + #[doc = "List keys for a namespace topic."] + #[doc = "List the two keys used to publish to a namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the topic."] + pub fn list_shared_access_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + ) -> list_shared_access_keys::RequestBuilder { + list_shared_access_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + } + } + #[doc = "Regenerate key for a namespace topic."] + #[doc = "Regenerate a shared access key for a namespace topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `regenerate_key_request`: Request body to regenerate key."] + pub fn regenerate_key( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_name: impl Into, + regenerate_key_request: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_name: topic_name.into(), + regenerate_key_request: regenerate_key_request.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespaceTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespaceTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) namespace_topic_info: models::NamespaceTopic, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.namespace_topic_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespaceTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) namespace_topic_update_parameters: models::NamespaceTopicUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.namespace_topic_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NamespaceTopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_shared_access_keys { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/listKeys", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_key { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_name: String, + pub(crate) regenerate_key_request: models::TopicRegenerateKeyRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topics/{}/regenerateKey", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.regenerate_key_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List available operations."] + #[doc = "List the available operations supported by the Microsoft.EventGrid resource provider."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!("{}/providers/Microsoft.EventGrid/operations", this.client.endpoint(),))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod partner_configurations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a partner configuration."] + #[doc = "Get properties of a partner configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn get(&self, subscription_id: impl Into, resource_group_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Create or update a partner configuration."] + #[doc = "Synchronously creates or updates a partner configuration with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_configuration_info`: Partner configuration information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_configuration_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_configuration_info: partner_configuration_info.into(), + } + } + #[doc = "Update a partner configuration."] + #[doc = "Synchronously updates a partner configuration with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_configuration_update_parameters`: Partner configuration update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_configuration_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_configuration_update_parameters: partner_configuration_update_parameters.into(), + } + } + #[doc = "Delete a partner configuration."] + #[doc = "Delete existing partner configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn delete(&self, subscription_id: impl Into, resource_group_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List partner configurations under a resource group."] + #[doc = "List all the partner configurations under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List partner configurations under an Azure subscription."] + #[doc = "List all the partner configurations under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "Authorize a partner."] + #[doc = "Authorize a single partner either by partner registration immutable Id or by partner name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_info`: The information of the partner to be authorized."] + pub fn authorize_partner( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_info: impl Into, + ) -> authorize_partner::RequestBuilder { + authorize_partner::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_info: partner_info.into(), + } + } + #[doc = "Unauthorize a partner."] + #[doc = "Unauthorize a single partner either by partner registration immutable Id or by partner name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_info`: The information of the partner to be unauthorized."] + pub fn unauthorize_partner( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_info: impl Into, + ) -> unauthorize_partner::RequestBuilder { + unauthorize_partner::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_info: partner_info.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_configuration_info: models::PartnerConfiguration, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_configuration_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_configuration_update_parameters: models::PartnerConfigurationUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_configuration_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations/default", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfigurationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfigurationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/partnerConfigurations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod authorize_partner { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_info: models::Partner, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod unauthorize_partner { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_info: models::Partner, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod partner_destinations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a partner destination."] + #[doc = "Get properties of a partner destination."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_destination_name`: Name of the partner destination."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_destination_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_destination_name: partner_destination_name.into(), + } + } + #[doc = "Create a partner destination."] + #[doc = "Asynchronously creates a new partner destination with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_destination_name`: Name of the partner destination."] + #[doc = "* `partner_destination`: Partner destination create information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_destination_name: impl Into, + partner_destination: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_destination_name: partner_destination_name.into(), + partner_destination: partner_destination.into(), + } + } + #[doc = "Update a partner destination."] + #[doc = "Asynchronously updates a partner destination with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_destination_name`: Name of the partner destination."] + #[doc = "* `partner_destination_update_parameters`: Partner destination update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_destination_name: impl Into, + partner_destination_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_destination_name: partner_destination_name.into(), + partner_destination_update_parameters: partner_destination_update_parameters.into(), + } + } + #[doc = "Delete a partner destination."] + #[doc = "Delete existing partner destination."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_destination_name`: Name of the partner destination."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_destination_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_destination_name: partner_destination_name.into(), + } + } + #[doc = "List partner destinations under an Azure subscription."] + #[doc = "List all the partner destinations under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List partner destinations under a resource group."] + #[doc = "List all the partner destinations under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "Activate a partner destination."] + #[doc = "Activate a newly created partner destination."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_destination_name`: Name of the partner destination."] + pub fn activate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_destination_name: impl Into, + ) -> activate::RequestBuilder { + activate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_destination_name: partner_destination_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerDestination = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_destination_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerDestinations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_destination_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerDestination = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_destination_name: String, + pub(crate) partner_destination: models::PartnerDestination, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerDestinations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_destination_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_destination)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerDestination = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_destination_name: String, + pub(crate) partner_destination_update_parameters: models::PartnerDestinationUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerDestinations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_destination_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_destination_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_destination_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerDestinations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_destination_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerDestinationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/partnerDestinations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerDestinationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerDestinations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod activate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerDestination = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_destination_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerDestinations/{}/activate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_destination_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod partner_namespaces { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a partner namespace."] + #[doc = "Get properties of a partner namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + } + } + #[doc = "Create a partner namespace."] + #[doc = "Asynchronously creates a new partner namespace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `partner_namespace_info`: PartnerNamespace information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + partner_namespace_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + partner_namespace_info: partner_namespace_info.into(), + } + } + #[doc = "Update a partner namespace."] + #[doc = "Asynchronously updates a partner namespace with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `partner_namespace_update_parameters`: Partner namespace update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + partner_namespace_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + partner_namespace_update_parameters: partner_namespace_update_parameters.into(), + } + } + #[doc = "Delete a partner namespace."] + #[doc = "Delete existing partner namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + } + } + #[doc = "List partner namespaces under an Azure subscription."] + #[doc = "List all the partner namespaces under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List partner namespaces under a resource group."] + #[doc = "List all the partner namespaces under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "List keys for a partner namespace."] + #[doc = "List the two keys used to publish to a partner namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + pub fn list_shared_access_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + ) -> list_shared_access_keys::RequestBuilder { + list_shared_access_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + } + } + #[doc = "Regenerate key for a partner namespace."] + #[doc = "Regenerate a shared access key for a partner namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_namespace_name`: Name of the partner namespace."] + #[doc = "* `regenerate_key_request`: Request body to regenerate key."] + pub fn regenerate_key( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_namespace_name: impl Into, + regenerate_key_request: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_namespace_name: partner_namespace_name.into(), + regenerate_key_request: regenerate_key_request.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerNamespace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerNamespace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) partner_namespace_info: models::PartnerNamespace, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_namespace_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) partner_namespace_update_parameters: models::PartnerNamespaceUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_namespace_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerNamespacesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/partnerNamespaces", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerNamespacesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_shared_access_keys { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerNamespaceSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/listKeys", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_key { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerNamespaceSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_namespace_name: String, + pub(crate) regenerate_key_request: models::PartnerNamespaceRegenerateKeyRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerNamespaces/{}/regenerateKey", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_namespace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.regenerate_key_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod partner_registrations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a partner registration."] + #[doc = "Gets a partner registration with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_registration_name`: Name of the partner registration."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_registration_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_registration_name: partner_registration_name.into(), + } + } + #[doc = "Create a partner registration."] + #[doc = "Creates a new partner registration with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_registration_name`: Name of the partner registration."] + #[doc = "* `partner_registration_info`: PartnerRegistration information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_registration_name: impl Into, + partner_registration_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_registration_name: partner_registration_name.into(), + partner_registration_info: partner_registration_info.into(), + } + } + #[doc = "Update a partner registration."] + #[doc = "Updates a partner registration with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_registration_name`: Name of the partner registration."] + #[doc = "* `partner_registration_update_parameters`: Partner registration update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_registration_name: impl Into, + partner_registration_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_registration_name: partner_registration_name.into(), + partner_registration_update_parameters: partner_registration_update_parameters.into(), + } + } + #[doc = "Delete a partner registration."] + #[doc = "Deletes a partner registration with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_registration_name`: Name of the partner registration."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_registration_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_registration_name: partner_registration_name.into(), + } + } + #[doc = "List partner registrations under an Azure subscription."] + #[doc = "List all the partner registrations under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List partner registrations under a resource group."] + #[doc = "List all the partner registrations under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerRegistration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_registration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerRegistrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_registration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerRegistration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_registration_name: String, + pub(crate) partner_registration_info: models::PartnerRegistration, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerRegistrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_registration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_registration_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_registration_name: String, + pub(crate) partner_registration_update_parameters: models::PartnerRegistrationUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerRegistrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_registration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_registration_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_registration_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerRegistrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_registration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerRegistrationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/partnerRegistrations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerRegistrationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerRegistrations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod partner_topics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a partner topic."] + #[doc = "Get properties of a partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + } + } + #[doc = "Create a partner topic."] + #[doc = "Asynchronously creates a new partner topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `partner_topic_info`: Partner Topic information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + partner_topic_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + partner_topic_info: partner_topic_info.into(), + } + } + #[doc = "Update a partner topic."] + #[doc = "Asynchronously updates a partner topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + #[doc = "* `partner_topic_update_parameters`: PartnerTopic update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + partner_topic_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + partner_topic_update_parameters: partner_topic_update_parameters.into(), + } + } + #[doc = "Delete a partner topic."] + #[doc = "Delete existing partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + } + } + #[doc = "List partner topics under an Azure subscription."] + #[doc = "List all the partner topics under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List partner topics under a resource group."] + #[doc = "List all the partner topics under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "Activate a partner topic."] + #[doc = "Activate a newly created partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + pub fn activate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + ) -> activate::RequestBuilder { + activate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + } + } + #[doc = "Deactivate a partner topic."] + #[doc = "Deactivate specific partner topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `partner_topic_name`: Name of the partner topic."] + pub fn deactivate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + partner_topic_name: impl Into, + ) -> deactivate::RequestBuilder { + deactivate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + partner_topic_name: partner_topic_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) partner_topic_info: models::PartnerTopic, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_topic_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + pub(crate) partner_topic_update_parameters: models::PartnerTopicUpdateParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.partner_topic_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerTopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/partnerTopics", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerTopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod activate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/activate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod deactivate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PartnerTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) partner_topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/partnerTopics/{}/deactivate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.partner_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod permission_bindings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a permission binding."] + #[doc = "Get properties of a permission binding."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `permission_binding_name`: Name of the permission binding."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + permission_binding_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + permission_binding_name: permission_binding_name.into(), + } + } + #[doc = "Create or update a permission binding."] + #[doc = "Create or update a permission binding with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `permission_binding_name`: The permission binding name."] + #[doc = "* `permission_binding_info`: Permission binding information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + permission_binding_name: impl Into, + permission_binding_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + permission_binding_name: permission_binding_name.into(), + permission_binding_info: permission_binding_info.into(), + } + } + #[doc = "Delete a permission binding."] + #[doc = "Delete an existing permission binding."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `permission_binding_name`: Name of the permission binding."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + permission_binding_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + permission_binding_name: permission_binding_name.into(), + } + } + #[doc = "List all permission bindings under a namespace."] + #[doc = "Get all the permission bindings under a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_by_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_by_namespace::RequestBuilder { + list_by_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PermissionBinding = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) permission_binding_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/permissionBindings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.permission_binding_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PermissionBinding = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) permission_binding_name: String, + pub(crate) permission_binding_info: models::PermissionBinding, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/permissionBindings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.permission_binding_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.permission_binding_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) permission_binding_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/permissionBindings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.permission_binding_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PermissionBindingsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/permissionBindings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod private_endpoint_connections { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a specific private endpoint connection."] + #[doc = "Get a specific private endpoint connection under a topic, domain, or partner namespace or namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `parent_type`: The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\' or \\'namespaces\\'."] + #[doc = "* `parent_name`: The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or namespace name)."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection connection."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_type: impl Into, + parent_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_type: parent_type.into(), + parent_name: parent_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + #[doc = "Update a specific private endpoint connection."] + #[doc = "Update a specific private endpoint connection under a topic, domain or partner namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `parent_type`: The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\' or \\'namespaces\\'."] + #[doc = "* `parent_name`: The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or namespace name)."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection connection."] + #[doc = "* `private_endpoint_connection`: The private endpoint connection object to update."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_type: impl Into, + parent_name: impl Into, + private_endpoint_connection_name: impl Into, + private_endpoint_connection: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_type: parent_type.into(), + parent_name: parent_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + private_endpoint_connection: private_endpoint_connection.into(), + } + } + #[doc = "Delete a specific private endpoint connection."] + #[doc = "Delete a specific private endpoint connection under a topic, domain, or partner namespace or namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `parent_type`: The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\' or \\'namespaces\\'."] + #[doc = "* `parent_name`: The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or namespace name)."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection connection."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_type: impl Into, + parent_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_type: parent_type.into(), + parent_name: parent_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + #[doc = "Lists all private endpoint connections under a resource."] + #[doc = "Get all private endpoint connections under a topic, domain, or partner namespace or namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `parent_type`: The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\' or \\'namespaces\\'."] + #[doc = "* `parent_name`: The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or namespace name)."] + pub fn list_by_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_type: impl Into, + parent_name: impl Into, + ) -> list_by_resource::RequestBuilder { + list_by_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_type: parent_type.into(), + parent_name: parent_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_type: String, + pub(crate) parent_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/{}/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_type, + &this.parent_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_type: String, + pub(crate) parent_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) private_endpoint_connection: models::PrivateEndpointConnection, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/{}/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_type, + &this.parent_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.private_endpoint_connection)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_type: String, + pub(crate) parent_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/{}/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_type, + &this.parent_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_type: String, + pub(crate) parent_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/{}/{}/privateEndpointConnections", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_type, + &this.parent_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod private_link_resources { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a private link resource."] + #[doc = "Get properties of a private link resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `parent_type`: The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\' or \\'namespaces\\'."] + #[doc = "* `parent_name`: The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or namespace name)."] + #[doc = "* `private_link_resource_name`: The name of private link resource will be either topic, domain, partnerNamespace or namespace."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_type: impl Into, + parent_name: impl Into, + private_link_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_type: parent_type.into(), + parent_name: parent_name.into(), + private_link_resource_name: private_link_resource_name.into(), + } + } + #[doc = "List private link resources under specific topic, domain, or partner namespace or namespace."] + #[doc = "List all the private link resources under a topic, domain, or partner namespace or namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `parent_type`: The type of the parent resource. This can be either \\'topics\\', \\'domains\\', or \\'partnerNamespaces\\' or \\'namespaces\\'."] + #[doc = "* `parent_name`: The name of the parent resource (namely, either, the topic name, domain name, or partner namespace or namespace name)."] + pub fn list_by_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + parent_type: impl Into, + parent_name: impl Into, + ) -> list_by_resource::RequestBuilder { + list_by_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + parent_type: parent_type.into(), + parent_name: parent_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_type: String, + pub(crate) parent_name: String, + pub(crate) private_link_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/{}/{}/privateLinkResources/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_type, + &this.parent_name, + &this.private_link_resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResourcesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) parent_type: String, + pub(crate) parent_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/{}/{}/privateLinkResources", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.parent_type, + &this.parent_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod system_topics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a system topic."] + #[doc = "Get properties of a system topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + } + } + #[doc = "Create a system topic."] + #[doc = "Asynchronously creates a new system topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `system_topic_info`: System Topic information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + system_topic_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + system_topic_info: system_topic_info.into(), + } + } + #[doc = "Update a system topic."] + #[doc = "Asynchronously updates a system topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + #[doc = "* `system_topic_update_parameters`: SystemTopic update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + system_topic_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + system_topic_update_parameters: system_topic_update_parameters.into(), + } + } + #[doc = "Delete a system topic."] + #[doc = "Delete existing system topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `system_topic_name`: Name of the system topic."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + system_topic_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + system_topic_name: system_topic_name.into(), + } + } + #[doc = "List system topics under an Azure subscription."] + #[doc = "List all the system topics under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List system topics under a resource group."] + #[doc = "List all the system topics under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SystemTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SystemTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) system_topic_info: models::SystemTopic, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.system_topic_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SystemTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + pub(crate) system_topic_update_parameters: models::SystemTopicUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.system_topic_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) system_topic_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.system_topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SystemTopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/systemTopics", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SystemTopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/systemTopics", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod topics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a topic."] + #[doc = "Get properties of a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + } + } + #[doc = "Create a topic."] + #[doc = "Asynchronously creates a new topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `topic_info`: Topic information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + topic_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + topic_info: topic_info.into(), + } + } + #[doc = "Update a topic."] + #[doc = "Asynchronously updates a topic with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `topic_update_parameters`: Topic update information."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + topic_update_parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + topic_update_parameters: topic_update_parameters.into(), + } + } + #[doc = "Delete a topic."] + #[doc = "Delete existing topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + } + } + #[doc = "List topics under an Azure subscription."] + #[doc = "List all the topics under an Azure subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + top: None, + } + } + #[doc = "List topics under a resource group."] + #[doc = "List all the topics under a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + top: None, + } + } + #[doc = "List keys for a topic."] + #[doc = "List the two keys used to publish to a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + pub fn list_shared_access_keys( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + ) -> list_shared_access_keys::RequestBuilder { + list_shared_access_keys::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + } + } + #[doc = "Regenerate key for a topic."] + #[doc = "Regenerate a shared access key for a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `topic_name`: Name of the topic."] + #[doc = "* `regenerate_key_request`: Request body to regenerate key."] + pub fn regenerate_key( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + topic_name: impl Into, + regenerate_key_request: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + topic_name: topic_name.into(), + regenerate_key_request: regenerate_key_request.into(), + } + } + #[doc = "List topic event types."] + #[doc = "List event types for a topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `provider_namespace`: Namespace of the provider of the topic."] + #[doc = "* `resource_type_name`: Name of the topic type."] + #[doc = "* `resource_name`: Name of the topic."] + pub fn list_event_types( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + provider_namespace: impl Into, + resource_type_name: impl Into, + resource_name: impl Into, + ) -> list_event_types::RequestBuilder { + list_event_types::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + provider_namespace: provider_namespace.into(), + resource_type_name: resource_type_name.into(), + resource_name: resource_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Topic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Topic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) topic_info: models::Topic, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.topic_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) topic_update_parameters: models::TopicUpdateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.topic_update_parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.EventGrid/topics", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_shared_access_keys { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/listKeys", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod regenerate_key { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSharedAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) topic_name: String, + pub(crate) regenerate_key_request: models::TopicRegenerateKeyRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/topics/{}/regenerateKey", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.topic_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.regenerate_key_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_event_types { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventTypesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) provider_namespace: String, + pub(crate) resource_type_name: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.EventGrid/eventTypes", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.provider_namespace, + &this.resource_type_name, + &this.resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod extension_topics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get properties of an extension topic."] + #[doc = "Get the properties of an extension topic."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The identifier of the resource to which extension topic is queried. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for Azure resource."] + pub fn get(&self, scope: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTopic = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.EventGrid/extensionTopics/default", + this.client.endpoint(), + &this.scope + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod topic_spaces { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a topic space."] + #[doc = "Get properties of a topic space."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_space_name`: Name of the Topic space."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_space_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_space_name: topic_space_name.into(), + } + } + #[doc = "Create or update a topic space."] + #[doc = "Create or update a topic space with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_space_name`: The topic space name."] + #[doc = "* `topic_space_info`: Topic space information."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_space_name: impl Into, + topic_space_info: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_space_name: topic_space_name.into(), + topic_space_info: topic_space_info.into(), + } + } + #[doc = "Delete a topic space."] + #[doc = "Delete an existing topic space."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + #[doc = "* `topic_space_name`: Name of the Topic space."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + topic_space_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + topic_space_name: topic_space_name.into(), + } + } + #[doc = "List all topic spaces under a namespace."] + #[doc = "Get all the topic spaces under a namespace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription."] + #[doc = "* `namespace_name`: Name of the namespace."] + pub fn list_by_namespace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + namespace_name: impl Into, + ) -> list_by_namespace::RequestBuilder { + list_by_namespace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + namespace_name: namespace_name.into(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSpace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_space_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topicSpaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_space_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSpace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_space_name: String, + pub(crate) topic_space_info: models::TopicSpace, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topicSpaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_space_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.topic_space_info)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) topic_space_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topicSpaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name, + &this.topic_space_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_namespace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicSpacesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) namespace_name: String, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.EventGrid/namespaces/{}/topicSpaces", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.namespace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod topic_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List topic types."] + #[doc = "List all registered topic types."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "Get a topic type."] + #[doc = "Get information about a topic type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `topic_type_name`: Name of the topic type."] + pub fn get(&self, topic_type_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + topic_type_name: topic_type_name.into(), + } + } + #[doc = "List event types."] + #[doc = "List event types for a topic type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `topic_type_name`: Name of the topic type."] + pub fn list_event_types(&self, topic_type_name: impl Into) -> list_event_types::RequestBuilder { + list_event_types::RequestBuilder { + client: self.0.clone(), + topic_type_name: topic_type_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicTypesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!("{}/providers/Microsoft.EventGrid/topicTypes", this.client.endpoint(),))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopicTypeInfo = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) topic_type_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.EventGrid/topicTypes/{}", + this.client.endpoint(), + &this.topic_type_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_event_types { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EventTypesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) topic_type_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.EventGrid/topicTypes/{}/eventTypes", + this.client.endpoint(), + &this.topic_type_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod verified_partners { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a verified partner."] + #[doc = "Get properties of a verified partner."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `verified_partner_name`: Name of the verified partner."] + pub fn get(&self, verified_partner_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + verified_partner_name: verified_partner_name.into(), + } + } + #[doc = "List all verified partners."] + #[doc = "Get a list of all verified partners."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + filter: None, + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VerifiedPartner = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) verified_partner_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.EventGrid/verifiedPartners/{}", + this.client.endpoint(), + &this.verified_partner_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VerifiedPartnersListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) filter: Option, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.EventGrid/verifiedPartners", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} diff --git a/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs b/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs new file mode 100644 index 0000000000..e0f3674a28 --- /dev/null +++ b/services/mgmt/eventgrid/src/package_2023_06_preview/models.rs @@ -0,0 +1,8333 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "This is the base type that represents an advanced filter. To configure an advanced filter, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, StringEqualsAdvancedFilter etc. depending on the type of the key based on which you want to filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdvancedFilter { + #[doc = "The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others."] + #[serde(rename = "operatorType")] + pub operator_type: advanced_filter::OperatorType, + #[doc = "The field/property in the event based on which you want to filter."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, +} +impl AdvancedFilter { + pub fn new(operator_type: advanced_filter::OperatorType) -> Self { + Self { operator_type, key: None } + } +} +pub mod advanced_filter { + use super::*; + #[doc = "The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OperatorType")] + pub enum OperatorType { + NumberIn, + NumberNotIn, + NumberLessThan, + NumberGreaterThan, + NumberLessThanOrEquals, + NumberGreaterThanOrEquals, + BoolEquals, + StringIn, + StringNotIn, + StringBeginsWith, + StringEndsWith, + StringContains, + NumberInRange, + NumberNotInRange, + StringNotBeginsWith, + StringNotEndsWith, + StringNotContains, + IsNullOrUndefined, + IsNotNull, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OperatorType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OperatorType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperatorType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NumberIn => serializer.serialize_unit_variant("OperatorType", 0u32, "NumberIn"), + Self::NumberNotIn => serializer.serialize_unit_variant("OperatorType", 1u32, "NumberNotIn"), + Self::NumberLessThan => serializer.serialize_unit_variant("OperatorType", 2u32, "NumberLessThan"), + Self::NumberGreaterThan => serializer.serialize_unit_variant("OperatorType", 3u32, "NumberGreaterThan"), + Self::NumberLessThanOrEquals => serializer.serialize_unit_variant("OperatorType", 4u32, "NumberLessThanOrEquals"), + Self::NumberGreaterThanOrEquals => serializer.serialize_unit_variant("OperatorType", 5u32, "NumberGreaterThanOrEquals"), + Self::BoolEquals => serializer.serialize_unit_variant("OperatorType", 6u32, "BoolEquals"), + Self::StringIn => serializer.serialize_unit_variant("OperatorType", 7u32, "StringIn"), + Self::StringNotIn => serializer.serialize_unit_variant("OperatorType", 8u32, "StringNotIn"), + Self::StringBeginsWith => serializer.serialize_unit_variant("OperatorType", 9u32, "StringBeginsWith"), + Self::StringEndsWith => serializer.serialize_unit_variant("OperatorType", 10u32, "StringEndsWith"), + Self::StringContains => serializer.serialize_unit_variant("OperatorType", 11u32, "StringContains"), + Self::NumberInRange => serializer.serialize_unit_variant("OperatorType", 12u32, "NumberInRange"), + Self::NumberNotInRange => serializer.serialize_unit_variant("OperatorType", 13u32, "NumberNotInRange"), + Self::StringNotBeginsWith => serializer.serialize_unit_variant("OperatorType", 14u32, "StringNotBeginsWith"), + Self::StringNotEndsWith => serializer.serialize_unit_variant("OperatorType", 15u32, "StringNotEndsWith"), + Self::StringNotContains => serializer.serialize_unit_variant("OperatorType", 16u32, "StringNotContains"), + Self::IsNullOrUndefined => serializer.serialize_unit_variant("OperatorType", 17u32, "IsNullOrUndefined"), + Self::IsNotNull => serializer.serialize_unit_variant("OperatorType", 18u32, "IsNotNull"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Azure Active Directory Partner Client Authentication"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureAdPartnerClientAuthentication { + #[serde(flatten)] + pub partner_client_authentication: PartnerClientAuthentication, + #[doc = "Properties of an Azure Active Directory Partner Client Authentication."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AzureAdPartnerClientAuthentication { + pub fn new(partner_client_authentication: PartnerClientAuthentication) -> Self { + Self { + partner_client_authentication, + properties: None, + } + } +} +#[doc = "Properties of an Azure Active Directory Partner Client Authentication."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureAdPartnerClientAuthenticationProperties { + #[doc = "The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests."] + #[serde(rename = "azureActiveDirectoryTenantId", default, skip_serializing_if = "Option::is_none")] + pub azure_active_directory_tenant_id: Option, + #[doc = "The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests."] + #[serde( + rename = "azureActiveDirectoryApplicationIdOrUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub azure_active_directory_application_id_or_uri: Option, +} +impl AzureAdPartnerClientAuthenticationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the azure function destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureFunctionEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "The properties that represent the Azure Function destination of an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AzureFunctionEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "The properties that represent the Azure Function destination of an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureFunctionEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Maximum number of events per batch."] + #[serde(rename = "maxEventsPerBatch", default, skip_serializing_if = "Option::is_none")] + pub max_events_per_batch: Option, + #[doc = "Preferred batch size in Kilobytes."] + #[serde(rename = "preferredBatchSizeInKilobytes", default, skip_serializing_if = "Option::is_none")] + pub preferred_batch_size_in_kilobytes: Option, + #[doc = "Delivery attribute details."] + #[serde( + rename = "deliveryAttributeMappings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delivery_attribute_mappings: Vec, +} +impl AzureFunctionEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "BoolEquals Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BoolEqualsAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The boolean filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl BoolEqualsAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + value: None, + } + } +} +#[doc = "BoolEquals Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BoolEqualsFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The boolean filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl BoolEqualsFilter { + pub fn new(filter: Filter) -> Self { + Self { filter, value: None } + } +} +#[doc = "The CA Certificate resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CaCertificate { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of CA certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl CaCertificate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of CA certificate."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CaCertificateProperties { + #[doc = "Description for the CA Certificate resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Base64 encoded PEM (Privacy Enhanced Mail) format certificate data."] + #[serde(rename = "encodedCertificate", default, skip_serializing_if = "Option::is_none")] + pub encoded_certificate: Option, + #[doc = "Certificate issue time in UTC. This is a read-only field."] + #[serde(rename = "issueTimeInUtc", default, with = "azure_core::date::rfc3339::option")] + pub issue_time_in_utc: Option, + #[doc = "Certificate expiry time in UTC. This is a read-only field."] + #[serde(rename = "expiryTimeInUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiry_time_in_utc: Option, + #[doc = "Provisioning state of the CA Certificate resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl CaCertificateProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod ca_certificate_properties { + use super::*; + #[doc = "Provisioning state of the CA Certificate resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List CA Certificate operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CaCertificatesListResult { + #[doc = "A collection of CA Certificate."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of CA Certificate."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CaCertificatesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CaCertificatesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Channel info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Channel { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the Channel."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Channel { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Channel."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ChannelProperties { + #[doc = "The type of the event channel which represents the direction flow of events."] + #[serde(rename = "channelType", default, skip_serializing_if = "Option::is_none")] + pub channel_type: Option, + #[doc = "Properties of the corresponding partner topic of a Channel."] + #[serde(rename = "partnerTopicInfo", default, skip_serializing_if = "Option::is_none")] + pub partner_topic_info: Option, + #[doc = "Properties of the corresponding partner destination of a Channel."] + #[serde(rename = "partnerDestinationInfo", default, skip_serializing_if = "Option::is_none")] + pub partner_destination_info: Option, + #[doc = "Context or helpful message that can be used during the approval process by the subscriber."] + #[serde(rename = "messageForActivation", default, skip_serializing_if = "Option::is_none")] + pub message_for_activation: Option, + #[doc = "Provisioning state of the channel."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The readiness state of the corresponding partner topic."] + #[serde(rename = "readinessState", default, skip_serializing_if = "Option::is_none")] + pub readiness_state: Option, + #[doc = "Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated,\r\nthe channel and corresponding partner topic are deleted."] + #[serde(rename = "expirationTimeIfNotActivatedUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_time_if_not_activated_utc: Option, +} +impl ChannelProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod channel_properties { + use super::*; + #[doc = "The type of the event channel which represents the direction flow of events."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ChannelType")] + pub enum ChannelType { + PartnerTopic, + PartnerDestination, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ChannelType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ChannelType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ChannelType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PartnerTopic => serializer.serialize_unit_variant("ChannelType", 0u32, "PartnerTopic"), + Self::PartnerDestination => serializer.serialize_unit_variant("ChannelType", 1u32, "PartnerDestination"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Provisioning state of the channel."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + IdleDueToMirroredPartnerTopicDeletion, + IdleDueToMirroredPartnerDestinationDeletion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::IdleDueToMirroredPartnerTopicDeletion => { + serializer.serialize_unit_variant("ProvisioningState", 6u32, "IdleDueToMirroredPartnerTopicDeletion") + } + Self::IdleDueToMirroredPartnerDestinationDeletion => { + serializer.serialize_unit_variant("ProvisioningState", 7u32, "IdleDueToMirroredPartnerDestinationDeletion") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The readiness state of the corresponding partner topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReadinessState")] + pub enum ReadinessState { + NeverActivated, + Activated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReadinessState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReadinessState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReadinessState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NeverActivated => serializer.serialize_unit_variant("ReadinessState", 0u32, "NeverActivated"), + Self::Activated => serializer.serialize_unit_variant("ReadinessState", 1u32, "Activated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Channel update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ChannelUpdateParameters { + #[doc = "Properties of the channel update parameters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ChannelUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the channel update parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ChannelUpdateParametersProperties { + #[doc = "Expiration time of the channel. If this timer expires while the corresponding partner topic or partner destination is never activated,\r\nthe channel and corresponding partner topic or partner destination are deleted."] + #[serde(rename = "expirationTimeIfNotActivatedUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_time_if_not_activated_utc: Option, + #[doc = "Properties of the corresponding partner destination of a Channel."] + #[serde(rename = "partnerDestinationInfo", default, skip_serializing_if = "Option::is_none")] + pub partner_destination_info: Option, + #[doc = "Update properties for the corresponding partner topic of a channel."] + #[serde(rename = "partnerTopicInfo", default, skip_serializing_if = "Option::is_none")] + pub partner_topic_info: Option, +} +impl ChannelUpdateParametersProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Channels operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ChannelsListResult { + #[doc = "A collection of Channels."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of channels."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ChannelsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ChannelsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Client resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Client { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of client."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Client { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Authentication properties for the client."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientAuthentication { + #[doc = "Thumbprints are used by the service to validate the device permission when authentication is done using self signed certificate."] + #[serde(rename = "certificateThumbprint", default, skip_serializing_if = "Option::is_none")] + pub certificate_thumbprint: Option, + #[doc = "CA certificate subject distinguished name information used by service to authenticate clients.\r\nFor more information, see https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x500distinguishedname?view=net-6.0#remarks"] + #[serde(rename = "certificateSubject", default, skip_serializing_if = "Option::is_none")] + pub certificate_subject: Option, +} +impl ClientAuthentication { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Client authentication settings for namespace resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientAuthenticationSettings { + #[doc = "Alternative authentication name sources related to client authentication settings for namespace resource."] + #[serde( + rename = "alternativeAuthenticationNameSources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub alternative_authentication_name_sources: Vec, +} +impl ClientAuthenticationSettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The certificate authentication properties for the client."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientCertificateAuthentication { + #[doc = "The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName."] + #[serde(rename = "validationScheme", default, skip_serializing_if = "Option::is_none")] + pub validation_scheme: Option, + #[doc = "The list of thumbprints that are allowed during client authentication. This property is required only if the validationScheme is 'ThumbprintMatch'."] + #[serde( + rename = "allowedThumbprints", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_thumbprints: Vec, +} +impl ClientCertificateAuthentication { + pub fn new() -> Self { + Self::default() + } +} +pub mod client_certificate_authentication { + use super::*; + #[doc = "The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValidationScheme")] + pub enum ValidationScheme { + SubjectMatchesAuthenticationName, + DnsMatchesAuthenticationName, + UriMatchesAuthenticationName, + IpMatchesAuthenticationName, + EmailMatchesAuthenticationName, + ThumbprintMatch, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValidationScheme { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValidationScheme { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValidationScheme { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SubjectMatchesAuthenticationName => { + serializer.serialize_unit_variant("ValidationScheme", 0u32, "SubjectMatchesAuthenticationName") + } + Self::DnsMatchesAuthenticationName => { + serializer.serialize_unit_variant("ValidationScheme", 1u32, "DnsMatchesAuthenticationName") + } + Self::UriMatchesAuthenticationName => { + serializer.serialize_unit_variant("ValidationScheme", 2u32, "UriMatchesAuthenticationName") + } + Self::IpMatchesAuthenticationName => { + serializer.serialize_unit_variant("ValidationScheme", 3u32, "IpMatchesAuthenticationName") + } + Self::EmailMatchesAuthenticationName => { + serializer.serialize_unit_variant("ValidationScheme", 4u32, "EmailMatchesAuthenticationName") + } + Self::ThumbprintMatch => serializer.serialize_unit_variant("ValidationScheme", 5u32, "ThumbprintMatch"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "CA certificate subject distinguished name information used by service to authenticate clients.\r\nFor more information, see https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x500distinguishedname?view=net-6.0#remarks"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientCertificateSubjectDistinguishedName { + #[doc = "The common name field in the subject name. The allowed limit is 64 characters and it should be specified."] + #[serde(rename = "commonName", default, skip_serializing_if = "Option::is_none")] + pub common_name: Option, + #[doc = "The organization field in the subject name. If present, the allowed limit is 64 characters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub organization: Option, + #[doc = "The organization unit field in the subject name. If present, the allowed limit is 32 characters."] + #[serde(rename = "organizationUnit", default, skip_serializing_if = "Option::is_none")] + pub organization_unit: Option, + #[doc = "The country code field in the subject name. If present, the country code should be represented by two-letter code defined in ISO 2166-1 (alpha-2). For example: 'US'."] + #[serde(rename = "countryCode", default, skip_serializing_if = "Option::is_none")] + pub country_code: Option, +} +impl ClientCertificateSubjectDistinguishedName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Thumbprints are used by the service to validate the device permission when authentication is done using self signed certificate."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientCertificateThumbprint { + #[doc = "The primary thumbprint used for validation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primary: Option, + #[doc = "The secondary thumbprint used for validation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secondary: Option, +} +impl ClientCertificateThumbprint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Client group resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientGroup { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of client group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl ClientGroup { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of client group."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientGroupProperties { + #[doc = "Description for the Client Group resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The grouping query for the clients.\r\nExample : attributes.keyName IN ['a', 'b', 'c']."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, + #[doc = "Provisioning state of the ClientGroup resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl ClientGroupProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod client_group_properties { + use super::*; + #[doc = "Provisioning state of the ClientGroup resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List Client Group operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientGroupsListResult { + #[doc = "A collection of Client Group."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of Client Group."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ClientGroupsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ClientGroupsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of client."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientProperties { + #[doc = "Description for the Client resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The name presented by the client for authentication. The default value is the name of the resource."] + #[serde(rename = "authenticationName", default, skip_serializing_if = "Option::is_none")] + pub authentication_name: Option, + #[doc = "The Authentication properties for the client."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authentication: Option, + #[doc = "The certificate authentication properties for the client."] + #[serde(rename = "clientCertificateAuthentication", default, skip_serializing_if = "Option::is_none")] + pub client_certificate_authentication: Option, + #[doc = "Indicates if the client is enabled or not. Default value is Enabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Attributes for the client. Supported values are int, bool, string, string[].\r\nExample:\r\n\"attributes\": { \"room\": \"345\", \"floor\": 12, \"deviceTypes\": [\"Fan\", \"Light\"] }"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option, + #[doc = "Provisioning state of the Client resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl ClientProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod client_properties { + use super::*; + #[doc = "Indicates if the client is enabled or not. Default value is Enabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("State", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("State", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for State { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Provisioning state of the Client resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List Client operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientsListResult { + #[doc = "A collection of Client."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of Client."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ClientsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ClientsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "ConnectionState information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectionState { + #[doc = "Status of the connection."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Description of the connection state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Actions required (if any)."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl ConnectionState { + pub fn new() -> Self { + Self::default() + } +} +pub mod connection_state { + use super::*; + #[doc = "Status of the connection."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Pending, + Approved, + Rejected, + Disconnected, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Pending => serializer.serialize_unit_variant("Status", 0u32, "Pending"), + Self::Approved => serializer.serialize_unit_variant("Status", 1u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("Status", 2u32, "Rejected"), + Self::Disconnected => serializer.serialize_unit_variant("Status", 3u32, "Disconnected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeadLetterDestination { + #[doc = "Type of the endpoint for the dead letter destination"] + #[serde(rename = "endpointType")] + pub endpoint_type: dead_letter_destination::EndpointType, +} +impl DeadLetterDestination { + pub fn new(endpoint_type: dead_letter_destination::EndpointType) -> Self { + Self { endpoint_type } + } +} +pub mod dead_letter_destination { + use super::*; + #[doc = "Type of the endpoint for the dead letter destination"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndpointType")] + pub enum EndpointType { + StorageBlob, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndpointType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndpointType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndpointType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::StorageBlob => serializer.serialize_unit_variant("EndpointType", 0u32, "StorageBlob"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about the deadletter destination with resource identity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeadLetterWithResourceIdentity { + #[doc = "The identity information with the event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] + #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] + pub dead_letter_destination: Option, +} +impl DeadLetterWithResourceIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the Get delivery attributes operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeliveryAttributeListResult { + #[doc = "A collection of DeliveryAttributeMapping"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl DeliveryAttributeListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Delivery attribute mapping details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeliveryAttributeMapping { + #[doc = "Name of the delivery attribute or header."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Type of the delivery attribute or header name."] + #[serde(rename = "type")] + pub type_: delivery_attribute_mapping::Type, +} +impl DeliveryAttributeMapping { + pub fn new(type_: delivery_attribute_mapping::Type) -> Self { + Self { name: None, type_ } + } +} +pub mod delivery_attribute_mapping { + use super::*; + #[doc = "Type of the delivery attribute or header name."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Static, + Dynamic, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Static => serializer.serialize_unit_variant("Type", 0u32, "Static"), + Self::Dynamic => serializer.serialize_unit_variant("Type", 1u32, "Dynamic"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the delivery configuration information of the event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeliveryConfiguration { + #[doc = "Delivery mode of the event subscription."] + #[serde(rename = "deliveryMode", default, skip_serializing_if = "Option::is_none")] + pub delivery_mode: Option, + #[doc = "Properties of the Queue info for event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub queue: Option, +} +impl DeliveryConfiguration { + pub fn new() -> Self { + Self::default() + } +} +pub mod delivery_configuration { + use super::*; + #[doc = "Delivery mode of the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DeliveryMode")] + pub enum DeliveryMode { + Queue, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DeliveryMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DeliveryMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DeliveryMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Queue => serializer.serialize_unit_variant("DeliveryMode", 0u32, "Queue"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about the delivery for an event subscription with resource identity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeliveryWithResourceIdentity { + #[doc = "The identity information with the event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Information about the destination for an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub destination: Option, +} +impl DeliveryWithResourceIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "EventGrid Domain."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Domain { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the Event Grid Domain Resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Describes an EventGrid Resource Sku."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Domain { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + sku: None, + identity: None, + system_data: None, + } + } +} +#[doc = "Properties of the Event Grid Domain Resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainProperties { + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "Provisioning state of the Event Grid Domain Resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, + #[doc = "Endpoint for the Event Grid Domain Resource which is used for publishing the events."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option, + #[doc = "This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource."] + #[serde(rename = "inputSchema", default, skip_serializing_if = "Option::is_none")] + pub input_schema: Option, + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, + #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] + #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] + pub input_schema_mapping: Option, + #[doc = "Metric resource id for the Event Grid Domain Resource."] + #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] + pub metric_resource_id: Option, + #[doc = "This determines if traffic is allowed over public network. By default it is enabled.\r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, + #[doc = "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.\r\nIn this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.\r\nWhen this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is\r\ncreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic\r\nby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the\r\nflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the\r\ndomain topic on demand if needed."] + #[serde(rename = "autoCreateTopicWithFirstSubscription", default, skip_serializing_if = "Option::is_none")] + pub auto_create_topic_with_first_subscription: Option, + #[doc = "This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.\r\nIn this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.\r\nWhen this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope\r\nof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed\r\n(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full\r\ncontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer\r\nresources by the user."] + #[serde(rename = "autoDeleteTopicWithLastSubscription", default, skip_serializing_if = "Option::is_none")] + pub auto_delete_topic_with_last_subscription: Option, + #[doc = "Data Residency Boundary of the resource."] + #[serde(rename = "dataResidencyBoundary", default, skip_serializing_if = "Option::is_none")] + pub data_residency_boundary: Option, +} +impl DomainProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod domain_properties { + use super::*; + #[doc = "Provisioning state of the Event Grid Domain Resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "InputSchema")] + pub enum InputSchema { + EventGridSchema, + CustomEventSchema, + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for InputSchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for InputSchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for InputSchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::EventGridSchema => serializer.serialize_unit_variant("InputSchema", 0u32, "EventGridSchema"), + Self::CustomEventSchema => serializer.serialize_unit_variant("InputSchema", 1u32, "CustomEventSchema"), + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("InputSchema", 2u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for InputSchema { + fn default() -> Self { + Self::EventGridSchema + } + } + #[doc = "This determines if traffic is allowed over public network. By default it is enabled.\r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PublicNetworkAccess { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Data Residency Boundary of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DataResidencyBoundary")] + pub enum DataResidencyBoundary { + WithinGeopair, + WithinRegion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DataResidencyBoundary { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DataResidencyBoundary { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DataResidencyBoundary { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WithinGeopair => serializer.serialize_unit_variant("DataResidencyBoundary", 0u32, "WithinGeopair"), + Self::WithinRegion => serializer.serialize_unit_variant("DataResidencyBoundary", 1u32, "WithinRegion"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Domain regenerate share access key request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DomainRegenerateKeyRequest { + #[doc = "Key name to regenerate key1 or key2."] + #[serde(rename = "keyName")] + pub key_name: String, +} +impl DomainRegenerateKeyRequest { + pub fn new(key_name: String) -> Self { + Self { key_name } + } +} +#[doc = "Shared access keys of the Domain."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainSharedAccessKeys { + #[doc = "Shared access key1 for the domain."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key1: Option, + #[doc = "Shared access key2 for the domain."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key2: Option, +} +impl DomainSharedAccessKeys { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Domain Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainTopic { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the Domain Topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl DomainTopic { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Domain Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainTopicProperties { + #[doc = "Provisioning state of the domain topic."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl DomainTopicProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod domain_topic_properties { + use super::*; + #[doc = "Provisioning state of the domain topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List Domain Topics operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainTopicsListResult { + #[doc = "A collection of Domain Topics."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of domain topics."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DomainTopicsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DomainTopicsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information of domain update parameter properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainUpdateParameterProperties { + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, + #[doc = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, + #[doc = "This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.\r\nIn this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.\r\nWhen this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is\r\ncreated at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic\r\nby the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the\r\nflexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the\r\ndomain topic on demand if needed."] + #[serde(rename = "autoCreateTopicWithFirstSubscription", default, skip_serializing_if = "Option::is_none")] + pub auto_create_topic_with_first_subscription: Option, + #[doc = "This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource.\r\nIn this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true.\r\nWhen this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope\r\nof the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed\r\n(e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full\r\ncontrol of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer\r\nresources by the user."] + #[serde(rename = "autoDeleteTopicWithLastSubscription", default, skip_serializing_if = "Option::is_none")] + pub auto_delete_topic_with_last_subscription: Option, + #[doc = "The data residency boundary for the domain."] + #[serde(rename = "dataResidencyBoundary", default, skip_serializing_if = "Option::is_none")] + pub data_residency_boundary: Option, + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, +} +impl DomainUpdateParameterProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod domain_update_parameter_properties { + use super::*; + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PublicNetworkAccess { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The data residency boundary for the domain."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DataResidencyBoundary")] + pub enum DataResidencyBoundary { + WithinGeopair, + WithinRegion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DataResidencyBoundary { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DataResidencyBoundary { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DataResidencyBoundary { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WithinGeopair => serializer.serialize_unit_variant("DataResidencyBoundary", 0u32, "WithinGeopair"), + Self::WithinRegion => serializer.serialize_unit_variant("DataResidencyBoundary", 1u32, "WithinRegion"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Domain update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainUpdateParameters { + #[doc = "Tags of the domains resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Information of domain update parameter properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Describes an EventGrid Resource Sku."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl DomainUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Domains operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DomainsListResult { + #[doc = "A collection of Domains."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of domains."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DomainsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DomainsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Dynamic delivery attribute mapping details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DynamicDeliveryAttributeMapping { + #[serde(flatten)] + pub delivery_attribute_mapping: DeliveryAttributeMapping, + #[doc = "Properties of dynamic delivery attribute mapping."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DynamicDeliveryAttributeMapping { + pub fn new(delivery_attribute_mapping: DeliveryAttributeMapping) -> Self { + Self { + delivery_attribute_mapping, + properties: None, + } + } +} +#[doc = "Properties of dynamic delivery attribute mapping."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DynamicDeliveryAttributeMappingProperties { + #[doc = "JSON path in the event which contains attribute value."] + #[serde(rename = "sourceField", default, skip_serializing_if = "Option::is_none")] + pub source_field: Option, +} +impl DynamicDeliveryAttributeMappingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DynamicRoutingEnrichment { + #[doc = "Dynamic routing enrichment key."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + #[doc = "Dynamic routing enrichment value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl DynamicRoutingEnrichment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the event hub destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventHubEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "The properties for a event hub destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl EventHubEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "The properties for a event hub destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventHubEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Delivery attribute details."] + #[serde( + rename = "deliveryAttributeMappings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delivery_attribute_mappings: Vec, +} +impl EventHubEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Event Subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscription { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the Event Subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl EventSubscription { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventSubscriptionDestination { + #[doc = "Type of the endpoint for the event subscription destination."] + #[serde(rename = "endpointType")] + pub endpoint_type: event_subscription_destination::EndpointType, +} +impl EventSubscriptionDestination { + pub fn new(endpoint_type: event_subscription_destination::EndpointType) -> Self { + Self { endpoint_type } + } +} +pub mod event_subscription_destination { + use super::*; + #[doc = "Type of the endpoint for the event subscription destination."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndpointType")] + pub enum EndpointType { + WebHook, + EventHub, + StorageQueue, + HybridConnection, + ServiceBusQueue, + ServiceBusTopic, + AzureFunction, + PartnerDestination, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndpointType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndpointType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndpointType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WebHook => serializer.serialize_unit_variant("EndpointType", 0u32, "WebHook"), + Self::EventHub => serializer.serialize_unit_variant("EndpointType", 1u32, "EventHub"), + Self::StorageQueue => serializer.serialize_unit_variant("EndpointType", 2u32, "StorageQueue"), + Self::HybridConnection => serializer.serialize_unit_variant("EndpointType", 3u32, "HybridConnection"), + Self::ServiceBusQueue => serializer.serialize_unit_variant("EndpointType", 4u32, "ServiceBusQueue"), + Self::ServiceBusTopic => serializer.serialize_unit_variant("EndpointType", 5u32, "ServiceBusTopic"), + Self::AzureFunction => serializer.serialize_unit_variant("EndpointType", 6u32, "AzureFunction"), + Self::PartnerDestination => serializer.serialize_unit_variant("EndpointType", 7u32, "PartnerDestination"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Filter for the Event Subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscriptionFilter { + #[doc = "An optional string to filter events for an event subscription based on a resource path prefix.\r\nThe format of this depends on the publisher of the events.\r\nWildcard characters are not supported in this path."] + #[serde(rename = "subjectBeginsWith", default, skip_serializing_if = "Option::is_none")] + pub subject_begins_with: Option, + #[doc = "An optional string to filter events for an event subscription based on a resource path suffix.\r\nWildcard characters are not supported in this path."] + #[serde(rename = "subjectEndsWith", default, skip_serializing_if = "Option::is_none")] + pub subject_ends_with: Option, + #[doc = "A list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null."] + #[serde( + rename = "includedEventTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub included_event_types: Vec, + #[doc = "Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter\r\nshould be compared in a case sensitive manner."] + #[serde(rename = "isSubjectCaseSensitive", default, skip_serializing_if = "Option::is_none")] + pub is_subject_case_sensitive: Option, + #[doc = "Allows advanced filters to be evaluated against an array of values instead of expecting a singular value."] + #[serde(rename = "enableAdvancedFilteringOnArrays", default, skip_serializing_if = "Option::is_none")] + pub enable_advanced_filtering_on_arrays: Option, + #[doc = "An array of advanced filters that are used for filtering event subscriptions."] + #[serde( + rename = "advancedFilters", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub advanced_filters: Vec, +} +impl EventSubscriptionFilter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Full endpoint url of an event subscription"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscriptionFullUrl { + #[doc = "The URL that represents the endpoint of the destination of an event subscription."] + #[serde(rename = "endpointUrl", default, skip_serializing_if = "Option::is_none")] + pub endpoint_url: Option, +} +impl EventSubscriptionFullUrl { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The identity information with the event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscriptionIdentity { + #[doc = "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The user identity associated with the resource."] + #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identity: Option, +} +impl EventSubscriptionIdentity { + pub fn new() -> Self { + Self::default() + } +} +pub mod event_subscription_identity { + use super::*; + #[doc = "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + SystemAssigned, + UserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SystemAssigned => serializer.serialize_unit_variant("Type", 0u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("Type", 1u32, "UserAssigned"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Event Subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscriptionProperties { + #[doc = "Name of the topic of the event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub topic: Option, + #[doc = "Provisioning state of the event subscription."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Information about the destination for an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub destination: Option, + #[doc = "Information about the delivery for an event subscription with resource identity."] + #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] + pub delivery_with_resource_identity: Option, + #[doc = "Filter for the Event Subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, + #[doc = "List of user defined labels."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub labels: Vec, + #[doc = "Expiration time of the event subscription."] + #[serde(rename = "expirationTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_time_utc: Option, + #[doc = "The event delivery schema for the event subscription."] + #[serde(rename = "eventDeliverySchema", default, skip_serializing_if = "Option::is_none")] + pub event_delivery_schema: Option, + #[doc = "Information about the retry policy for an event subscription."] + #[serde(rename = "retryPolicy", default, skip_serializing_if = "Option::is_none")] + pub retry_policy: Option, + #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] + #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] + pub dead_letter_destination: Option, + #[doc = "Information about the deadletter destination with resource identity."] + #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] + pub dead_letter_with_resource_identity: Option, +} +impl EventSubscriptionProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod event_subscription_properties { + use super::*; + #[doc = "Provisioning state of the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + AwaitingManualAction, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::AwaitingManualAction => serializer.serialize_unit_variant("ProvisioningState", 6u32, "AwaitingManualAction"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The event delivery schema for the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventDeliverySchema")] + pub enum EventDeliverySchema { + EventGridSchema, + CustomInputSchema, + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventDeliverySchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventDeliverySchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventDeliverySchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::EventGridSchema => serializer.serialize_unit_variant("EventDeliverySchema", 0u32, "EventGridSchema"), + Self::CustomInputSchema => serializer.serialize_unit_variant("EventDeliverySchema", 1u32, "CustomInputSchema"), + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("EventDeliverySchema", 2u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for EventDeliverySchema { + fn default() -> Self { + Self::EventGridSchema + } + } +} +#[doc = "Properties of the Event Subscription update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscriptionUpdateParameters { + #[doc = "Information about the destination for an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub destination: Option, + #[doc = "Information about the delivery for an event subscription with resource identity."] + #[serde(rename = "deliveryWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] + pub delivery_with_resource_identity: Option, + #[doc = "Filter for the Event Subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, + #[doc = "List of user defined labels."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub labels: Vec, + #[doc = "Information about the expiration time for the event subscription."] + #[serde(rename = "expirationTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_time_utc: Option, + #[doc = "The event delivery schema for the event subscription."] + #[serde(rename = "eventDeliverySchema", default, skip_serializing_if = "Option::is_none")] + pub event_delivery_schema: Option, + #[doc = "Information about the retry policy for an event subscription."] + #[serde(rename = "retryPolicy", default, skip_serializing_if = "Option::is_none")] + pub retry_policy: Option, + #[doc = "Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class."] + #[serde(rename = "deadLetterDestination", default, skip_serializing_if = "Option::is_none")] + pub dead_letter_destination: Option, + #[doc = "Information about the deadletter destination with resource identity."] + #[serde(rename = "deadLetterWithResourceIdentity", default, skip_serializing_if = "Option::is_none")] + pub dead_letter_with_resource_identity: Option, +} +impl EventSubscriptionUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +pub mod event_subscription_update_parameters { + use super::*; + #[doc = "The event delivery schema for the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventDeliverySchema")] + pub enum EventDeliverySchema { + EventGridSchema, + CustomInputSchema, + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventDeliverySchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventDeliverySchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventDeliverySchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::EventGridSchema => serializer.serialize_unit_variant("EventDeliverySchema", 0u32, "EventGridSchema"), + Self::CustomInputSchema => serializer.serialize_unit_variant("EventDeliverySchema", 1u32, "CustomInputSchema"), + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("EventDeliverySchema", 2u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List EventSubscriptions operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventSubscriptionsListResult { + #[doc = "A collection of EventSubscriptions"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of event subscriptions"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for EventSubscriptionsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl EventSubscriptionsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Event Type for a subject under a topic"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventType { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the event type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl EventType { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The event type information for Channels."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventTypeInfo { + #[doc = "The kind of event type used."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[doc = "A collection of inline event types for the resource. The inline event type keys are of type string which represents the name of the event.\r\nAn example of a valid inline event name is \"Contoso.OrderCreated\".\r\nThe inline event type values are of type InlineEventProperties and will contain additional information for every inline event type."] + #[serde(rename = "inlineEventTypes", default, skip_serializing_if = "Option::is_none")] + pub inline_event_types: Option, +} +impl EventTypeInfo { + pub fn new() -> Self { + Self::default() + } +} +pub mod event_type_info { + use super::*; + #[doc = "The kind of event type used."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + Inline, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Inline => serializer.serialize_unit_variant("Kind", 0u32, "Inline"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the event type"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventTypeProperties { + #[doc = "Display name of the event type."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Description of the event type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Url of the schema for this event type."] + #[serde(rename = "schemaUrl", default, skip_serializing_if = "Option::is_none")] + pub schema_url: Option, + #[doc = "IsInDefaultSet flag of the event type."] + #[serde(rename = "isInDefaultSet", default, skip_serializing_if = "Option::is_none")] + pub is_in_default_set: Option, +} +impl EventTypeProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Event Types operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EventTypesListResult { + #[doc = "A collection of event types"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for EventTypesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl EventTypesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Definition of an Extended Location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtendedLocation { + #[doc = "Fully qualified name of the extended location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Type of the extended location."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl ExtendedLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionTopic { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the Extension Topic"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl ExtensionTopic { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Extension Topic"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionTopicProperties { + #[doc = "Description of the extension topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "System topic resource id which is mapped to the source."] + #[serde(rename = "systemTopic", default, skip_serializing_if = "Option::is_none")] + pub system_topic: Option, +} +impl ExtensionTopicProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "This is the base type that represents a filter. To configure a filter, do not directly instantiate an object of this class. Instead, instantiate\r\nan object of a derived class such as BoolEqualsFilter, NumberInFilter, StringEqualsFilter etc depending on the type of the key based on\r\nwhich you want to filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Filter { + #[doc = "The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others."] + #[serde(rename = "operatorType")] + pub operator_type: filter::OperatorType, + #[doc = "The field/property in the event based on which you want to filter."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, +} +impl Filter { + pub fn new(operator_type: filter::OperatorType) -> Self { + Self { operator_type, key: None } + } +} +pub mod filter { + use super::*; + #[doc = "The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OperatorType")] + pub enum OperatorType { + NumberIn, + NumberNotIn, + NumberLessThan, + NumberGreaterThan, + NumberLessThanOrEquals, + NumberGreaterThanOrEquals, + BoolEquals, + StringIn, + StringNotIn, + StringBeginsWith, + StringEndsWith, + StringContains, + NumberInRange, + NumberNotInRange, + StringNotBeginsWith, + StringNotEndsWith, + StringNotContains, + IsNullOrUndefined, + IsNotNull, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OperatorType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OperatorType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OperatorType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NumberIn => serializer.serialize_unit_variant("OperatorType", 0u32, "NumberIn"), + Self::NumberNotIn => serializer.serialize_unit_variant("OperatorType", 1u32, "NumberNotIn"), + Self::NumberLessThan => serializer.serialize_unit_variant("OperatorType", 2u32, "NumberLessThan"), + Self::NumberGreaterThan => serializer.serialize_unit_variant("OperatorType", 3u32, "NumberGreaterThan"), + Self::NumberLessThanOrEquals => serializer.serialize_unit_variant("OperatorType", 4u32, "NumberLessThanOrEquals"), + Self::NumberGreaterThanOrEquals => serializer.serialize_unit_variant("OperatorType", 5u32, "NumberGreaterThanOrEquals"), + Self::BoolEquals => serializer.serialize_unit_variant("OperatorType", 6u32, "BoolEquals"), + Self::StringIn => serializer.serialize_unit_variant("OperatorType", 7u32, "StringIn"), + Self::StringNotIn => serializer.serialize_unit_variant("OperatorType", 8u32, "StringNotIn"), + Self::StringBeginsWith => serializer.serialize_unit_variant("OperatorType", 9u32, "StringBeginsWith"), + Self::StringEndsWith => serializer.serialize_unit_variant("OperatorType", 10u32, "StringEndsWith"), + Self::StringContains => serializer.serialize_unit_variant("OperatorType", 11u32, "StringContains"), + Self::NumberInRange => serializer.serialize_unit_variant("OperatorType", 12u32, "NumberInRange"), + Self::NumberNotInRange => serializer.serialize_unit_variant("OperatorType", 13u32, "NumberNotInRange"), + Self::StringNotBeginsWith => serializer.serialize_unit_variant("OperatorType", 14u32, "StringNotBeginsWith"), + Self::StringNotEndsWith => serializer.serialize_unit_variant("OperatorType", 15u32, "StringNotEndsWith"), + Self::StringNotContains => serializer.serialize_unit_variant("OperatorType", 16u32, "StringNotContains"), + Self::IsNullOrUndefined => serializer.serialize_unit_variant("OperatorType", 17u32, "IsNullOrUndefined"), + Self::IsNotNull => serializer.serialize_unit_variant("OperatorType", 18u32, "IsNotNull"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Filters configuration for the Event Subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FiltersConfiguration { + #[doc = "A list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null."] + #[serde( + rename = "includedEventTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub included_event_types: Vec, + #[doc = "An array of filters that are used for filtering event subscriptions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub filters: Vec, +} +impl FiltersConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the HybridConnection destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridConnectionEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "The properties for a hybrid connection destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl HybridConnectionEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "The properties for a hybrid connection destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HybridConnectionEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource ID of an hybrid connection that is the destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Delivery attribute details."] + #[serde( + rename = "deliveryAttributeMappings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delivery_attribute_mappings: Vec, +} +impl HybridConnectionEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The identity information for the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IdentityInfo { + #[doc = "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The principal ID of resource identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of resource."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form:\r\n'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.\r\nThis property is currently not used and reserved for future usage."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl IdentityInfo { + pub fn new() -> Self { + Self::default() + } +} +pub mod identity_info { + use super::*; + #[doc = "The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + None, + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("Type", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("Type", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("Type", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => serializer.serialize_unit_variant("Type", 3u32, "SystemAssigned, UserAssigned"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InboundIpRule { + #[doc = "IP Address in CIDR notation e.g., 10.0.0.0/8."] + #[serde(rename = "ipMask", default, skip_serializing_if = "Option::is_none")] + pub ip_mask: Option, + #[doc = "Action to perform based on the match or no match of the IpMask."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option, +} +impl InboundIpRule { + pub fn new() -> Self { + Self::default() + } +} +pub mod inbound_ip_rule { + use super::*; + #[doc = "Action to perform based on the match or no match of the IpMask."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Action")] + pub enum Action { + Allow, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Action { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Action { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Action { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Allow => serializer.serialize_unit_variant("Action", 0u32, "Allow"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Additional information about every inline event."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InlineEventProperties { + #[doc = "The description for the inline event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The displayName for the inline event."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The documentationUrl for the inline event."] + #[serde(rename = "documentationUrl", default, skip_serializing_if = "Option::is_none")] + pub documentation_url: Option, + #[doc = "The dataSchemaUrl for the inline event."] + #[serde(rename = "dataSchemaUrl", default, skip_serializing_if = "Option::is_none")] + pub data_schema_url: Option, +} +impl InlineEventProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InputSchemaMapping { + #[doc = "Type of the custom mapping"] + #[serde(rename = "inputSchemaMappingType")] + pub input_schema_mapping_type: input_schema_mapping::InputSchemaMappingType, +} +impl InputSchemaMapping { + pub fn new(input_schema_mapping_type: input_schema_mapping::InputSchemaMappingType) -> Self { + Self { input_schema_mapping_type } + } +} +pub mod input_schema_mapping { + use super::*; + #[doc = "Type of the custom mapping"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "InputSchemaMappingType")] + pub enum InputSchemaMappingType { + Json, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for InputSchemaMappingType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for InputSchemaMappingType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for InputSchemaMappingType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Json => serializer.serialize_unit_variant("InputSchemaMappingType", 0u32, "Json"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "IsNotNull Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IsNotNullAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, +} +impl IsNotNullAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { advanced_filter } + } +} +#[doc = "IsNotNull Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IsNotNullFilter { + #[serde(flatten)] + pub filter: Filter, +} +impl IsNotNullFilter { + pub fn new(filter: Filter) -> Self { + Self { filter } + } +} +#[doc = "IsNullOrUndefined Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IsNullOrUndefinedAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, +} +impl IsNullOrUndefinedAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { advanced_filter } + } +} +#[doc = "IsNullOrUndefined Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IsNullOrUndefinedFilter { + #[serde(flatten)] + pub filter: Filter, +} +impl IsNullOrUndefinedFilter { + pub fn new(filter: Filter) -> Self { + Self { filter } + } +} +#[doc = "This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the input event schema."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JsonField { + #[doc = "Name of a field in the input event schema that's to be used as the source of a mapping."] + #[serde(rename = "sourceField", default, skip_serializing_if = "Option::is_none")] + pub source_field: Option, +} +impl JsonField { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "This is used to express the source of an input schema mapping for a single target field\r\nin the Event Grid Event schema. This is currently used in the mappings for the 'subject',\r\n'eventtype' and 'dataversion' properties. This represents a field in the input event schema\r\nalong with a default value to be used, and at least one of these two properties should be provided."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JsonFieldWithDefault { + #[doc = "Name of a field in the input event schema that's to be used as the source of a mapping."] + #[serde(rename = "sourceField", default, skip_serializing_if = "Option::is_none")] + pub source_field: Option, + #[doc = "The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload."] + #[serde(rename = "defaultValue", default, skip_serializing_if = "Option::is_none")] + pub default_value: Option, +} +impl JsonFieldWithDefault { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "This enables publishing to Event Grid using a custom input schema. This can be used to map properties from a custom input JSON schema to the Event Grid event schema."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JsonInputSchemaMapping { + #[serde(flatten)] + pub input_schema_mapping: InputSchemaMapping, + #[doc = "This can be used to map properties of a source schema (or default values, for certain supported properties) to properties of the EventGridEvent schema."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl JsonInputSchemaMapping { + pub fn new(input_schema_mapping: InputSchemaMapping) -> Self { + Self { + input_schema_mapping, + properties: None, + } + } +} +#[doc = "This can be used to map properties of a source schema (or default values, for certain supported properties) to properties of the EventGridEvent schema."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JsonInputSchemaMappingProperties { + #[doc = "This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the input event schema."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the input event schema."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub topic: Option, + #[doc = "This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the input event schema."] + #[serde(rename = "eventTime", default, skip_serializing_if = "Option::is_none")] + pub event_time: Option, + #[doc = "This is used to express the source of an input schema mapping for a single target field\r\nin the Event Grid Event schema. This is currently used in the mappings for the 'subject',\r\n'eventtype' and 'dataversion' properties. This represents a field in the input event schema\r\nalong with a default value to be used, and at least one of these two properties should be provided."] + #[serde(rename = "eventType", default, skip_serializing_if = "Option::is_none")] + pub event_type: Option, + #[doc = "This is used to express the source of an input schema mapping for a single target field\r\nin the Event Grid Event schema. This is currently used in the mappings for the 'subject',\r\n'eventtype' and 'dataversion' properties. This represents a field in the input event schema\r\nalong with a default value to be used, and at least one of these two properties should be provided."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subject: Option, + #[doc = "This is used to express the source of an input schema mapping for a single target field\r\nin the Event Grid Event schema. This is currently used in the mappings for the 'subject',\r\n'eventtype' and 'dataversion' properties. This represents a field in the input event schema\r\nalong with a default value to be used, and at least one of these two properties should be provided."] + #[serde(rename = "dataVersion", default, skip_serializing_if = "Option::is_none")] + pub data_version: Option, +} +impl JsonInputSchemaMappingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Namespace resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Namespace { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the namespace resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Represents available Sku pricing tiers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Namespace { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + sku: None, + identity: None, + system_data: None, + } + } +} +#[doc = "Properties of the namespace resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceProperties { + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "Provisioning state of the namespace resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Properties of the Topics Configuration."] + #[serde(rename = "topicsConfiguration", default, skip_serializing_if = "Option::is_none")] + pub topics_configuration: Option, + #[doc = "Properties of the Topic Spaces Configuration."] + #[serde(rename = "topicSpacesConfiguration", default, skip_serializing_if = "Option::is_none")] + pub topic_spaces_configuration: Option, + #[doc = "Allows the user to specify if the service is zone-redundant. This is a required property and user needs to specify this value explicitly.\r\nOnce specified, this property cannot be updated."] + #[serde(rename = "isZoneRedundant", default, skip_serializing_if = "Option::is_none")] + pub is_zone_redundant: Option, + #[doc = "This determines if traffic is allowed over public network. By default it is enabled.\r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported."] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, +} +impl NamespaceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod namespace_properties { + use super::*; + #[doc = "Provisioning state of the namespace resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + DeleteFailed, + CreateFailed, + UpdatedFailed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::DeleteFailed => serializer.serialize_unit_variant("ProvisioningState", 7u32, "DeleteFailed"), + Self::CreateFailed => serializer.serialize_unit_variant("ProvisioningState", 8u32, "CreateFailed"), + Self::UpdatedFailed => serializer.serialize_unit_variant("ProvisioningState", 9u32, "UpdatedFailed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "This determines if traffic is allowed over public network. By default it is enabled.\r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Namespace regenerate share access key request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NamespaceRegenerateKeyRequest { + #[doc = "Key name to regenerate key1 or key2."] + #[serde(rename = "keyName")] + pub key_name: String, +} +impl NamespaceRegenerateKeyRequest { + pub fn new(key_name: String) -> Self { + Self { key_name } + } +} +#[doc = "Shared access keys of the Namespace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceSharedAccessKeys { + #[doc = "Shared access key1 for the namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key1: Option, + #[doc = "Shared access key2 for the namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key2: Option, +} +impl NamespaceSharedAccessKeys { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents available Sku pricing tiers."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceSku { + #[doc = "The name of the SKU."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Specifies the number of Throughput Units that defines the capacity for the namespace. The property default value is\r\n1 which signifies 1 Throughput Unit = 1MB/s ingress and 2MB/s egress per namespace. Min capacity is 1 and\r\nmax allowed capacity is 20."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capacity: Option, +} +impl NamespaceSku { + pub fn new() -> Self { + Self::default() + } +} +pub mod namespace_sku { + use super::*; + #[doc = "The name of the SKU."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Name")] + pub enum Name { + Standard, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Name { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Name { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Name { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Standard => serializer.serialize_unit_variant("Name", 0u32, "Standard"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Namespace topic details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceTopic { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the namespace topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl NamespaceTopic { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the namespace topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceTopicProperties { + #[doc = "Provisioning state of the namespace topic."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Publisher type of the namespace topic."] + #[serde(rename = "publisherType", default, skip_serializing_if = "Option::is_none")] + pub publisher_type: Option, + #[doc = "This determines the format that is expected for incoming events published to the topic."] + #[serde(rename = "inputSchema", default, skip_serializing_if = "Option::is_none")] + pub input_schema: Option, + #[doc = "Event retention for the namespace topic expressed in days. The property default value is 1 day.\r\nMin event retention duration value is 1 day and max event retention duration value is 1 day."] + #[serde(rename = "eventRetentionInDays", default, skip_serializing_if = "Option::is_none")] + pub event_retention_in_days: Option, +} +impl NamespaceTopicProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod namespace_topic_properties { + use super::*; + #[doc = "Provisioning state of the namespace topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + DeleteFailed, + CreateFailed, + UpdatedFailed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::DeleteFailed => serializer.serialize_unit_variant("ProvisioningState", 7u32, "DeleteFailed"), + Self::CreateFailed => serializer.serialize_unit_variant("ProvisioningState", 8u32, "CreateFailed"), + Self::UpdatedFailed => serializer.serialize_unit_variant("ProvisioningState", 9u32, "UpdatedFailed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Publisher type of the namespace topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublisherType")] + pub enum PublisherType { + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublisherType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublisherType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublisherType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Custom => serializer.serialize_unit_variant("PublisherType", 0u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "This determines the format that is expected for incoming events published to the topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "InputSchema")] + pub enum InputSchema { + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for InputSchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for InputSchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for InputSchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("InputSchema", 0u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for InputSchema { + fn default() -> Self { + Self::CloudEventSchemaV10 + } + } +} +#[doc = "Information of namespace topic update parameter properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceTopicUpdateParameterProperties { + #[doc = "Event retention for the namespace topic expressed in days. The property default value is 1 day.\r\nMin event retention duration value is 1 day and max event retention duration value is 1 day."] + #[serde(rename = "eventRetentionInDays", default, skip_serializing_if = "Option::is_none")] + pub event_retention_in_days: Option, +} +impl NamespaceTopicUpdateParameterProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the namespace topic update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceTopicUpdateParameters { + #[doc = "Information of namespace topic update parameter properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl NamespaceTopicUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List namespace topics operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceTopicsListResult { + #[doc = "A collection of namespace topics."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of namespace topics."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for NamespaceTopicsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl NamespaceTopicsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information of namespace update parameter properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceUpdateParameterProperties { + #[doc = "Properties of the topic spaces configuration info of a namespace."] + #[serde(rename = "topicSpacesConfiguration", default, skip_serializing_if = "Option::is_none")] + pub topic_spaces_configuration: Option, + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, +} +impl NamespaceUpdateParameterProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod namespace_update_parameter_properties { + use super::*; + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties to update namespace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespaceUpdateParameters { + #[doc = "Tags of the namespace resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Represents available Sku pricing tiers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Information of namespace update parameter properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl NamespaceUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Namespaces operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NamespacesListResult { + #[doc = "A collection of namespaces."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of namespaces."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for NamespacesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl NamespacesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "NumberGreaterThan Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberGreaterThanAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberGreaterThanAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + value: None, + } + } +} +#[doc = "NumberGreaterThan Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberGreaterThanFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberGreaterThanFilter { + pub fn new(filter: Filter) -> Self { + Self { filter, value: None } + } +} +#[doc = "NumberGreaterThanOrEquals Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberGreaterThanOrEqualsAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberGreaterThanOrEqualsAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + value: None, + } + } +} +#[doc = "NumberGreaterThanOrEquals Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberGreaterThanOrEqualsFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberGreaterThanOrEqualsFilter { + pub fn new(filter: Filter) -> Self { + Self { filter, value: None } + } +} +#[doc = "NumberIn Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberInAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl NumberInAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "NumberIn Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberInFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl NumberInFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "NumberInRange Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberInRangeAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec>, +} +impl NumberInRangeAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "NumberInRange Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberInRangeFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec>, +} +impl NumberInRangeFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "NumberLessThan Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberLessThanAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberLessThanAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + value: None, + } + } +} +#[doc = "NumberLessThan Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberLessThanFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberLessThanFilter { + pub fn new(filter: Filter) -> Self { + Self { filter, value: None } + } +} +#[doc = "NumberLessThanOrEquals Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberLessThanOrEqualsAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberLessThanOrEqualsAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + value: None, + } + } +} +#[doc = "NumberLessThanOrEquals Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberLessThanOrEqualsFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The filter value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl NumberLessThanOrEqualsFilter { + pub fn new(filter: Filter) -> Self { + Self { filter, value: None } + } +} +#[doc = "NumberNotIn Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberNotInAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl NumberNotInAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "NumberNotIn Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberNotInFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl NumberNotInFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "NumberNotInRange Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberNotInRangeAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec>, +} +impl NumberNotInRangeAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "NumberNotInRange Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct NumberNotInRangeFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec>, +} +impl NumberNotInRangeFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "Represents an operation returned by the GetOperations request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Name of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Information about an operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "Origin of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "This Boolean is used to determine if the operation is a data plane action or not."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Properties of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about an operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationInfo { + #[doc = "Name of the provider"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "Name of the resource type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "Name of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "Description of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl OperationInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Operations operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationsListResult { + #[doc = "A collection of operations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for OperationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl OperationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the partner."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Partner { + #[doc = "The immutableId of the corresponding partner registration."] + #[serde(rename = "partnerRegistrationImmutableId", default, skip_serializing_if = "Option::is_none")] + pub partner_registration_immutable_id: Option, + #[doc = "The partner name."] + #[serde(rename = "partnerName", default, skip_serializing_if = "Option::is_none")] + pub partner_name: Option, + #[doc = "Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or delete resources in subscriber's\r\ncontext will fail. If specified, the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration.\r\nIf not specified, the default value will be the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not specified."] + #[serde(rename = "authorizationExpirationTimeInUtc", default, with = "azure_core::date::rfc3339::option")] + pub authorization_expiration_time_in_utc: Option, +} +impl Partner { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The partner authorization details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerAuthorization { + #[doc = "Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays is\r\nnot specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days."] + #[serde(rename = "defaultMaximumExpirationTimeInDays", default, skip_serializing_if = "Option::is_none")] + pub default_maximum_expiration_time_in_days: Option, + #[doc = "The list of authorized partners."] + #[serde( + rename = "authorizedPartnersList", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub authorized_partners_list: Vec, +} +impl PartnerAuthorization { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Partner client authentication"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerClientAuthentication { + #[doc = "Type of client authentication"] + #[serde(rename = "clientAuthenticationType")] + pub client_authentication_type: partner_client_authentication::ClientAuthenticationType, +} +impl PartnerClientAuthentication { + pub fn new(client_authentication_type: partner_client_authentication::ClientAuthenticationType) -> Self { + Self { + client_authentication_type, + } + } +} +pub mod partner_client_authentication { + use super::*; + #[doc = "Type of client authentication"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ClientAuthenticationType")] + pub enum ClientAuthenticationType { + #[serde(rename = "AzureAD")] + AzureAd, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ClientAuthenticationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ClientAuthenticationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ClientAuthenticationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AzureAd => serializer.serialize_unit_variant("ClientAuthenticationType", 0u32, "AzureAD"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for ClientAuthenticationType { + fn default() -> Self { + Self::AzureAd + } + } +} +#[doc = "Partner configuration information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerConfiguration { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the partner configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "Location of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Tags of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl PartnerConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the partner configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerConfigurationProperties { + #[doc = "The partner authorization details."] + #[serde(rename = "partnerAuthorization", default, skip_serializing_if = "Option::is_none")] + pub partner_authorization: Option, + #[doc = "Provisioning state of the partner configuration."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PartnerConfigurationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod partner_configuration_properties { + use super::*; + #[doc = "Provisioning state of the partner configuration."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information of partner configuration update parameter properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerConfigurationUpdateParameterProperties { + #[doc = "The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days."] + #[serde(rename = "defaultMaximumExpirationTimeInDays", default, skip_serializing_if = "Option::is_none")] + pub default_maximum_expiration_time_in_days: Option, +} +impl PartnerConfigurationUpdateParameterProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the partner configuration update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerConfigurationUpdateParameters { + #[doc = "Tags of the partner configuration resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Information of partner configuration update parameter properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PartnerConfigurationUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List partner configurations operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerConfigurationsListResult { + #[doc = "A collection of partner configurations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of partner configurations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PartnerConfigurationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PartnerConfigurationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Event Grid Partner Destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerDestination { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the Partner Destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PartnerDestination { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + } + } +} +#[doc = "Properties of the corresponding partner destination of a Channel."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerDestinationInfo { + #[doc = "Azure subscription ID of the subscriber. The partner destination associated with the channel will be\r\ncreated under this Azure subscription."] + #[serde(rename = "azureSubscriptionId", default, skip_serializing_if = "Option::is_none")] + pub azure_subscription_id: Option, + #[doc = "Azure Resource Group of the subscriber. The partner destination associated with the channel will be\r\ncreated under this resource group."] + #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] + pub resource_group_name: Option, + #[doc = "Name of the partner destination associated with the channel."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Type of the endpoint for the partner destination"] + #[serde(rename = "endpointType")] + pub endpoint_type: partner_destination_info::EndpointType, + #[doc = "Additional context of the partner destination endpoint."] + #[serde(rename = "endpointServiceContext", default, skip_serializing_if = "Option::is_none")] + pub endpoint_service_context: Option, + #[doc = "Change history of the resource move."] + #[serde( + rename = "resourceMoveChangeHistory", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_move_change_history: Vec, +} +impl PartnerDestinationInfo { + pub fn new(endpoint_type: partner_destination_info::EndpointType) -> Self { + Self { + azure_subscription_id: None, + resource_group_name: None, + name: None, + endpoint_type, + endpoint_service_context: None, + resource_move_change_history: Vec::new(), + } + } +} +pub mod partner_destination_info { + use super::*; + #[doc = "Type of the endpoint for the partner destination"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndpointType")] + pub enum EndpointType { + WebHook, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndpointType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndpointType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndpointType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WebHook => serializer.serialize_unit_variant("EndpointType", 0u32, "WebHook"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for EndpointType { + fn default() -> Self { + Self::WebHook + } + } +} +#[doc = "Properties of the Partner Destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerDestinationProperties { + #[doc = "The immutable Id of the corresponding partner registration."] + #[serde(rename = "partnerRegistrationImmutableId", default, skip_serializing_if = "Option::is_none")] + pub partner_registration_immutable_id: Option, + #[doc = "Endpoint context associated with this partner destination."] + #[serde(rename = "endpointServiceContext", default, skip_serializing_if = "Option::is_none")] + pub endpoint_service_context: Option, + #[doc = "Expiration time of the partner destination. If this timer expires and the partner destination was never activated,\r\nthe partner destination and corresponding channel are deleted."] + #[serde(rename = "expirationTimeIfNotActivatedUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_time_if_not_activated_utc: Option, + #[doc = "Provisioning state of the partner destination."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Activation state of the partner destination."] + #[serde(rename = "activationState", default, skip_serializing_if = "Option::is_none")] + pub activation_state: Option, + #[doc = "Endpoint Base URL of the partner destination"] + #[serde(rename = "endpointBaseUrl", default, skip_serializing_if = "Option::is_none")] + pub endpoint_base_url: Option, + #[doc = "Context or helpful message that can be used during the approval process."] + #[serde(rename = "messageForActivation", default, skip_serializing_if = "Option::is_none")] + pub message_for_activation: Option, +} +impl PartnerDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod partner_destination_properties { + use super::*; + #[doc = "Provisioning state of the partner destination."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + IdleDueToMirroredChannelResourceDeletion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::IdleDueToMirroredChannelResourceDeletion => { + serializer.serialize_unit_variant("ProvisioningState", 6u32, "IdleDueToMirroredChannelResourceDeletion") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Activation state of the partner destination."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActivationState")] + pub enum ActivationState { + NeverActivated, + Activated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActivationState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActivationState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActivationState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NeverActivated => serializer.serialize_unit_variant("ActivationState", 0u32, "NeverActivated"), + Self::Activated => serializer.serialize_unit_variant("ActivationState", 1u32, "Activated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Partner Destination that can be updated."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerDestinationUpdateParameters { + #[doc = "Tags of the Partner Destination resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl PartnerDestinationUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Partner Destinations operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerDestinationsListResult { + #[doc = "A collection of partner destinations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of partner destinations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PartnerDestinationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PartnerDestinationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the partner."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerDetails { + #[doc = "This is short description about the partner. The length of this description should not exceed 256 characters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters."] + #[serde(rename = "longDescription", default, skip_serializing_if = "Option::is_none")] + pub long_description: Option, + #[doc = "URI of the partner website that can be used by Azure customers to setup Event Grid\r\nintegration on an event source."] + #[serde(rename = "setupUri", default, skip_serializing_if = "Option::is_none")] + pub setup_uri: Option, +} +impl PartnerDetails { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PartnerEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl PartnerEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "EventGrid Partner Namespace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerNamespace { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the partner namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PartnerNamespace { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + } + } +} +#[doc = "Properties of the partner namespace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerNamespaceProperties { + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "Provisioning state of the partner namespace."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The fully qualified ARM Id of the partner registration that should be associated with this partner namespace. This takes the following format:\r\n/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}."] + #[serde(rename = "partnerRegistrationFullyQualifiedId", default, skip_serializing_if = "Option::is_none")] + pub partner_registration_fully_qualified_id: Option, + #[doc = "Minimum TLS version of the publisher allowed to publish to this partner namespace"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, + #[doc = "Endpoint for the partner namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option, + #[doc = "This determines if traffic is allowed over public network. By default it is enabled.\r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, + #[doc = "This determines if events published to this partner namespace should use the source attribute in the event payload\r\nor use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will be used to match the partner topic."] + #[serde(rename = "partnerTopicRoutingMode", default, skip_serializing_if = "Option::is_none")] + pub partner_topic_routing_mode: Option, +} +impl PartnerNamespaceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod partner_namespace_properties { + use super::*; + #[doc = "Provisioning state of the partner namespace."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this partner namespace"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "This determines if traffic is allowed over public network. By default it is enabled.\r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PublicNetworkAccess { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "This determines if events published to this partner namespace should use the source attribute in the event payload\r\nor use the channel name in the header when matching to the partner topic. If none is specified, source attribute routing will be used to match the partner topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PartnerTopicRoutingMode")] + pub enum PartnerTopicRoutingMode { + SourceEventAttribute, + ChannelNameHeader, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PartnerTopicRoutingMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PartnerTopicRoutingMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PartnerTopicRoutingMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SourceEventAttribute => serializer.serialize_unit_variant("PartnerTopicRoutingMode", 0u32, "SourceEventAttribute"), + Self::ChannelNameHeader => serializer.serialize_unit_variant("PartnerTopicRoutingMode", 1u32, "ChannelNameHeader"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PartnerTopicRoutingMode { + fn default() -> Self { + Self::SourceEventAttribute + } + } +} +#[doc = "PartnerNamespace regenerate shared access key request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerNamespaceRegenerateKeyRequest { + #[doc = "Key name to regenerate (key1 or key2)."] + #[serde(rename = "keyName")] + pub key_name: String, +} +impl PartnerNamespaceRegenerateKeyRequest { + pub fn new(key_name: String) -> Self { + Self { key_name } + } +} +#[doc = "Shared access keys of the partner namespace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerNamespaceSharedAccessKeys { + #[doc = "Shared access key1 for the partner namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key1: Option, + #[doc = "Shared access key2 for the partner namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key2: Option, +} +impl PartnerNamespaceSharedAccessKeys { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information of Partner Namespace update parameter properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerNamespaceUpdateParameterProperties { + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, + #[doc = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the partner namespace."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, +} +impl PartnerNamespaceUpdateParameterProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod partner_namespace_update_parameter_properties { + use super::*; + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PublicNetworkAccess { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Partner Namespace update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerNamespaceUpdateParameters { + #[doc = "Tags of the Partner Namespace."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Information of Partner Namespace update parameter properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PartnerNamespaceUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Partner Namespaces operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerNamespacesListResult { + #[doc = "A collection of partner namespaces."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of partner namespaces."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PartnerNamespacesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PartnerNamespacesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about a partner registration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerRegistration { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the partner registration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PartnerRegistration { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + } + } +} +#[doc = "Properties of the partner registration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerRegistrationProperties { + #[doc = "Provisioning state of the partner registration."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The immutableId of the corresponding partner registration.\r\nNote: This property is marked for deprecation and is not supported in any future GA API version"] + #[serde(rename = "partnerRegistrationImmutableId", default, skip_serializing_if = "Option::is_none")] + pub partner_registration_immutable_id: Option, +} +impl PartnerRegistrationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod partner_registration_properties { + use super::*; + #[doc = "Provisioning state of the partner registration."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Partner Registration update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerRegistrationUpdateParameters { + #[doc = "Tags of the partner registration resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl PartnerRegistrationUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Partner Registrations operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerRegistrationsListResult { + #[doc = "A collection of partner registrations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of partner registrations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PartnerRegistrationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PartnerRegistrationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Event Grid Partner Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerTopic { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the Partner Topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl PartnerTopic { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + identity: None, + } + } +} +#[doc = "Properties of the corresponding partner topic of a Channel."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerTopicInfo { + #[doc = "Azure subscription ID of the subscriber. The partner topic associated with the channel will be\r\ncreated under this Azure subscription."] + #[serde(rename = "azureSubscriptionId", default, skip_serializing_if = "Option::is_none")] + pub azure_subscription_id: Option, + #[doc = "Azure Resource Group of the subscriber. The partner topic associated with the channel will be\r\ncreated under this resource group."] + #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] + pub resource_group_name: Option, + #[doc = "Name of the partner topic associated with the channel."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, + #[doc = "The source information is provided by the publisher to determine the scope or context from which the events\r\nare originating. This information can be used by the subscriber during the approval process of the\r\ncreated partner topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, +} +impl PartnerTopicInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Partner Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerTopicProperties { + #[doc = "The immutableId of the corresponding partner registration."] + #[serde(rename = "partnerRegistrationImmutableId", default, skip_serializing_if = "Option::is_none")] + pub partner_registration_immutable_id: Option, + #[doc = "Source associated with this partner topic. This represents a unique partner resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, + #[doc = "Expiration time of the partner topic. If this timer expires while the partner topic is still never activated,\r\nthe partner topic and corresponding event channel are deleted."] + #[serde(rename = "expirationTimeIfNotActivatedUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_time_if_not_activated_utc: Option, + #[doc = "Provisioning state of the partner topic."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Activation state of the partner topic."] + #[serde(rename = "activationState", default, skip_serializing_if = "Option::is_none")] + pub activation_state: Option, + #[doc = "Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer partner topic.\r\nThis will be helpful to remove any ambiguity of the origin of creation of the partner topic for the customer."] + #[serde(rename = "partnerTopicFriendlyDescription", default, skip_serializing_if = "Option::is_none")] + pub partner_topic_friendly_description: Option, + #[doc = "Context or helpful message that can be used during the approval process by the subscriber."] + #[serde(rename = "messageForActivation", default, skip_serializing_if = "Option::is_none")] + pub message_for_activation: Option, +} +impl PartnerTopicProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod partner_topic_properties { + use super::*; + #[doc = "Provisioning state of the partner topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + IdleDueToMirroredChannelResourceDeletion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::IdleDueToMirroredChannelResourceDeletion => { + serializer.serialize_unit_variant("ProvisioningState", 6u32, "IdleDueToMirroredChannelResourceDeletion") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Activation state of the partner topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActivationState")] + pub enum ActivationState { + NeverActivated, + Activated, + Deactivated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActivationState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActivationState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActivationState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NeverActivated => serializer.serialize_unit_variant("ActivationState", 0u32, "NeverActivated"), + Self::Activated => serializer.serialize_unit_variant("ActivationState", 1u32, "Activated"), + Self::Deactivated => serializer.serialize_unit_variant("ActivationState", 2u32, "Deactivated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Partner Topic update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerTopicUpdateParameters { + #[doc = "Tags of the Partner Topic resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl PartnerTopicUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Partner Topics operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerTopicsListResult { + #[doc = "A collection of partner topics."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of partner topics."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PartnerTopicsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PartnerTopicsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the corresponding partner destination of a Channel."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartnerUpdateDestinationInfo { + #[doc = "Type of the endpoint for the partner destination"] + #[serde(rename = "endpointType")] + pub endpoint_type: partner_update_destination_info::EndpointType, +} +impl PartnerUpdateDestinationInfo { + pub fn new(endpoint_type: partner_update_destination_info::EndpointType) -> Self { + Self { endpoint_type } + } +} +pub mod partner_update_destination_info { + use super::*; + #[doc = "Type of the endpoint for the partner destination"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndpointType")] + pub enum EndpointType { + WebHook, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndpointType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndpointType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndpointType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WebHook => serializer.serialize_unit_variant("EndpointType", 0u32, "WebHook"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for EndpointType { + fn default() -> Self { + Self::WebHook + } + } +} +#[doc = "Update properties for the corresponding partner topic of a channel."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PartnerUpdateTopicInfo { + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, +} +impl PartnerUpdateTopicInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Permission binding resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PermissionBinding { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of permission binding."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PermissionBinding { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of permission binding."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PermissionBindingProperties { + #[doc = "Description for the Permission Binding resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The name of the Topic Space resource that the permission is bound to.\r\nThe Topic space needs to be a resource under the same namespace the permission binding is a part of."] + #[serde(rename = "topicSpaceName", default, skip_serializing_if = "Option::is_none")] + pub topic_space_name: Option, + #[doc = "The allowed permission."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub permission: Option, + #[doc = "The name of the client group resource that the permission is bound to.\r\nThe client group needs to be a resource under the same namespace the permission binding is a part of."] + #[serde(rename = "clientGroupName", default, skip_serializing_if = "Option::is_none")] + pub client_group_name: Option, + #[doc = "Provisioning state of the PermissionBinding resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PermissionBindingProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod permission_binding_properties { + use super::*; + #[doc = "The allowed permission."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Permission")] + pub enum Permission { + Publisher, + Subscriber, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Permission { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Permission { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Permission { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Publisher => serializer.serialize_unit_variant("Permission", 0u32, "Publisher"), + Self::Subscriber => serializer.serialize_unit_variant("Permission", 1u32, "Subscriber"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Provisioning state of the PermissionBinding resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List Permission Binding operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PermissionBindingsListResult { + #[doc = "A collection of Permission Binding."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of Permission Binding."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PermissionBindingsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PermissionBindingsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "PrivateEndpoint information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpoint { + #[doc = "The ARM identifier for Private Endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl PrivateEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnection { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the private endpoint connection resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl PrivateEndpointConnection { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the list of all private endpoint connections operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionListResult { + #[doc = "A collection of private endpoint connection resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of private endpoint connection resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PrivateEndpointConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PrivateEndpointConnectionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the private endpoint connection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionProperties { + #[doc = "PrivateEndpoint information."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "GroupIds from the private link service resource."] + #[serde( + rename = "groupIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub group_ids: Vec, + #[doc = "ConnectionState information."] + #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] + pub private_link_service_connection_state: Option, + #[doc = "Provisioning state of the Private Endpoint Connection."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PrivateEndpointConnectionProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod private_endpoint_connection_properties { + use super::*; + #[doc = "Provisioning state of the Private Endpoint Connection."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information of the private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResource { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Fully qualified identifier of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Type of the resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl PrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceProperties { + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[serde( + rename = "requiredMembers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_members: Vec, + #[serde( + rename = "requiredZoneNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_zone_names: Vec, +} +impl PrivateLinkResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List private link resources operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourcesListResult { + #[doc = "A collection of private link resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of private link resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PrivateLinkResourcesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PrivateLinkResourcesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Queue info for event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueueInfo { + #[doc = "Maximum period in seconds in which once the message is in received (by the client) state and waiting to be accepted, released or rejected.\r\nIf this time elapsed after a message has been received by the client and not transitioned into accepted (not processed), released or rejected,\r\nthe message is available for redelivery. This is an optional field, where default is 60 seconds, minimum is 60 seconds and maximum is 300 seconds."] + #[serde(rename = "receiveLockDurationInSeconds", default, skip_serializing_if = "Option::is_none")] + pub receive_lock_duration_in_seconds: Option, + #[doc = "The maximum delivery count of the events."] + #[serde(rename = "maxDeliveryCount", default, skip_serializing_if = "Option::is_none")] + pub max_delivery_count: Option, + #[doc = "Information about the deadletter destination with resource identity."] + #[serde( + rename = "deadLetterDestinationWithResourceIdentity", + default, + skip_serializing_if = "Option::is_none" + )] + pub dead_letter_destination_with_resource_identity: Option, + #[doc = "Time span duration in ISO 8601 format that determines how long messages are available to the subscription from the time the message was published.\r\nThis duration value is expressed using the following format: \\'P(n)Y(n)M(n)DT(n)H(n)M(n)S\\', where:\r\n - (n) is replaced by the value of each time element that follows the (n).\r\n - P is the duration (or Period) designator and is always placed at the beginning of the duration.\r\n - Y is the year designator, and it follows the value for the number of years.\r\n - M is the month designator, and it follows the value for the number of months.\r\n - W is the week designator, and it follows the value for the number of weeks.\r\n - D is the day designator, and it follows the value for the number of days.\r\n - T is the time designator, and it precedes the time components.\r\n - H is the hour designator, and it follows the value for the number of hours.\r\n - M is the minute designator, and it follows the value for the number of minutes.\r\n - S is the second designator, and it follows the value for the number of seconds.\r\nThis duration value cannot be set greater than the topic’s EventRetentionInDays. It is is an optional field where its minimum value is 1 minute, and its maximum is determined\r\nby topic’s EventRetentionInDays value. The followings are examples of valid values:\r\n - \\'P0DT23H12M\\' or \\'PT23H12M\\': for duration of 23 hours and 12 minutes.\r\n - \\'P1D\\' or \\'P1DT0H0M0S\\': for duration of 1 day."] + #[serde(rename = "eventTimeToLive", default, skip_serializing_if = "Option::is_none")] + pub event_time_to_live: Option, +} +impl QueueInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Definition of a Resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified identifier of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Type of the resource."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The change history of the resource move."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceMoveChangeHistory { + #[doc = "Azure subscription ID of the resource."] + #[serde(rename = "azureSubscriptionId", default, skip_serializing_if = "Option::is_none")] + pub azure_subscription_id: Option, + #[doc = "Azure Resource Group of the resource."] + #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] + pub resource_group_name: Option, + #[doc = "UTC timestamp of when the resource was changed."] + #[serde(rename = "changedTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub changed_time_utc: Option, +} +impl ResourceMoveChangeHistory { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an EventGrid Resource Sku."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceSku { + #[doc = "The Sku name of the resource. The possible values are: Basic or Premium."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl ResourceSku { + pub fn new() -> Self { + Self::default() + } +} +pub mod resource_sku { + use super::*; + #[doc = "The Sku name of the resource. The possible values are: Basic or Premium."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Name")] + pub enum Name { + Basic, + Premium, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Name { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Name { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Name { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Basic => serializer.serialize_unit_variant("Name", 0u32, "Basic"), + Self::Premium => serializer.serialize_unit_variant("Name", 1u32, "Premium"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Name { + fn default() -> Self { + Self::Basic + } + } +} +#[doc = "Information about the retry policy for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RetryPolicy { + #[doc = "Maximum number of delivery retry attempts for events."] + #[serde(rename = "maxDeliveryAttempts", default, skip_serializing_if = "Option::is_none")] + pub max_delivery_attempts: Option, + #[doc = "Time To Live (in minutes) for events."] + #[serde(rename = "eventTimeToLiveInMinutes", default, skip_serializing_if = "Option::is_none")] + pub event_time_to_live_in_minutes: Option, +} +impl RetryPolicy { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RoutingEnrichments { + #[serde( + rename = "static", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub static_: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dynamic: Vec, +} +impl RoutingEnrichments { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Routing identity info for topic spaces configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RoutingIdentityInfo { + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[serde(rename = "userAssignedIdentity", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identity: Option, +} +impl RoutingIdentityInfo { + pub fn new() -> Self { + Self::default() + } +} +pub mod routing_identity_info { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + None, + SystemAssigned, + UserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("Type", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("Type", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("Type", 2u32, "UserAssigned"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about the service bus destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusQueueEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "The properties that represent the Service Bus destination of an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ServiceBusQueueEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "The properties that represent the Service Bus destination of an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceBusQueueEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Delivery attribute details."] + #[serde( + rename = "deliveryAttributeMappings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delivery_attribute_mappings: Vec, +} +impl ServiceBusQueueEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the service bus topic destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceBusTopicEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "The properties that represent the Service Bus Topic destination of an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ServiceBusTopicEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "The properties that represent the Service Bus Topic destination of an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceBusTopicEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "Delivery attribute details."] + #[serde( + rename = "deliveryAttributeMappings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delivery_attribute_mappings: Vec, +} +impl ServiceBusTopicEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Static delivery attribute mapping details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StaticDeliveryAttributeMapping { + #[serde(flatten)] + pub delivery_attribute_mapping: DeliveryAttributeMapping, + #[doc = "Properties of static delivery attribute mapping."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl StaticDeliveryAttributeMapping { + pub fn new(delivery_attribute_mapping: DeliveryAttributeMapping) -> Self { + Self { + delivery_attribute_mapping, + properties: None, + } + } +} +#[doc = "Properties of static delivery attribute mapping."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StaticDeliveryAttributeMappingProperties { + #[doc = "Value of the delivery attribute."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "Boolean flag to tell if the attribute contains sensitive information ."] + #[serde(rename = "isSecret", default, skip_serializing_if = "Option::is_none")] + pub is_secret: Option, +} +impl StaticDeliveryAttributeMappingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StaticRoutingEnrichment { + #[doc = "Static routing enrichment key."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + #[doc = "Static routing enrichment value type. For e.g. this property value can be 'String'."] + #[serde(rename = "valueType", default, skip_serializing_if = "Option::is_none")] + pub value_type: Option, +} +impl StaticRoutingEnrichment { + pub fn new() -> Self { + Self::default() + } +} +pub mod static_routing_enrichment { + use super::*; + #[doc = "Static routing enrichment value type. For e.g. this property value can be 'String'."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValueType")] + pub enum ValueType { + String, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValueType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValueType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValueType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::String => serializer.serialize_unit_variant("ValueType", 0u32, "String"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about the storage blob based dead letter destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StorageBlobDeadLetterDestination { + #[serde(flatten)] + pub dead_letter_destination: DeadLetterDestination, + #[doc = "Properties of the storage blob based dead letter destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl StorageBlobDeadLetterDestination { + pub fn new(dead_letter_destination: DeadLetterDestination) -> Self { + Self { + dead_letter_destination, + properties: None, + } + } +} +#[doc = "Properties of the storage blob based dead letter destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageBlobDeadLetterDestinationProperties { + #[doc = "The Azure Resource ID of the storage account that is the destination of the deadletter events"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The name of the Storage blob container that is the destination of the deadletter events"] + #[serde(rename = "blobContainerName", default, skip_serializing_if = "Option::is_none")] + pub blob_container_name: Option, +} +impl StorageBlobDeadLetterDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the storage queue destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StorageQueueEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "The properties for a storage queue destination."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl StorageQueueEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "The properties for a storage queue destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageQueueEventSubscriptionDestinationProperties { + #[doc = "The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The name of the Storage queue under a storage account that is the destination of an event subscription."] + #[serde(rename = "queueName", default, skip_serializing_if = "Option::is_none")] + pub queue_name: Option, + #[doc = "Storage queue message time to live in seconds. This value cannot be zero or negative with the exception of using -1 to indicate that the Time To Live of the message is Infinite."] + #[serde(rename = "queueMessageTimeToLiveInSeconds", default, skip_serializing_if = "Option::is_none")] + pub queue_message_time_to_live_in_seconds: Option, +} +impl StorageQueueEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "StringBeginsWith Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringBeginsWithAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringBeginsWithAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringBeginsWith Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringBeginsWithFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringBeginsWithFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringContains Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringContainsAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringContainsAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringContains Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringContainsFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringContainsFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringEndsWith Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringEndsWithAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringEndsWithAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringEndsWith Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringEndsWithFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringEndsWithFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringIn Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringInAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringInAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringIn Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringInFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringInFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotBeginsWith Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotBeginsWithAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotBeginsWithAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotBeginsWith Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotBeginsWithFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotBeginsWithFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotContains Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotContainsAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotContainsAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotContains Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotContainsFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotContainsFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotEndsWith Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotEndsWithAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotEndsWithAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotEndsWith Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotEndsWithFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotEndsWithFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotIn Advanced Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotInAdvancedFilter { + #[serde(flatten)] + pub advanced_filter: AdvancedFilter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotInAdvancedFilter { + pub fn new(advanced_filter: AdvancedFilter) -> Self { + Self { + advanced_filter, + values: Vec::new(), + } + } +} +#[doc = "StringNotIn Filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StringNotInFilter { + #[serde(flatten)] + pub filter: Filter, + #[doc = "The set of filter values."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub values: Vec, +} +impl StringNotInFilter { + pub fn new(filter: Filter) -> Self { + Self { + filter, + values: Vec::new(), + } + } +} +#[doc = "Event Subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Subscription { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Subscription { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubscriptionProperties { + #[doc = "Provisioning state of the event subscription."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Properties of the delivery configuration information of the event subscription."] + #[serde(rename = "deliveryConfiguration", default, skip_serializing_if = "Option::is_none")] + pub delivery_configuration: Option, + #[doc = "The event delivery schema for the event subscription."] + #[serde(rename = "eventDeliverySchema", default, skip_serializing_if = "Option::is_none")] + pub event_delivery_schema: Option, + #[doc = "Filters configuration for the Event Subscription."] + #[serde(rename = "filtersConfiguration", default, skip_serializing_if = "Option::is_none")] + pub filters_configuration: Option, +} +impl SubscriptionProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod subscription_properties { + use super::*; + #[doc = "Provisioning state of the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + AwaitingManualAction, + Deleted, + DeleteFailed, + CreateFailed, + UpdatedFailed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::AwaitingManualAction => serializer.serialize_unit_variant("ProvisioningState", 6u32, "AwaitingManualAction"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 7u32, "Deleted"), + Self::DeleteFailed => serializer.serialize_unit_variant("ProvisioningState", 8u32, "DeleteFailed"), + Self::CreateFailed => serializer.serialize_unit_variant("ProvisioningState", 9u32, "CreateFailed"), + Self::UpdatedFailed => serializer.serialize_unit_variant("ProvisioningState", 10u32, "UpdatedFailed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The event delivery schema for the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventDeliverySchema")] + pub enum EventDeliverySchema { + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventDeliverySchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventDeliverySchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventDeliverySchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("EventDeliverySchema", 0u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Event Subscription update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubscriptionUpdateParameters { + #[doc = "Properties of the Event Subscription update parameters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SubscriptionUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Event Subscription update parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubscriptionUpdateParametersProperties { + #[doc = "Properties of the delivery configuration information of the event subscription."] + #[serde(rename = "deliveryConfiguration", default, skip_serializing_if = "Option::is_none")] + pub delivery_configuration: Option, + #[doc = "The event delivery schema for the event subscription."] + #[serde(rename = "eventDeliverySchema", default, skip_serializing_if = "Option::is_none")] + pub event_delivery_schema: Option, + #[doc = "Filters configuration for the Event Subscription."] + #[serde(rename = "filtersConfiguration", default, skip_serializing_if = "Option::is_none")] + pub filters_configuration: Option, +} +impl SubscriptionUpdateParametersProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod subscription_update_parameters_properties { + use super::*; + #[doc = "The event delivery schema for the event subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventDeliverySchema")] + pub enum EventDeliverySchema { + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventDeliverySchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventDeliverySchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventDeliverySchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("EventDeliverySchema", 0u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List event subscriptions operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubscriptionsListResult { + #[doc = "A collection of Subscriptions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of event subscriptions"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SubscriptionsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SubscriptionsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "EventGrid System Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SystemTopic { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the System Topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl SystemTopic { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + system_data: None, + identity: None, + } + } +} +#[doc = "Properties of the System Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemTopicProperties { + #[doc = "Provisioning state of the system topic."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Source for the system topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "TopicType for the system topic."] + #[serde(rename = "topicType", default, skip_serializing_if = "Option::is_none")] + pub topic_type: Option, + #[doc = "Metric resource id for the system topic."] + #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] + pub metric_resource_id: Option, +} +impl SystemTopicProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_topic_properties { + use super::*; + #[doc = "Provisioning state of the system topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the System Topic update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemTopicUpdateParameters { + #[doc = "Tags of the system topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl SystemTopicUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List System topics operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemTopicsListResult { + #[doc = "A collection of system Topics."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of topics."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SystemTopicsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SystemTopicsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "EventGrid Topic"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Topic { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties of the Topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Describes an EventGrid Resource Sku."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Kind of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[doc = "Definition of an Extended Location"] + #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] + pub extended_location: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Topic { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + sku: None, + identity: None, + kind: None, + extended_location: None, + system_data: None, + } + } +} +pub mod topic { + use super::*; + #[doc = "Kind of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + Azure, + AzureArc, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("Kind", 0u32, "Azure"), + Self::AzureArc => serializer.serialize_unit_variant("Kind", 1u32, "AzureArc"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Kind { + fn default() -> Self { + Self::Azure + } + } +} +#[doc = "Properties of the Topic."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicProperties { + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, + #[doc = "Provisioning state of the topic."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Endpoint for the topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub endpoint: Option, + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, + #[doc = "Minimum TLS version of the publisher allowed to publish to this topic"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, + #[doc = "This determines the format that Event Grid should expect for incoming events published to the topic."] + #[serde(rename = "inputSchema", default, skip_serializing_if = "Option::is_none")] + pub input_schema: Option, + #[doc = "By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'."] + #[serde(rename = "inputSchemaMapping", default, skip_serializing_if = "Option::is_none")] + pub input_schema_mapping: Option, + #[doc = "Metric resource id for the topic."] + #[serde(rename = "metricResourceId", default, skip_serializing_if = "Option::is_none")] + pub metric_resource_id: Option, + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, + #[doc = "Data Residency Boundary of the resource."] + #[serde(rename = "dataResidencyBoundary", default, skip_serializing_if = "Option::is_none")] + pub data_residency_boundary: Option, +} +impl TopicProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod topic_properties { + use super::*; + #[doc = "Provisioning state of the topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this topic"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "This determines the format that Event Grid should expect for incoming events published to the topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "InputSchema")] + pub enum InputSchema { + EventGridSchema, + CustomEventSchema, + #[serde(rename = "CloudEventSchemaV1_0")] + CloudEventSchemaV10, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for InputSchema { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for InputSchema { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for InputSchema { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::EventGridSchema => serializer.serialize_unit_variant("InputSchema", 0u32, "EventGridSchema"), + Self::CustomEventSchema => serializer.serialize_unit_variant("InputSchema", 1u32, "CustomEventSchema"), + Self::CloudEventSchemaV10 => serializer.serialize_unit_variant("InputSchema", 2u32, "CloudEventSchemaV1_0"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for InputSchema { + fn default() -> Self { + Self::EventGridSchema + } + } + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PublicNetworkAccess { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Data Residency Boundary of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DataResidencyBoundary")] + pub enum DataResidencyBoundary { + WithinGeopair, + WithinRegion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DataResidencyBoundary { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DataResidencyBoundary { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DataResidencyBoundary { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WithinGeopair => serializer.serialize_unit_variant("DataResidencyBoundary", 0u32, "WithinGeopair"), + Self::WithinRegion => serializer.serialize_unit_variant("DataResidencyBoundary", 1u32, "WithinRegion"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Topic regenerate share access key request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TopicRegenerateKeyRequest { + #[doc = "Key name to regenerate key1 or key2"] + #[serde(rename = "keyName")] + pub key_name: String, +} +impl TopicRegenerateKeyRequest { + pub fn new(key_name: String) -> Self { + Self { key_name } + } +} +#[doc = "Shared access keys of the Topic"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicSharedAccessKeys { + #[doc = "Shared access key1 for the topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key1: Option, + #[doc = "Shared access key2 for the topic."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key2: Option, +} +impl TopicSharedAccessKeys { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Topic space resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicSpace { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The properties of topic space."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl TopicSpace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of topic space."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicSpaceProperties { + #[doc = "Description for the Topic Space resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The topic filters in the topic space.\r\nExample: \"topicTemplates\": [ \r\n \"devices/foo/bar\",\r\n \"devices/topic1/+\",\r\n \"devices/${principal.name}/${principal.attributes.keyName}\" ]."] + #[serde( + rename = "topicTemplates", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub topic_templates: Vec, + #[doc = "Provisioning state of the TopicSpace resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl TopicSpaceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod topic_space_properties { + use super::*; + #[doc = "Provisioning state of the TopicSpace resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + Deleted, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleted"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Topic Spaces Configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicSpacesConfiguration { + #[doc = "Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Fully qualified Azure Resource Id for the Event Grid Topic to which events will be routed to from TopicSpaces under a namespace.\r\nThis property should be in the following format '/subscriptions/{subId}/resourcegroups/{resourceGroupName}/providers/microsoft.EventGrid/topics/{topicName}'.\r\nThis topic should reside in the same region where namespace is located."] + #[serde(rename = "routeTopicResourceId", default, skip_serializing_if = "Option::is_none")] + pub route_topic_resource_id: Option, + #[doc = "The endpoint for the topic spaces configuration. This is a read-only property."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + #[serde(rename = "routingEnrichments", default, skip_serializing_if = "Option::is_none")] + pub routing_enrichments: Option, + #[doc = "Client authentication settings for namespace resource."] + #[serde(rename = "clientAuthentication", default, skip_serializing_if = "Option::is_none")] + pub client_authentication: Option, + #[doc = "The maximum session expiry in hours. The property default value is 1 hour.\r\nMin allowed value is 1 hour and max allowed value is 8 hours."] + #[serde(rename = "maximumSessionExpiryInHours", default, skip_serializing_if = "Option::is_none")] + pub maximum_session_expiry_in_hours: Option, + #[doc = "The maximum number of sessions per authentication name. The property default value is 1.\r\nMin allowed value is 1 and max allowed value is 100."] + #[serde( + rename = "maximumClientSessionsPerAuthenticationName", + default, + skip_serializing_if = "Option::is_none" + )] + pub maximum_client_sessions_per_authentication_name: Option, + #[doc = "Routing identity info for topic spaces configuration."] + #[serde(rename = "routingIdentityInfo", default, skip_serializing_if = "Option::is_none")] + pub routing_identity_info: Option, +} +impl TopicSpacesConfiguration { + pub fn new() -> Self { + Self::default() + } +} +pub mod topic_spaces_configuration { + use super::*; + #[doc = "Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("State", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("State", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for State { + fn default() -> Self { + Self::Disabled + } + } +} +#[doc = "Result of the List Topic Space operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicSpacesListResult { + #[doc = "A collection of Topic Space."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of Topic Space."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TopicSpacesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TopicSpacesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a topic type info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicTypeInfo { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of a topic type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TopicTypeInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a topic type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicTypeProperties { + #[doc = "Namespace of the provider of the topic type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "Display Name for the topic type."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Description of the topic type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Region type of the resource."] + #[serde(rename = "resourceRegionType", default, skip_serializing_if = "Option::is_none")] + pub resource_region_type: Option, + #[doc = "Provisioning state of the topic type"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "List of locations supported by this topic type."] + #[serde( + rename = "supportedLocations", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_locations: Vec, + #[doc = "Source resource format."] + #[serde(rename = "sourceResourceFormat", default, skip_serializing_if = "Option::is_none")] + pub source_resource_format: Option, + #[doc = "Supported source scopes."] + #[serde( + rename = "supportedScopesForSource", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_scopes_for_source: Vec, + #[doc = "Flag to indicate that a topic type can support both regional or global system topics"] + #[serde(rename = "areRegionalAndGlobalSourcesSupported", default, skip_serializing_if = "Option::is_none")] + pub are_regional_and_global_sources_supported: Option, +} +impl TopicTypeProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod topic_type_properties { + use super::*; + #[doc = "Region type of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ResourceRegionType")] + pub enum ResourceRegionType { + RegionalResource, + GlobalResource, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ResourceRegionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ResourceRegionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ResourceRegionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::RegionalResource => serializer.serialize_unit_variant("ResourceRegionType", 0u32, "RegionalResource"), + Self::GlobalResource => serializer.serialize_unit_variant("ResourceRegionType", 1u32, "GlobalResource"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Provisioning state of the topic type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List Topic Types operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicTypesListResult { + #[doc = "A collection of topic types"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for TopicTypesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl TopicTypesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information of topic update parameter properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicUpdateParameterProperties { + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled."] + #[serde( + rename = "inboundIpRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_ip_rules: Vec, + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, + #[doc = "This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the topic."] + #[serde(rename = "disableLocalAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_local_auth: Option, + #[doc = "The data residency boundary for the topic."] + #[serde(rename = "dataResidencyBoundary", default, skip_serializing_if = "Option::is_none")] + pub data_residency_boundary: Option, + #[doc = "The event type information for Channels."] + #[serde(rename = "eventTypeInfo", default, skip_serializing_if = "Option::is_none")] + pub event_type_info: Option, +} +impl TopicUpdateParameterProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod topic_update_parameter_properties { + use super::*; + #[doc = "This determines if traffic is allowed over public network. By default it is enabled. \r\nYou can further restrict to specific IPs by configuring "] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PublicNetworkAccess { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Minimum TLS version of the publisher allowed to publish to this domain"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The data residency boundary for the topic."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DataResidencyBoundary")] + pub enum DataResidencyBoundary { + WithinGeopair, + WithinRegion, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DataResidencyBoundary { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DataResidencyBoundary { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DataResidencyBoundary { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::WithinGeopair => serializer.serialize_unit_variant("DataResidencyBoundary", 0u32, "WithinGeopair"), + Self::WithinRegion => serializer.serialize_unit_variant("DataResidencyBoundary", 1u32, "WithinRegion"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the Topic update"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicUpdateParameters { + #[doc = "Tags of the Topic resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The identity information for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Information of topic update parameter properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Describes an EventGrid Resource Sku."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl TopicUpdateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the Topics Configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicsConfiguration { + #[doc = "The hostname for the topics configuration. This is a read-only property."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, +} +impl TopicsConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the List Topics operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopicsListResult { + #[doc = "A collection of Topics"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of topics"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TopicsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TopicsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Definition of a Tracked Resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Location of the resource."] + pub location: String, + #[doc = "Tags of the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + location, + tags: None, + } + } +} +#[doc = "Properties of the topic spaces configuration info of a namespace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateTopicSpacesConfigurationInfo { + #[doc = "Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "This property is used to specify custom topic to which events will be routed to from topic spaces configuration under namespace."] + #[serde(rename = "routeTopicResourceId", default, skip_serializing_if = "Option::is_none")] + pub route_topic_resource_id: Option, + #[serde(rename = "routingEnrichments", default, skip_serializing_if = "Option::is_none")] + pub routing_enrichments: Option, + #[doc = "Client authentication settings for namespace resource."] + #[serde(rename = "clientAuthentication", default, skip_serializing_if = "Option::is_none")] + pub client_authentication: Option, + #[doc = "The maximum session expiry in hours. The property default value is 1 hour.\r\nMin allowed value is 1 hour and max allowed value is 8 hours."] + #[serde(rename = "maximumSessionExpiryInHours", default, skip_serializing_if = "Option::is_none")] + pub maximum_session_expiry_in_hours: Option, + #[doc = "The maximum number of sessions per authentication name. The property default value is 1.\r\nMin allowed value is 1 and max allowed value is 100."] + #[serde( + rename = "maximumClientSessionsPerAuthenticationName", + default, + skip_serializing_if = "Option::is_none" + )] + pub maximum_client_sessions_per_authentication_name: Option, + #[doc = "Routing identity info for topic spaces configuration."] + #[serde(rename = "routingIdentityInfo", default, skip_serializing_if = "Option::is_none")] + pub routing_identity_info: Option, +} +impl UpdateTopicSpacesConfigurationInfo { + pub fn new() -> Self { + Self::default() + } +} +pub mod update_topic_spaces_configuration_info { + use super::*; + #[doc = "Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("State", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("State", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The information about the user identity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserIdentityProperties { + #[doc = "The principal id of user assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client id of user assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserIdentityProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Verified partner information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VerifiedPartner { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the verified partner."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl VerifiedPartner { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the verified partner."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VerifiedPartnerProperties { + #[doc = "ImmutableId of the corresponding partner registration."] + #[serde(rename = "partnerRegistrationImmutableId", default, skip_serializing_if = "Option::is_none")] + pub partner_registration_immutable_id: Option, + #[doc = "Official name of the Partner."] + #[serde(rename = "organizationName", default, skip_serializing_if = "Option::is_none")] + pub organization_name: Option, + #[doc = "Display name of the verified partner."] + #[serde(rename = "partnerDisplayName", default, skip_serializing_if = "Option::is_none")] + pub partner_display_name: Option, + #[doc = "Information about the partner."] + #[serde(rename = "partnerTopicDetails", default, skip_serializing_if = "Option::is_none")] + pub partner_topic_details: Option, + #[doc = "Information about the partner."] + #[serde(rename = "partnerDestinationDetails", default, skip_serializing_if = "Option::is_none")] + pub partner_destination_details: Option, + #[doc = "Provisioning state of the verified partner."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl VerifiedPartnerProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod verified_partner_properties { + use super::*; + #[doc = "Provisioning state of the verified partner."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Creating, + Updating, + Deleting, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Result of the List verified partners operation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VerifiedPartnersListResult { + #[doc = "A collection of verified partners."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "A link for the next page of verified partners if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for VerifiedPartnersListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl VerifiedPartnersListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the webhook destination for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebHookEventSubscriptionDestination { + #[serde(flatten)] + pub event_subscription_destination: EventSubscriptionDestination, + #[doc = "Information about the webhook destination properties for an event subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WebHookEventSubscriptionDestination { + pub fn new(event_subscription_destination: EventSubscriptionDestination) -> Self { + Self { + event_subscription_destination, + properties: None, + } + } +} +#[doc = "Information about the webhook destination properties for an event subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WebHookEventSubscriptionDestinationProperties { + #[doc = "The URL that represents the endpoint of the destination of an event subscription."] + #[serde(rename = "endpointUrl", default, skip_serializing_if = "Option::is_none")] + pub endpoint_url: Option, + #[doc = "The base URL that represents the endpoint of the destination of an event subscription."] + #[serde(rename = "endpointBaseUrl", default, skip_serializing_if = "Option::is_none")] + pub endpoint_base_url: Option, + #[doc = "Maximum number of events per batch."] + #[serde(rename = "maxEventsPerBatch", default, skip_serializing_if = "Option::is_none")] + pub max_events_per_batch: Option, + #[doc = "Preferred batch size in Kilobytes."] + #[serde(rename = "preferredBatchSizeInKilobytes", default, skip_serializing_if = "Option::is_none")] + pub preferred_batch_size_in_kilobytes: Option, + #[doc = "The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests."] + #[serde(rename = "azureActiveDirectoryTenantId", default, skip_serializing_if = "Option::is_none")] + pub azure_active_directory_tenant_id: Option, + #[doc = "The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests."] + #[serde( + rename = "azureActiveDirectoryApplicationIdOrUri", + default, + skip_serializing_if = "Option::is_none" + )] + pub azure_active_directory_application_id_or_uri: Option, + #[doc = "Delivery attribute details."] + #[serde( + rename = "deliveryAttributeMappings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delivery_attribute_mappings: Vec, + #[doc = "Minimum TLS version that should be supported by webhook endpoint"] + #[serde(rename = "minimumTlsVersionAllowed", default, skip_serializing_if = "Option::is_none")] + pub minimum_tls_version_allowed: Option, +} +impl WebHookEventSubscriptionDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod web_hook_event_subscription_destination_properties { + use super::*; + #[doc = "Minimum TLS version that should be supported by webhook endpoint"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimumTlsVersionAllowed")] + pub enum MinimumTlsVersionAllowed { + #[serde(rename = "1.0")] + N1_0, + #[serde(rename = "1.1")] + N1_1, + #[serde(rename = "1.2")] + N1_2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimumTlsVersionAllowed { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimumTlsVersionAllowed { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimumTlsVersionAllowed { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N1_0 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 0u32, "1.0"), + Self::N1_1 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 1u32, "1.1"), + Self::N1_2 => serializer.serialize_unit_variant("MinimumTlsVersionAllowed", 2u32, "1.2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information about the WebHook of the partner destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookPartnerDestinationInfo { + #[serde(flatten)] + pub partner_destination_info: PartnerDestinationInfo, + #[doc = "Properties of a partner destination webhook."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Change history of the resource move."] + #[serde( + rename = "resourceMoveChangeHistory", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_move_change_history: Vec, +} +impl WebhookPartnerDestinationInfo { + pub fn new(partner_destination_info: PartnerDestinationInfo) -> Self { + Self { + partner_destination_info, + properties: None, + resource_move_change_history: Vec::new(), + } + } +} +#[doc = "Properties of a partner destination webhook."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WebhookPartnerDestinationProperties { + #[doc = "The URL that represents the endpoint of the partner destination."] + #[serde(rename = "endpointUrl", default, skip_serializing_if = "Option::is_none")] + pub endpoint_url: Option, + #[doc = "The base URL that represents the endpoint of the partner destination."] + #[serde(rename = "endpointBaseUrl", default, skip_serializing_if = "Option::is_none")] + pub endpoint_base_url: Option, + #[doc = "Partner client authentication"] + #[serde(rename = "clientAuthentication", default, skip_serializing_if = "Option::is_none")] + pub client_authentication: Option, +} +impl WebhookPartnerDestinationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the update of the WebHook of the partner destination."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookUpdatePartnerDestinationInfo { + #[serde(flatten)] + pub partner_update_destination_info: PartnerUpdateDestinationInfo, + #[doc = "Properties of a partner destination webhook."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WebhookUpdatePartnerDestinationInfo { + pub fn new(partner_update_destination_info: PartnerUpdateDestinationInfo) -> Self { + Self { + partner_update_destination_info, + properties: None, + } + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/eventhub/src/package_2022_10_preview/mod.rs b/services/mgmt/eventhub/src/package_2022_10_preview/mod.rs index 0bfb8cce4c..5b8ebd79f8 100644 --- a/services/mgmt/eventhub/src/package_2022_10_preview/mod.rs +++ b/services/mgmt/eventhub/src/package_2022_10_preview/mod.rs @@ -6650,6 +6650,7 @@ pub mod schema_registry { top: None, } } + #[doc = "Gets the details of an EventHub schema group."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `resource_group_name`: Name of the resource group within the azure subscription."] @@ -6671,6 +6672,7 @@ pub mod schema_registry { subscription_id: subscription_id.into(), } } + #[doc = "Creates or Updates an EventHub schema group."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `resource_group_name`: Name of the resource group within the azure subscription."] @@ -6695,6 +6697,7 @@ pub mod schema_registry { subscription_id: subscription_id.into(), } } + #[doc = "Deletes an EventHub schema group."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `resource_group_name`: Name of the resource group within the azure subscription."] diff --git a/services/mgmt/fist/Cargo.toml b/services/mgmt/fist/Cargo.toml new file mode 100644 index 0000000000..faef28d88d --- /dev/null +++ b/services/mgmt/fist/Cargo.toml @@ -0,0 +1,39 @@ +# generated by AutoRust +[package] +name = "azure_mgmt_fist" +version = "0.11.0" +edition = "2021" +license = "MIT" +description = "generated REST API bindings" +repository = "https://github.com/azure/azure-sdk-for-rust" +homepage = "https://github.com/azure/azure-sdk-for-rust" +documentation = "https://docs.rs/azure_mgmt_fist" +# Require 1.64.0 for IntoFuture support +# https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#enhancing-await-with-intofuture +rust-version = "1.64.0" + +[lib] +doctest = false + +[dependencies] +azure_core = { path = "../../../sdk/core", version = "0.11", features = [] } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +bytes = "1.3" +futures = "0.3" +time = "0.3" + +[dev-dependencies] +azure_identity = { path = "../../../sdk/identity" } +tokio = { version = "1.23", features = ["macros", "rt-multi-thread"] } +env_logger = "0.10" + +[package.metadata.docs.rs] +all-features = true + +[features] +default = ["package-2023-02-08-preview", "enable_reqwest"] +enable_reqwest = ["azure_core/enable_reqwest"] +enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] +no-default-tag = [] +"package-2023-02-08-preview" = [] \ No newline at end of file diff --git a/services/mgmt/fist/README.md b/services/mgmt/fist/README.md new file mode 100644 index 0000000000..4484991536 --- /dev/null +++ b/services/mgmt/fist/README.md @@ -0,0 +1,13 @@ +# azure_mgmt_fist crate + +This is a generated [Azure SDK for Rust](https://github.com/Azure/azure-sdk-for-rust) crate from the Azure REST API specifications listed in: + +https://github.com/Azure/azure-rest-api-specs/blob/main/specification/fist/resource-manager/readme.md + +To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). + +The default tag is `package-2023-02-08-preview`. + +The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: + +- `package-2023-02-08-preview` has 28 operations from 1 API versions: `2023-02-08-preview`. Use crate feature `package-2023-02-08-preview` to enable. The operations will be in the `package_2023_02_08_preview` module. \ No newline at end of file diff --git a/services/mgmt/fist/src/lib.rs b/services/mgmt/fist/src/lib.rs new file mode 100644 index 0000000000..6b088cacb2 --- /dev/null +++ b/services/mgmt/fist/src/lib.rs @@ -0,0 +1,9 @@ +#![allow(clippy::module_inception)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::ptr_arg)] +#![allow(clippy::large_enum_variant)] +#![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-02-08-preview")] +pub mod package_2023_02_08_preview; +#[cfg(all(feature = "package-2023-02-08-preview", not(feature = "no-default-tag")))] +pub use package_2023_02_08_preview::*; diff --git a/services/mgmt/fist/src/package_2023_02_08_preview/mod.rs b/services/mgmt/fist/src/package_2023_02_08_preview/mod.rs new file mode 100644 index 0000000000..5b1975d1a7 --- /dev/null +++ b/services/mgmt/fist/src/package_2023_02_08_preview/mod.rs @@ -0,0 +1,3370 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn firmware_client(&self) -> firmware::Client { + firmware::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn workspaces_client(&self) -> workspaces::Client { + workspaces::Client(self.clone()) + } +} +pub mod firmware { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of firmwares inside a workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + pub fn list_by_workspace( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list_by_workspace::RequestBuilder { + list_by_workspace::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Get firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to create a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + #[doc = "* `firmware`: Details of the firmware being created or updated."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + firmware: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + firmware: firmware.into(), + } + } + #[doc = "The operation to update firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + #[doc = "* `firmware`: Details of the firmware being created or updated."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + firmware: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + firmware: firmware.into(), + } + } + #[doc = "The operation to delete a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to a url for file download."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_download_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_download_url::RequestBuilder { + generate_download_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to a url for tar file download."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_filesystem_download_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_filesystem_download_url::RequestBuilder { + generate_filesystem_download_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to get a scan summary."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_summary( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_summary::RequestBuilder { + generate_summary::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list all components result for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn list_generate_component_list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> list_generate_component_list::RequestBuilder { + list_generate_component_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to get component details for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_component_details( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_component_details::RequestBuilder { + generate_component_details::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list all binary hardening result for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn list_generate_binary_hardening_list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> list_generate_binary_hardening_list::RequestBuilder { + list_generate_binary_hardening_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list the binary hardening summary percentages for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_binary_hardening_summary( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_binary_hardening_summary::RequestBuilder { + generate_binary_hardening_summary::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to get binary hardening details for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_binary_hardening_details( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_binary_hardening_details::RequestBuilder { + generate_binary_hardening_details::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list all password hashes for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn list_generate_password_hash_list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> list_generate_password_hash_list::RequestBuilder { + list_generate_password_hash_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list all cve results for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn list_generate_cve_list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> list_generate_cve_list::RequestBuilder { + list_generate_cve_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to provide a high level summary of the CVEs reported for the firmware image."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_cve_summary( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_cve_summary::RequestBuilder { + generate_cve_summary::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to provide a high level summary of the discovered cryptographic certificates reported for the firmware image."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_crypto_certificate_summary( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_crypto_certificate_summary::RequestBuilder { + generate_crypto_certificate_summary::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to provide a high level summary of the discovered cryptographic keys reported for the firmware image."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn generate_crypto_key_summary( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> generate_crypto_key_summary::RequestBuilder { + generate_crypto_key_summary::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list all crypto certificates for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn list_generate_crypto_certificate_list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> list_generate_crypto_certificate_list::RequestBuilder { + list_generate_crypto_certificate_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + #[doc = "The operation to list all crypto keys for a firmware."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `firmware_id`: The id of the firmware."] + pub fn list_generate_crypto_key_list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + firmware_id: impl Into, + ) -> list_generate_crypto_key_list::RequestBuilder { + list_generate_crypto_key_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + firmware_id: firmware_id.into(), + } + } + } + pub mod list_by_workspace { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirmwareList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Firmware = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name, + &this.firmware_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Firmware = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + pub(crate) firmware: models::Firmware, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name, + &this.firmware_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.firmware)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Firmware = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + pub(crate) firmware: models::FirmwareUpdateDefinition, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name, + &this.firmware_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.firmware)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name, + &this.firmware_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod generate_download_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UrlToken = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateDownloadUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod generate_filesystem_download_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UrlToken = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateFilesystemDownloadUrl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod generate_summary { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirmwareSummary = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateSummary" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_generate_component_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComponentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateComponentList" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod generate_component_details { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Component = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateComponentDetails" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_generate_binary_hardening_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BinaryHardeningList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateBinaryHardeningList" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod generate_binary_hardening_summary { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BinaryHardeningSummary = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateBinaryHardeningSummary" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod generate_binary_hardening_details { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BinaryHardening = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateBinaryHardeningDetails" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_generate_password_hash_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PasswordHashList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generatePasswordHashList" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_generate_cve_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CveList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateCveList" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod generate_cve_summary { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CveSummary = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateCveSummary" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod generate_crypto_certificate_summary { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CryptoCertificateSummary = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateCryptoCertificateSummary" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod generate_crypto_key_summary { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CryptoKeySummary = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateCryptoKeySummary" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_generate_crypto_certificate_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CryptoCertificateList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateCryptoCertificateList" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_generate_crypto_key_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CryptoKeyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) firmware_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/firmwares/{}/generateCryptoKeyList" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . firmware_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod workspaces { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the firmware analysis workspaces in the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all of the firmware analysis workspaces in the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Get firmware analysis workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "The operation to create or update a firmware analysis workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `workspace`: Parameters when creating a firmware analysis workspace."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace: workspace.into(), + } + } + #[doc = "The operation to update a firmware analysis workspaces."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `workspace`: Parameters when updating a firmware analysis workspace."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace: workspace.into(), + } + } + #[doc = "The operation to delete a firmware analysis workspace."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "The operation to get a url for file upload."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the firmware analysis workspace."] + #[doc = "* `generate_upload_url`: Parameters when requesting a URL to upload firmware."] + pub fn generate_upload_url( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + generate_upload_url: impl Into, + ) -> generate_upload_url::RequestBuilder { + generate_upload_url::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + generate_upload_url: generate_upload_url.into(), + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.IoTFirmwareDefense/workspaces", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) workspace: models::Workspace, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Workspace = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) workspace: models::WorkspaceUpdateDefinition, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod generate_upload_url { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UrlToken = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) generate_upload_url: models::GenerateUploadUrlRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.IoTFirmwareDefense/workspaces/{}/generateUploadUrl", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.workspace_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.generate_upload_url)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the operations for this resource provider"] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.IoTFirmwareDefense/operations", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-08-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} diff --git a/services/mgmt/fist/src/package_2023_02_08_preview/models.rs b/services/mgmt/fist/src/package_2023_02_08_preview/models.rs new file mode 100644 index 0000000000..e0f39bc635 --- /dev/null +++ b/services/mgmt/fist/src/package_2023_02_08_preview/models.rs @@ -0,0 +1,1783 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Binary hardening of a firmware."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BinaryHardening { + #[doc = "ID for the binary hardening result."] + #[serde(rename = "binaryHardeningId", default, skip_serializing_if = "Option::is_none")] + pub binary_hardening_id: Option, + #[doc = "Binary hardening features."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub features: Option, + #[doc = "The architecture of the uploaded firmware."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub architecture: Option, + #[doc = "path for binary hardening."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "class for binary hardening."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub class: Option, + #[doc = "The runpath of the uploaded firmware."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub runpath: Option, + #[doc = "The rpath of the uploaded firmware."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rpath: Option, +} +impl BinaryHardening { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Binary hardening features."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BinaryHardeningFeatures { + #[doc = "NX flag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nx: Option, + #[doc = "PIE flag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pie: Option, + #[doc = "RELRO flag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub relro: Option, + #[doc = "Canary flag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub canary: Option, + #[doc = "Stripped flag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stripped: Option, +} +impl BinaryHardeningFeatures { + pub fn new() -> Self { + Self::default() + } +} +pub mod binary_hardening_features { + use super::*; + #[doc = "NX flag."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Nx")] + pub enum Nx { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Nx { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Nx { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Nx { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("Nx", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("Nx", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "PIE flag."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Pie")] + pub enum Pie { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Pie { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Pie { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Pie { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("Pie", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("Pie", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "RELRO flag."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Relro")] + pub enum Relro { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Relro { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Relro { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Relro { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("Relro", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("Relro", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Canary flag."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Canary")] + pub enum Canary { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Canary { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Canary { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Canary { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("Canary", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("Canary", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Stripped flag."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Stripped")] + pub enum Stripped { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Stripped { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Stripped { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Stripped { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("Stripped", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("Stripped", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List result for binary hardening"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BinaryHardeningList { + #[doc = "The list of binary hardening results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for BinaryHardeningList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl BinaryHardeningList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Binary hardening summary percentages."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BinaryHardeningSummary { + #[doc = "Total number of binaries that were analyzed"] + #[serde(rename = "totalFiles", default, skip_serializing_if = "Option::is_none")] + pub total_files: Option, + #[doc = "NX summary percentage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nx: Option, + #[doc = "PIE summary percentage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pie: Option, + #[doc = "RELRO summary percentage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub relro: Option, + #[doc = "Canary summary percentage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub canary: Option, + #[doc = "Stripped summary percentage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stripped: Option, +} +impl BinaryHardeningSummary { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Component of a firmware."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Component { + #[doc = "ID for the component."] + #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] + pub component_id: Option, + #[doc = "Name for the component."] + #[serde(rename = "componentName", default, skip_serializing_if = "Option::is_none")] + pub component_name: Option, + #[doc = "Version for the component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "License for the component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub license: Option, + #[doc = "Release date for the component."] + #[serde(rename = "releaseDate", default, with = "azure_core::date::rfc3339::option")] + pub release_date: Option, + #[doc = "Paths of the component."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub paths: Vec, + #[doc = "Flag if new update is available for the component."] + #[serde(rename = "isUpdateAvailable", default, skip_serializing_if = "Option::is_none")] + pub is_update_available: Option, +} +impl Component { + pub fn new() -> Self { + Self::default() + } +} +pub mod component { + use super::*; + #[doc = "Flag if new update is available for the component."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsUpdateAvailable")] + pub enum IsUpdateAvailable { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsUpdateAvailable { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsUpdateAvailable { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsUpdateAvailable { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsUpdateAvailable", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsUpdateAvailable", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List result for components"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComponentList { + #[doc = "The list of components."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ComponentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ComponentList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Crypto certificate properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoCertificate { + #[doc = "ID for the certificate."] + #[serde(rename = "cryptoCertId", default, skip_serializing_if = "Option::is_none")] + pub crypto_cert_id: Option, + #[doc = "Name of the certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Information on an entity (distinguished name) in a cryptographic certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subject: Option, + #[doc = "Information on an entity (distinguished name) in a cryptographic certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[doc = "Issue date for the certificate."] + #[serde(rename = "issuedDate", default, with = "azure_core::date::rfc3339::option")] + pub issued_date: Option, + #[doc = "Expiration date for the certificate."] + #[serde(rename = "expirationDate", default, with = "azure_core::date::rfc3339::option")] + pub expiration_date: Option, + #[doc = "Role of the certificate (Root CA, etc)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option, + #[doc = "The signature algorithm used in the certificate."] + #[serde(rename = "signatureAlgorithm", default, skip_serializing_if = "Option::is_none")] + pub signature_algorithm: Option, + #[doc = "Size of the certificate's key in bits"] + #[serde(rename = "keySize", default, skip_serializing_if = "Option::is_none")] + pub key_size: Option, + #[doc = "Key algorithm used in the certificate."] + #[serde(rename = "keyAlgorithm", default, skip_serializing_if = "Option::is_none")] + pub key_algorithm: Option, + #[doc = "Encoding used for the certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub encoding: Option, + #[doc = "Serial number of the certificate."] + #[serde(rename = "serialNumber", default, skip_serializing_if = "Option::is_none")] + pub serial_number: Option, + #[doc = "Fingerprint of the certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[doc = "List of functions the certificate can fulfill."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub usage: Vec, + #[doc = "List of files paths for this certificate"] + #[serde( + rename = "filePaths", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub file_paths: Vec, + #[doc = "Details of a matching paired key or certificate."] + #[serde(rename = "pairedKey", default, skip_serializing_if = "Option::is_none")] + pub paired_key: Option, + #[doc = "Indicates if the certificate is expired."] + #[serde(rename = "isExpired", default, skip_serializing_if = "Option::is_none")] + pub is_expired: Option, + #[doc = "Indicates if the certificate was self-signed."] + #[serde(rename = "isSelfSigned", default, skip_serializing_if = "Option::is_none")] + pub is_self_signed: Option, + #[doc = "Indicates the signature algorithm used is insecure."] + #[serde(rename = "isWeakSignature", default, skip_serializing_if = "Option::is_none")] + pub is_weak_signature: Option, + #[doc = "Indicates the certificate's key size is considered too small to be secure for the key algorithm."] + #[serde(rename = "isShortKeySize", default, skip_serializing_if = "Option::is_none")] + pub is_short_key_size: Option, +} +impl CryptoCertificate { + pub fn new() -> Self { + Self::default() + } +} +pub mod crypto_certificate { + use super::*; + #[doc = "Indicates if the certificate is expired."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsExpired")] + pub enum IsExpired { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsExpired { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsExpired { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsExpired { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsExpired", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsExpired", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates if the certificate was self-signed."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsSelfSigned")] + pub enum IsSelfSigned { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsSelfSigned { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsSelfSigned { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsSelfSigned { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsSelfSigned", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsSelfSigned", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates the signature algorithm used is insecure."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsWeakSignature")] + pub enum IsWeakSignature { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsWeakSignature { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsWeakSignature { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsWeakSignature { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsWeakSignature", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsWeakSignature", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates the certificate's key size is considered too small to be secure for the key algorithm."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsShortKeySize")] + pub enum IsShortKeySize { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsShortKeySize { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsShortKeySize { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsShortKeySize { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsShortKeySize", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsShortKeySize", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Information on an entity (distinguished name) in a cryptographic certificate."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoCertificateEntity { + #[doc = "Common name of the certificate entity."] + #[serde(rename = "commonName", default, skip_serializing_if = "Option::is_none")] + pub common_name: Option, + #[doc = "Organization of the certificate entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub organization: Option, + #[doc = "The organizational unit of the certificate entity."] + #[serde(rename = "organizationalUnit", default, skip_serializing_if = "Option::is_none")] + pub organizational_unit: Option, + #[doc = "Geographical state or province of the certificate entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Country code of the certificate entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, +} +impl CryptoCertificateEntity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Crypto certificates list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoCertificateList { + #[doc = "Crypto certificates list"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CryptoCertificateList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CryptoCertificateList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Cryptographic certificate summary values."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoCertificateSummary { + #[doc = "Total number of certificates found."] + #[serde(rename = "totalCertificates", default, skip_serializing_if = "Option::is_none")] + pub total_certificates: Option, + #[doc = "Total number of paired private keys found for the certificates."] + #[serde(rename = "pairedKeys", default, skip_serializing_if = "Option::is_none")] + pub paired_keys: Option, + #[doc = "Total number of expired certificates found."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub expired: Option, + #[doc = "Total number of nearly expired certificates found."] + #[serde(rename = "expiringSoon", default, skip_serializing_if = "Option::is_none")] + pub expiring_soon: Option, + #[doc = "Total number of certificates found using a weak signature algorithm."] + #[serde(rename = "weakSignature", default, skip_serializing_if = "Option::is_none")] + pub weak_signature: Option, + #[doc = "Total number of certificates found that are self-signed."] + #[serde(rename = "selfSigned", default, skip_serializing_if = "Option::is_none")] + pub self_signed: Option, + #[doc = "Total number of certificates found that have an insecure key size for the key algorithm."] + #[serde(rename = "shortKeySize", default, skip_serializing_if = "Option::is_none")] + pub short_key_size: Option, +} +impl CryptoCertificateSummary { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Crypto key properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoKey { + #[doc = "ID for the key."] + #[serde(rename = "cryptoKeyId", default, skip_serializing_if = "Option::is_none")] + pub crypto_key_id: Option, + #[doc = "Type of the key (public or private)."] + #[serde(rename = "keyType", default, skip_serializing_if = "Option::is_none")] + pub key_type: Option, + #[doc = "Size of the key in bits."] + #[serde(rename = "keySize", default, skip_serializing_if = "Option::is_none")] + pub key_size: Option, + #[doc = "Key algorithm name."] + #[serde(rename = "keyAlgorithm", default, skip_serializing_if = "Option::is_none")] + pub key_algorithm: Option, + #[doc = "Functions the key can fulfill."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub usage: Vec, + #[doc = "List of files paths for this key."] + #[serde( + rename = "filePaths", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub file_paths: Vec, + #[doc = "Details of a matching paired key or certificate."] + #[serde(rename = "pairedKey", default, skip_serializing_if = "Option::is_none")] + pub paired_key: Option, + #[doc = "Indicates the key size is considered too small to be secure for the algorithm."] + #[serde(rename = "isShortKeySize", default, skip_serializing_if = "Option::is_none")] + pub is_short_key_size: Option, +} +impl CryptoKey { + pub fn new() -> Self { + Self::default() + } +} +pub mod crypto_key { + use super::*; + #[doc = "Indicates the key size is considered too small to be secure for the algorithm."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsShortKeySize")] + pub enum IsShortKeySize { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsShortKeySize { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsShortKeySize { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsShortKeySize { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsShortKeySize", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsShortKeySize", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Crypto keys list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoKeyList { + #[doc = "Crypto keys list"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CryptoKeyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CryptoKeyList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Cryptographic key summary values."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CryptoKeySummary { + #[doc = "Total number of cryptographic keys found."] + #[serde(rename = "totalKeys", default, skip_serializing_if = "Option::is_none")] + pub total_keys: Option, + #[doc = "Total number of (non-certificate) public keys found."] + #[serde(rename = "publicKeys", default, skip_serializing_if = "Option::is_none")] + pub public_keys: Option, + #[doc = "Total number of private keys found."] + #[serde(rename = "privateKeys", default, skip_serializing_if = "Option::is_none")] + pub private_keys: Option, + #[doc = "Total number of keys found that have a matching paired key or certificate."] + #[serde(rename = "pairedKeys", default, skip_serializing_if = "Option::is_none")] + pub paired_keys: Option, + #[doc = "Total number of keys found that have an insecure key size for the algorithm."] + #[serde(rename = "shortKeySize", default, skip_serializing_if = "Option::is_none")] + pub short_key_size: Option, +} +impl CryptoKeySummary { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Known CVEs of a firmware."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cve { + #[doc = "ID of CVE"] + #[serde(rename = "cveId", default, skip_serializing_if = "Option::is_none")] + pub cve_id: Option, + #[doc = "Component of CVE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub component: Option, + #[doc = "Severity of CVE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "Name of CVE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "A single CVSS score to represent the CVE. If a V3 score is specified, then it will use the V3 score. Otherwise if the V2 score is specified it will be the V2 score"] + #[serde(rename = "cvssScore", default, skip_serializing_if = "Option::is_none")] + pub cvss_score: Option, + #[doc = "Cvss version of CVE"] + #[serde(rename = "cvssVersion", default, skip_serializing_if = "Option::is_none")] + pub cvss_version: Option, + #[doc = "Cvss V2 score of CVE"] + #[serde(rename = "cvssV2Score", default, skip_serializing_if = "Option::is_none")] + pub cvss_v2_score: Option, + #[doc = "Cvss V3 score of CVE"] + #[serde(rename = "cvssV3Score", default, skip_serializing_if = "Option::is_none")] + pub cvss_v3_score: Option, + #[doc = "Publish date of CVE"] + #[serde(rename = "publishDate", default, with = "azure_core::date::rfc3339::option")] + pub publish_date: Option, + #[doc = "Updated date of CVE"] + #[serde(rename = "updatedDate", default, with = "azure_core::date::rfc3339::option")] + pub updated_date: Option, + #[doc = "The list of CVE links."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub links: Vec, + #[doc = "Description of CVE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl Cve { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Component for CVE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CveComponent { + #[doc = "ID of CVE component"] + #[serde(rename = "componentId", default, skip_serializing_if = "Option::is_none")] + pub component_id: Option, + #[doc = "Name of CVE component"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Version of CVE component"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl CveComponent { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Link for CVE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CveLink { + #[doc = "Href of CVE link"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub href: Option, + #[doc = "Label of CVE link"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, +} +impl CveLink { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List result for CVE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CveList { + #[doc = "The list of CVE results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CveList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CveList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "CVE summary values."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CveSummary { + #[doc = "The total number of critical severity CVEs detected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub critical: Option, + #[doc = "The total number of high severity CVEs detected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub high: Option, + #[doc = "The total number of medium severity CVEs detected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub medium: Option, + #[doc = "The total number of low severity CVEs detected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub low: Option, + #[doc = "The total number of unknown severity CVEs detected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unknown: Option, + #[doc = "The total number of undefined severity CVEs detected"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub undefined: Option, +} +impl CveSummary { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Firmware definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Firmware { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Firmware properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Firmware { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of firmwares"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FirmwareList { + #[doc = "The list of firmwares."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for FirmwareList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl FirmwareList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Firmware properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FirmwareProperties { + #[doc = "File name for a firmware that user uploaded."] + #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")] + pub file_name: Option, + #[doc = "Firmware vendor."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vendor: Option, + #[doc = "Firmware model."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub model: Option, + #[doc = "Firmware version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "User-specified description of the firmware."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "File size of the uploaded firmware image."] + #[serde(rename = "fileSize", default, skip_serializing_if = "Option::is_none")] + pub file_size: Option, + #[doc = "The status of firmware scan."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "A list of errors or other messages generated during firmware analysis"] + #[serde( + rename = "statusMessages", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub status_messages: Vec, + #[doc = "Provisioning state of the resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl FirmwareProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod firmware_properties { + use super::*; + #[doc = "The status of firmware scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Pending, + Extracting, + Analyzing, + Ready, + Error, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Pending => serializer.serialize_unit_variant("Status", 0u32, "Pending"), + Self::Extracting => serializer.serialize_unit_variant("Status", 1u32, "Extracting"), + Self::Analyzing => serializer.serialize_unit_variant("Status", 2u32, "Analyzing"), + Self::Ready => serializer.serialize_unit_variant("Status", 3u32, "Ready"), + Self::Error => serializer.serialize_unit_variant("Status", 4u32, "Error"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Status { + fn default() -> Self { + Self::Pending + } + } + #[doc = "Provisioning state of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Accepted, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Summary result after scanning the firmware."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FirmwareSummary { + #[doc = "Total extracted size of the firmware in bytes."] + #[serde(rename = "extractedSize", default, skip_serializing_if = "Option::is_none")] + pub extracted_size: Option, + #[doc = "Firmware file size in bytes."] + #[serde(rename = "fileSize", default, skip_serializing_if = "Option::is_none")] + pub file_size: Option, + #[doc = "Extracted file count."] + #[serde(rename = "extractedFileCount", default, skip_serializing_if = "Option::is_none")] + pub extracted_file_count: Option, + #[doc = "Components count."] + #[serde(rename = "componentCount", default, skip_serializing_if = "Option::is_none")] + pub component_count: Option, + #[doc = "Binary count"] + #[serde(rename = "binaryCount", default, skip_serializing_if = "Option::is_none")] + pub binary_count: Option, + #[doc = "Time used for analysis"] + #[serde(rename = "analysisTimeSeconds", default, skip_serializing_if = "Option::is_none")] + pub analysis_time_seconds: Option, + #[doc = "The number of root file systems found."] + #[serde(rename = "rootFileSystems", default, skip_serializing_if = "Option::is_none")] + pub root_file_systems: Option, +} +impl FirmwareSummary { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Firmware definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FirmwareUpdateDefinition { + #[doc = "Firmware properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl FirmwareUpdateDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties for generating an upload URL"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GenerateUploadUrlRequest { + #[doc = "A unique ID for the firmware to be uploaded."] + #[serde(rename = "firmwareId", default, skip_serializing_if = "Option::is_none")] + pub firmware_id: Option, +} +impl GenerateUploadUrlRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of a REST API operation, returned from the Resource Provider Operations API"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Localized display information for this particular operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[serde(rename = "actionType", default, skip_serializing_if = "Option::is_none")] + pub action_type: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Localized display information for this particular operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The short, localized friendly description of the operation; suitable for tool tips and detailed views."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(rename = "user,system")] + UserSystem, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UserSystem => serializer.serialize_unit_variant("Origin", 2u32, "user,system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + Internal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Internal => serializer.serialize_unit_variant("ActionType", 0u32, "Internal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of operations supported by the resource provider"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results (if there are any)."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of a matching paired key or certificate."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PairedKey { + #[doc = "ID of the paired key or certificate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The type indicating whether the paired object is a key or certificate."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Additional paired key properties"] + #[serde(rename = "additionalProperties", default, skip_serializing_if = "Option::is_none")] + pub additional_properties: Option, +} +impl PairedKey { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Password hash properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PasswordHash { + #[doc = "ID for password hash"] + #[serde(rename = "passwordHashId", default, skip_serializing_if = "Option::is_none")] + pub password_hash_id: Option, + #[doc = "File path of the password hash"] + #[serde(rename = "filePath", default, skip_serializing_if = "Option::is_none")] + pub file_path: Option, + #[doc = "Salt of the password hash"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub salt: Option, + #[doc = "Hash of the password"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hash: Option, + #[doc = "Context of password hash"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub context: Option, + #[doc = "User name of password hash"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "Algorithm of the password hash"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub algorithm: Option, +} +impl PasswordHash { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Password hashes list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PasswordHashList { + #[doc = "Password hashes list"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PasswordHashList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PasswordHashList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error and status message"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StatusMessage {} +impl StatusMessage { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "Url data for creating or accessing a blob file."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UrlToken { + #[doc = "SAS URL for creating or accessing a blob file."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, + #[doc = "SAS URL for file uploading. Kept for backwards compatibility"] + #[serde(rename = "uploadUrl", default, skip_serializing_if = "Option::is_none")] + pub upload_url: Option, +} +impl UrlToken { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Firmware analysis workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Workspace { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Workspace properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Workspace { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + } + } +} +#[doc = "Return a list of firmware analysis workspaces."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceList { + #[doc = "The list of firmware analysis workspaces."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of asset."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WorkspaceList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Workspace properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceProperties { + #[doc = "Provisioning state of the resource."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl WorkspaceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod workspace_properties { + use super::*; + #[doc = "Provisioning state of the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Accepted, + Succeeded, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Firmware analysis workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceUpdateDefinition { + #[doc = "Workspace properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceUpdateDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/hardwaresecuritymodules/src/package_2021_11/models.rs b/services/mgmt/hardwaresecuritymodules/src/package_2021_11/models.rs index 73a2910ec6..81ed6f3bd1 100644 --- a/services/mgmt/hardwaresecuritymodules/src/package_2021_11/models.rs +++ b/services/mgmt/hardwaresecuritymodules/src/package_2021_11/models.rs @@ -87,6 +87,9 @@ pub struct DedicatedHsmOperation { #[doc = "Gets or sets a value indicating whether it is a data plane action"] #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] pub is_data_action: Option, + #[doc = "The origin of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, #[doc = "The display string."] #[serde(default, skip_serializing_if = "Option::is_none")] pub display: Option, diff --git a/services/mgmt/hdinsight/Cargo.toml b/services/mgmt/hdinsight/Cargo.toml index e8a1acd4e6..77c27ebaef 100644 --- a/services/mgmt/hdinsight/Cargo.toml +++ b/services/mgmt/hdinsight/Cargo.toml @@ -36,6 +36,7 @@ default = ["package-2021-06", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-04" = [] "package-2021-06" = [] "package-2018-06-preview" = [] "package-2015-03-preview" = [] \ No newline at end of file diff --git a/services/mgmt/hdinsight/README.md b/services/mgmt/hdinsight/README.md index 90cf4b5189..c3e1d55e0d 100644 --- a/services/mgmt/hdinsight/README.md +++ b/services/mgmt/hdinsight/README.md @@ -10,6 +10,7 @@ The default tag is `package-2021-06`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-04` has 54 operations from 1 API versions: `2023-04-15-preview`. Use crate feature `package-preview-2023-04` to enable. The operations will be in the `package_preview_2023_04` module. - `package-2021-06` has 54 operations from 1 API versions: `2021-06-01`. Use crate feature `package-2021-06` to enable. The operations will be in the `package_2021_06` module. - `package-2018-06-preview` has 48 operations from 1 API versions: `2018-06-01-preview`. Use crate feature `package-2018-06-preview` to enable. The operations will be in the `package_2018_06_preview` module. - `package-2015-03-preview` has 48 operations from 1 API versions: `2015-03-01-preview`. Use crate feature `package-2015-03-preview` to enable. The operations will be in the `package_2015_03_preview` module. \ No newline at end of file diff --git a/services/mgmt/hdinsight/src/lib.rs b/services/mgmt/hdinsight/src/lib.rs index 1634f16864..a7170b3fc6 100644 --- a/services/mgmt/hdinsight/src/lib.rs +++ b/services/mgmt/hdinsight/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-04")] +pub mod package_preview_2023_04; +#[cfg(all(feature = "package-preview-2023-04", not(feature = "no-default-tag")))] +pub use package_preview_2023_04::*; #[cfg(feature = "package-2021-06")] pub mod package_2021_06; #[cfg(all(feature = "package-2021-06", not(feature = "no-default-tag")))] diff --git a/services/mgmt/hdinsight/src/package_preview_2023_04/mod.rs b/services/mgmt/hdinsight/src/package_preview_2023_04/mod.rs new file mode 100644 index 0000000000..8fa48f0004 --- /dev/null +++ b/services/mgmt/hdinsight/src/package_preview_2023_04/mod.rs @@ -0,0 +1,5828 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn applications_client(&self) -> applications::Client { + applications::Client(self.clone()) + } + pub fn clusters_client(&self) -> clusters::Client { + clusters::Client(self.clone()) + } + pub fn configurations_client(&self) -> configurations::Client { + configurations::Client(self.clone()) + } + pub fn extensions_client(&self) -> extensions::Client { + extensions::Client(self.clone()) + } + pub fn locations_client(&self) -> locations::Client { + locations::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { + private_endpoint_connections::Client(self.clone()) + } + pub fn private_link_resources_client(&self) -> private_link_resources::Client { + private_link_resources::Client(self.clone()) + } + pub fn script_actions_client(&self) -> script_actions::Client { + script_actions::Client(self.clone()) + } + pub fn script_execution_history_client(&self) -> script_execution_history::Client { + script_execution_history::Client(self.clone()) + } + pub fn virtual_machines_client(&self) -> virtual_machines::Client { + virtual_machines::Client(self.clone()) + } +} +pub mod applications { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the applications for the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list_by_cluster( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list_by_cluster::RequestBuilder { + list_by_cluster::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Gets properties of the specified application."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `application_name`: The constant value for the application name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + application_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + application_name: application_name.into(), + } + } + #[doc = "Creates applications for the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `application_name`: The constant value for the application name."] + #[doc = "* `parameters`: The application create request."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + application_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + application_name: application_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified application on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `application_name`: The constant value for the application name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + application_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + application_name: application_name.into(), + } + } + #[doc = "Gets the async operation status."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `application_name`: The constant value for the application name."] + #[doc = "* `operation_id`: The long running operation id."] + pub fn get_azure_async_operation_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + application_name: impl Into, + operation_id: impl Into, + ) -> get_azure_async_operation_status::RequestBuilder { + get_azure_async_operation_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + application_name: application_name.into(), + operation_id: operation_id.into(), + } + } + } + pub mod list_by_cluster { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApplicationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/applications", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Application = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) application_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/applications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.application_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Application = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) application_name: String, + pub(crate) parameters: models::Application, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/applications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.application_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) application_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/applications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.application_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_azure_async_operation_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AsyncOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) application_name: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/applications/{}/azureasyncoperations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_name , & this . application_name , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available HDInsight REST API operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.HDInsight/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod clusters { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the specified cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Creates a new HDInsight cluster with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The cluster create request."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Patch HDInsight cluster with the specified parameters."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The cluster patch request."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Lists the HDInsight clusters in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Resizes the specified HDInsight cluster to the specified size."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `role_name`: The constant value for the roleName"] + #[doc = "* `parameters`: The parameters for the resize operation."] + pub fn resize( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + role_name: impl Into, + parameters: impl Into, + ) -> resize::RequestBuilder { + resize::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + role_name: role_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates the Autoscale Configuration for HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `role_name`: The constant value for the roleName"] + #[doc = "* `parameters`: The parameters for the update autoscale configuration operation."] + pub fn update_auto_scale_configuration( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + role_name: impl Into, + parameters: impl Into, + ) -> update_auto_scale_configuration::RequestBuilder { + update_auto_scale_configuration::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + role_name: role_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Lists all the HDInsight clusters under the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Rotate disk encryption key of the specified HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The parameters for the disk encryption operation."] + pub fn rotate_disk_encryption_key( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> rotate_disk_encryption_key::RequestBuilder { + rotate_disk_encryption_key::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Gets the gateway settings for the specified cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn get_gateway_settings( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> get_gateway_settings::RequestBuilder { + get_gateway_settings::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Configures the gateway settings on the specified cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The cluster configurations."] + pub fn update_gateway_settings( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> update_gateway_settings::RequestBuilder { + update_gateway_settings::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "The the async operation status."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `operation_id`: The long running operation id."] + pub fn get_azure_async_operation_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + operation_id: impl Into, + ) -> get_azure_async_operation_status::RequestBuilder { + get_azure_async_operation_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + operation_id: operation_id.into(), + } + } + #[doc = "Updates the cluster identity certificate."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The cluster configurations."] + pub fn update_identity_certificate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> update_identity_certificate::RequestBuilder { + update_identity_certificate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Executes script actions on the specified HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The parameters for executing script actions."] + pub fn execute_script_actions( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> execute_script_actions::RequestBuilder { + execute_script_actions::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Cluster = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Cluster = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::ClusterCreateParametersExtended, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Cluster = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::ClusterPatchParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod resize { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) role_name: String, + pub(crate) parameters: models::ClusterResizeParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/roles/{}/resize", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.role_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_auto_scale_configuration { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) role_name: String, + pub(crate) parameters: models::AutoscaleConfigurationUpdateParameter, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/roles/{}/autoscale", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.role_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/clusters", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod rotate_disk_encryption_key { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::ClusterDiskEncryptionParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/rotatediskencryptionkey", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_gateway_settings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GatewaySettings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/getGatewaySettings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_gateway_settings { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::UpdateGatewaySettingsParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/updateGatewaySettings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_azure_async_operation_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AsyncOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/azureasyncoperations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_identity_certificate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::UpdateClusterIdentityCertificateParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/updateClusterIdentityCertificate" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod execute_script_actions { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::ExecuteScriptActionParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/executeScriptActions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod script_actions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Deletes a specified persisted script action of the cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `script_name`: The name of the script."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + script_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + script_name: script_name.into(), + } + } + #[doc = "Lists all the persisted script actions for the specified cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list_by_cluster( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list_by_cluster::RequestBuilder { + list_by_cluster::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Gets the script execution detail for the given script execution ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `script_execution_id`: The script execution Id"] + pub fn get_execution_detail( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + script_execution_id: impl Into, + ) -> get_execution_detail::RequestBuilder { + get_execution_detail::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + script_execution_id: script_execution_id.into(), + } + } + #[doc = "Gets the async operation status of execution operation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `operation_id`: The long running operation id."] + pub fn get_execution_async_operation_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + operation_id: impl Into, + ) -> get_execution_async_operation_status::RequestBuilder { + get_execution_async_operation_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + operation_id: operation_id.into(), + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) script_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/scriptActions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.script_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_cluster { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScriptActionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/scriptActions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_execution_detail { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuntimeScriptActionDetail = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) script_execution_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/scriptExecutionHistory/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.script_execution_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_execution_async_operation_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AsyncOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/executeScriptActions/azureasyncoperations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_name , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod script_execution_history { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all scripts' execution history for the specified cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list_by_cluster( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list_by_cluster::RequestBuilder { + list_by_cluster::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Promotes the specified ad-hoc script execution to a persisted script."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `script_execution_id`: The script execution Id"] + pub fn promote( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + script_execution_id: impl Into, + ) -> promote::RequestBuilder { + promote::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + script_execution_id: script_execution_id.into(), + } + } + } + pub mod list_by_cluster { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScriptActionExecutionHistoryList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/scriptExecutionHistory", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod promote { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) script_execution_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/scriptExecutionHistory/{}/promote" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_name , & this . script_execution_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod private_endpoint_connections { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the private endpoint connections for a HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list_by_cluster( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list_by_cluster::RequestBuilder { + list_by_cluster::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Gets the specific private endpoint connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + #[doc = "Approve or reject a private endpoint connection manually."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection."] + #[doc = "* `parameters`: The private endpoint connection create or update request."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + private_endpoint_connection_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specific private endpoint connection."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + private_endpoint_connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + } + pub mod list_by_cluster { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/privateEndpointConnections", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) parameters: models::PrivateEndpointConnection, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) private_endpoint_connection_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod configurations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all configuration information for an HDI cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `configuration_name`: The name of the cluster configuration."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + configuration_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + configuration_name: configuration_name.into(), + } + } + #[doc = "Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `configuration_name`: The name of the cluster configuration."] + #[doc = "* `parameters`: The cluster configurations."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + configuration_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + configuration_name: configuration_name.into(), + parameters: parameters.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterConfigurations = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/configurations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) configuration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/configurations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.configuration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) configuration_name: String, + pub(crate) parameters: models::ClusterConfiguration, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/configurations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.configuration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod extensions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the status of Operations Management Suite (OMS) on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn get_monitoring_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> get_monitoring_status::RequestBuilder { + get_monitoring_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Enables the Operations Management Suite (OMS) on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The Operations Management Suite (OMS) workspace parameters."] + pub fn enable_monitoring( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> enable_monitoring::RequestBuilder { + enable_monitoring::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Disables the Operations Management Suite (OMS) on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn disable_monitoring( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> disable_monitoring::RequestBuilder { + disable_monitoring::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Gets the status of Azure Monitor on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn get_azure_monitor_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> get_azure_monitor_status::RequestBuilder { + get_azure_monitor_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Enables the Azure Monitor on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `parameters`: The Log Analytics workspace parameters."] + pub fn enable_azure_monitor( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + parameters: impl Into, + ) -> enable_azure_monitor::RequestBuilder { + enable_azure_monitor::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Disables the Azure Monitor on the HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn disable_azure_monitor( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> disable_azure_monitor::RequestBuilder { + disable_azure_monitor::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Gets the extension properties for the specified HDInsight cluster extension."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `extension_name`: The name of the cluster extension."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + extension_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + extension_name: extension_name.into(), + } + } + #[doc = "Creates an HDInsight cluster extension."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `extension_name`: The name of the cluster extension."] + #[doc = "* `parameters`: The cluster extensions create request."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + extension_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + extension_name: extension_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes the specified extension for HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `extension_name`: The name of the cluster extension."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + extension_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + extension_name: extension_name.into(), + } + } + #[doc = "Gets the async operation status."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `extension_name`: The name of the cluster extension."] + #[doc = "* `operation_id`: The long running operation id."] + pub fn get_azure_async_operation_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + extension_name: impl Into, + operation_id: impl Into, + ) -> get_azure_async_operation_status::RequestBuilder { + get_azure_async_operation_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + extension_name: extension_name.into(), + operation_id: operation_id.into(), + } + } + } + pub mod get_monitoring_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterMonitoringResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/clustermonitoring", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod enable_monitoring { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::ClusterMonitoringRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/clustermonitoring", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod disable_monitoring { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/clustermonitoring", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_azure_monitor_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AzureMonitorResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/azureMonitor", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod enable_azure_monitor { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) parameters: models::AzureMonitorRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/azureMonitor", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod disable_azure_monitor { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/azureMonitor", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterMonitoringResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.extension_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_name: String, + pub(crate) parameters: models::Extension, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.extension_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.extension_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_azure_async_operation_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AsyncOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_name: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/extensions/{}/azureAsyncOperations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_name , & this . extension_name , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod locations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the capabilities for the specified location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: The Azure location (region) for which to make the request."] + pub fn get_capabilities( + &self, + subscription_id: impl Into, + location: impl Into, + ) -> get_capabilities::RequestBuilder { + get_capabilities::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + #[doc = "Lists the usages for the specified location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: The Azure location (region) for which to make the request."] + pub fn list_usages(&self, subscription_id: impl Into, location: impl Into) -> list_usages::RequestBuilder { + list_usages::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + #[doc = "Lists the billingSpecs for the specified subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: The Azure location (region) for which to make the request."] + pub fn list_billing_specs( + &self, + subscription_id: impl Into, + location: impl Into, + ) -> list_billing_specs::RequestBuilder { + list_billing_specs::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + } + } + #[doc = "Get the async operation status."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: The Azure location (region) for which to make the request."] + #[doc = "* `operation_id`: The long running operation id."] + pub fn get_azure_async_operation_status( + &self, + subscription_id: impl Into, + location: impl Into, + operation_id: impl Into, + ) -> get_azure_async_operation_status::RequestBuilder { + get_azure_async_operation_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + operation_id: operation_id.into(), + } + } + #[doc = "Check the cluster name is available or not."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: The Azure location (region) for which to make the request."] + pub fn check_name_availability( + &self, + subscription_id: impl Into, + location: impl Into, + parameters: impl Into, + ) -> check_name_availability::RequestBuilder { + check_name_availability::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + parameters: parameters.into(), + } + } + #[doc = "Validate the cluster create request spec is valid or not."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `location`: The Azure location (region) for which to make the request."] + pub fn validate_cluster_create_request( + &self, + subscription_id: impl Into, + location: impl Into, + parameters: impl Into, + ) -> validate_cluster_create_request::RequestBuilder { + validate_cluster_create_request::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + parameters: parameters.into(), + } + } + } + pub mod get_capabilities { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CapabilitiesResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/locations/{}/capabilities", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_usages { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::UsagesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/locations/{}/usages", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_billing_specs { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::BillingResponseListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/locations/{}/billingSpecs", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_azure_async_operation_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AsyncOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/locations/{}/azureasyncoperations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod check_name_availability { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NameAvailabilityCheckResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) parameters: models::NameAvailabilityCheckRequestParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/locations/{}/checkNameAvailability", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod validate_cluster_create_request { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ClusterCreateValidationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) parameters: models::ClusterCreateRequestValidationParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HDInsight/locations/{}/validateCreateRequest", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod private_link_resources { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the private link resources in a HDInsight cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list_by_cluster( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list_by_cluster::RequestBuilder { + list_by_cluster::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Gets the specific private link resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `private_link_resource_name`: The name of the private link resource."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + private_link_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + private_link_resource_name: private_link_resource_name.into(), + } + } + } + pub mod list_by_cluster { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResourceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/privateLinkResources", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateLinkResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) private_link_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/privateLinkResources/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name, + &this.private_link_resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod virtual_machines { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists the HDInsight clusters hosts"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + pub fn list_hosts( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + ) -> list_hosts::RequestBuilder { + list_hosts::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + } + } + #[doc = "Restarts the specified HDInsight cluster hosts."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `hosts`: The list of hosts to restart"] + pub fn restart_hosts( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + hosts: impl Into, + ) -> restart_hosts::RequestBuilder { + restart_hosts::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + hosts: hosts.into(), + } + } + #[doc = "Gets the async operation status."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cluster_name`: The name of the cluster."] + #[doc = "* `operation_id`: The long running operation id."] + pub fn get_async_operation_status( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_name: impl Into, + operation_id: impl Into, + ) -> get_async_operation_status::RequestBuilder { + get_async_operation_status::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_name: cluster_name.into(), + operation_id: operation_id.into(), + } + } + } + pub mod list_hosts { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HostInfoListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/listHosts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod restart_hosts { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) hosts: models::RestartHostsParameters, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/restartHosts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cluster_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.hosts)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod get_async_operation_status { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AsyncOperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_name: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HDInsight/clusters/{}/restartHosts/azureasyncoperations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_name , & this . operation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/hdinsight/src/package_preview_2023_04/models.rs b/services/mgmt/hdinsight/src/package_preview_2023_04/models.rs new file mode 100644 index 0000000000..9a0ba6ae29 --- /dev/null +++ b/services/mgmt/hdinsight/src/package_preview_2023_04/models.rs @@ -0,0 +1,3474 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "The Azure active directory domain service resource details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AaddsResourceDetails { + #[doc = "The Azure active directory domain service name."] + #[serde(rename = "domainName", default, skip_serializing_if = "Option::is_none")] + pub domain_name: Option, + #[doc = "This indicates whether initial sync complete or not."] + #[serde(rename = "initialSyncComplete", default, skip_serializing_if = "Option::is_none")] + pub initial_sync_complete: Option, + #[doc = "This indicates whether enable ldaps or not."] + #[serde(rename = "ldapsEnabled", default, skip_serializing_if = "Option::is_none")] + pub ldaps_enabled: Option, + #[doc = "The base 64 format string of public ldap certificate."] + #[serde(rename = "ldapsPublicCertificateInBase64", default, skip_serializing_if = "Option::is_none")] + pub ldaps_public_certificate_in_base64: Option, + #[doc = "The resource id of azure active directory domain service."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The subnet resource id."] + #[serde(rename = "subnetId", default, skip_serializing_if = "Option::is_none")] + pub subnet_id: Option, + #[doc = "The tenant id of azure active directory domain service ."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl AaddsResourceDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The HDInsight cluster application"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Application { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The ETag for the application"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "The tags for the application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The HDInsight cluster application GET response."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Application { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Gets the application SSH endpoint"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationGetEndpoint { + #[doc = "The location of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "The destination port to connect to."] + #[serde(rename = "destinationPort", default, skip_serializing_if = "Option::is_none")] + pub destination_port: Option, + #[doc = "The public port to connect to."] + #[serde(rename = "publicPort", default, skip_serializing_if = "Option::is_none")] + pub public_port: Option, + #[doc = "The private ip address of the endpoint."] + #[serde(rename = "privateIPAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, +} +impl ApplicationGetEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Gets the application HTTP endpoints."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationGetHttpsEndpoint { + #[doc = "The list of access modes for the application."] + #[serde( + rename = "accessModes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub access_modes: Vec, + #[doc = "The location of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "The destination port to connect to."] + #[serde(rename = "destinationPort", default, skip_serializing_if = "Option::is_none")] + pub destination_port: Option, + #[doc = "The public port to connect to."] + #[serde(rename = "publicPort", default, skip_serializing_if = "Option::is_none")] + pub public_port: Option, + #[doc = "The private ip address of the endpoint."] + #[serde(rename = "privateIPAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, + #[doc = "The subdomain suffix of the application."] + #[serde(rename = "subDomainSuffix", default, skip_serializing_if = "Option::is_none")] + pub sub_domain_suffix: Option, + #[doc = "The value indicates whether to disable GatewayAuth."] + #[serde(rename = "disableGatewayAuth", default, skip_serializing_if = "Option::is_none")] + pub disable_gateway_auth: Option, +} +impl ApplicationGetHttpsEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the request to list cluster Applications. It contains a list of operations and a URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationListResult { + #[doc = "The list of HDInsight applications installed on HDInsight cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of operation list results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ApplicationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ApplicationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The HDInsight cluster application GET response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationProperties { + #[doc = "Describes the compute profile."] + #[serde(rename = "computeProfile", default, skip_serializing_if = "Option::is_none")] + pub compute_profile: Option, + #[doc = "The list of install script actions."] + #[serde( + rename = "installScriptActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub install_script_actions: Vec, + #[doc = "The list of uninstall script actions."] + #[serde( + rename = "uninstallScriptActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub uninstall_script_actions: Vec, + #[doc = "The list of application HTTPS endpoints."] + #[serde( + rename = "httpsEndpoints", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub https_endpoints: Vec, + #[doc = "The list of application SSH endpoints."] + #[serde( + rename = "sshEndpoints", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ssh_endpoints: Vec, + #[doc = "The provisioning state of the application."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The application type."] + #[serde(rename = "applicationType", default, skip_serializing_if = "Option::is_none")] + pub application_type: Option, + #[doc = "The application state."] + #[serde(rename = "applicationState", default, skip_serializing_if = "Option::is_none")] + pub application_state: Option, + #[doc = "The list of errors."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "The application create date time."] + #[serde(rename = "createdDate", default, skip_serializing_if = "Option::is_none")] + pub created_date: Option, + #[doc = "The marketplace identifier."] + #[serde(rename = "marketplaceIdentifier", default, skip_serializing_if = "Option::is_none")] + pub marketplace_identifier: Option, + #[doc = "The private link configurations."] + #[serde( + rename = "privateLinkConfigurations", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_link_configurations: Vec, +} +impl ApplicationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The azure async operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AsyncOperationResult { + #[doc = "The async operation state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The error message associated with the cluster creation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl AsyncOperationResult { + pub fn new() -> Self { + Self::default() + } +} +pub mod async_operation_result { + use super::*; + #[doc = "The async operation state."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + InProgress, + Succeeded, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("Status", 0u32, "InProgress"), + Self::Succeeded => serializer.serialize_unit_variant("Status", 1u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("Status", 2u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The autoscale request parameters"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Autoscale { + #[doc = "The load-based autoscale request parameters"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub capacity: Option, + #[doc = "Schedule-based autoscale request parameters"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub recurrence: Option, +} +impl Autoscale { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The load-based autoscale request parameters"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoscaleCapacity { + #[doc = "The minimum instance count of the cluster"] + #[serde(rename = "minInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub min_instance_count: Option, + #[doc = "The maximum instance count of the cluster"] + #[serde(rename = "maxInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub max_instance_count: Option, +} +impl AutoscaleCapacity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The autoscale configuration update parameter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoscaleConfigurationUpdateParameter { + #[doc = "The autoscale request parameters"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub autoscale: Option, +} +impl AutoscaleConfigurationUpdateParameter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Schedule-based autoscale request parameters"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoscaleRecurrence { + #[doc = "The time zone for the autoscale schedule times"] + #[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")] + pub time_zone: Option, + #[doc = "Array of schedule-based autoscale rules"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub schedule: Vec, +} +impl AutoscaleRecurrence { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Parameters for a schedule-based autoscale rule, consisting of an array of days + a time and capacity"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoscaleSchedule { + #[doc = "Days of the week for a schedule-based autoscale rule"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub days: Vec, + #[doc = "Time and capacity request parameters"] + #[serde(rename = "timeAndCapacity", default, skip_serializing_if = "Option::is_none")] + pub time_and_capacity: Option, +} +impl AutoscaleSchedule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Time and capacity request parameters"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoscaleTimeAndCapacity { + #[doc = "24-hour time in the form xx:xx"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub time: Option, + #[doc = "The minimum instance count of the cluster"] + #[serde(rename = "minInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub min_instance_count: Option, + #[doc = "The maximum instance count of the cluster"] + #[serde(rename = "maxInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub max_instance_count: Option, +} +impl AutoscaleTimeAndCapacity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The azure monitor parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureMonitorRequest { + #[doc = "The Log Analytics workspace ID."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The Log Analytics workspace key."] + #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] + pub primary_key: Option, + #[doc = "The selected configurations for azure monitor."] + #[serde(rename = "selectedConfigurations", default, skip_serializing_if = "Option::is_none")] + pub selected_configurations: Option, +} +impl AzureMonitorRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The azure monitor status response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureMonitorResponse { + #[doc = "The status of the monitor on the HDInsight cluster."] + #[serde(rename = "clusterMonitoringEnabled", default, skip_serializing_if = "Option::is_none")] + pub cluster_monitoring_enabled: Option, + #[doc = "The workspace ID of the monitor on the HDInsight cluster."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The selected configurations for azure monitor."] + #[serde(rename = "selectedConfigurations", default, skip_serializing_if = "Option::is_none")] + pub selected_configurations: Option, +} +impl AzureMonitorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The selected configurations for azure monitor."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureMonitorSelectedConfigurations { + #[doc = "The configuration version."] + #[serde(rename = "configurationVersion", default, skip_serializing_if = "Option::is_none")] + pub configuration_version: Option, + #[doc = "The global configurations of selected configurations."] + #[serde(rename = "globalConfigurations", default, skip_serializing_if = "Option::is_none")] + pub global_configurations: Option, + #[doc = "The table list."] + #[serde( + rename = "tableList", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub table_list: Vec, +} +impl AzureMonitorSelectedConfigurations { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The table configuration for the Log Analytics integration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureMonitorTableConfiguration { + #[doc = "The name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl AzureMonitorTableConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The billing meters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BillingMeters { + #[doc = "The virtual machine sizes."] + #[serde(rename = "meterParameter", default, skip_serializing_if = "Option::is_none")] + pub meter_parameter: Option, + #[doc = "The HDInsight meter guid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub meter: Option, + #[doc = "The unit of meter, VMHours or CoreHours."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, +} +impl BillingMeters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The billing resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BillingResources { + #[doc = "The region or location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The billing meter information."] + #[serde( + rename = "billingMeters", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub billing_meters: Vec, + #[doc = "The managed disk billing information."] + #[serde( + rename = "diskBillingMeters", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub disk_billing_meters: Vec, +} +impl BillingResources { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response for the operation to get regional billingSpecs for a subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BillingResponseListResult { + #[doc = "The virtual machine sizes to include or exclude."] + #[serde( + rename = "vmSizes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vm_sizes: Vec, + #[doc = "The vm sizes which enable encryption at host."] + #[serde( + rename = "vmSizesWithEncryptionAtHost", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vm_sizes_with_encryption_at_host: Vec, + #[doc = "The virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set."] + #[serde( + rename = "vmSizeFilters", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vm_size_filters: Vec, + #[doc = "The vm size properties."] + #[serde( + rename = "vmSizeProperties", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vm_size_properties: Vec, + #[doc = "The billing and managed disk billing resources for a region."] + #[serde( + rename = "billingResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub billing_resources: Vec, +} +impl BillingResponseListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Get Capabilities operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilitiesResult { + #[doc = "The version capability."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub versions: Option, + #[doc = "The virtual machine size compatibility features."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub regions: Option, + #[doc = "The capability features."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub features: Vec, + #[doc = "The regional quota capability."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quota: Option, +} +impl CapabilitiesResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The information of AAD security group."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClientGroupInfo { + #[doc = "The AAD security group name."] + #[serde(rename = "groupName", default, skip_serializing_if = "Option::is_none")] + pub group_name: Option, + #[doc = "The AAD security group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, +} +impl ClientGroupInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The HDInsight cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Cluster { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "The ETag for the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, + #[doc = "The availability zones."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zones: Vec, + #[doc = "The properties of cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Identity for the cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Cluster { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + etag: None, + zones: Vec::new(), + properties: None, + identity: None, + system_data: None, + } + } +} +#[doc = "The configuration object for the specified configuration for the specified cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterConfiguration {} +impl ClusterConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The configuration object for the specified cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterConfigurations { + #[doc = "The configuration object for the specified configuration for the specified cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configurations: Option, +} +impl ClusterConfigurations { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The CreateCluster request parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterCreateParametersExtended { + #[doc = "The location of the cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "The resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The availability zones."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub zones: Vec, + #[doc = "The cluster create parameters."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Identity for the cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl ClusterCreateParametersExtended { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The cluster create parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterCreateProperties { + #[doc = "The version of the cluster."] + #[serde(rename = "clusterVersion", default, skip_serializing_if = "Option::is_none")] + pub cluster_version: Option, + #[doc = "The type of operating system."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "The cluster tier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, + #[doc = "The cluster definition."] + #[serde(rename = "clusterDefinition", default, skip_serializing_if = "Option::is_none")] + pub cluster_definition: Option, + #[doc = "The kafka rest proxy configuration which contains AAD security group information."] + #[serde(rename = "kafkaRestProperties", default, skip_serializing_if = "Option::is_none")] + pub kafka_rest_properties: Option, + #[doc = "The security profile which contains Ssh public key for the HDInsight cluster."] + #[serde(rename = "securityProfile", default, skip_serializing_if = "Option::is_none")] + pub security_profile: Option, + #[doc = "Describes the compute profile."] + #[serde(rename = "computeProfile", default, skip_serializing_if = "Option::is_none")] + pub compute_profile: Option, + #[doc = "The storage profile."] + #[serde(rename = "storageProfile", default, skip_serializing_if = "Option::is_none")] + pub storage_profile: Option, + #[doc = "The disk encryption properties"] + #[serde(rename = "diskEncryptionProperties", default, skip_serializing_if = "Option::is_none")] + pub disk_encryption_properties: Option, + #[doc = "The encryption-in-transit properties."] + #[serde(rename = "encryptionInTransitProperties", default, skip_serializing_if = "Option::is_none")] + pub encryption_in_transit_properties: Option, + #[doc = "The minimal supported tls version."] + #[serde(rename = "minSupportedTlsVersion", default, skip_serializing_if = "Option::is_none")] + pub min_supported_tls_version: Option, + #[doc = "The network properties."] + #[serde(rename = "networkProperties", default, skip_serializing_if = "Option::is_none")] + pub network_properties: Option, + #[doc = "The compute isolation properties."] + #[serde(rename = "computeIsolationProperties", default, skip_serializing_if = "Option::is_none")] + pub compute_isolation_properties: Option, + #[doc = "The private link configurations."] + #[serde( + rename = "privateLinkConfigurations", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_link_configurations: Vec, +} +impl ClusterCreateProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod cluster_create_properties { + use super::*; + #[doc = "The type of operating system."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OsType")] + pub enum OsType { + Windows, + Linux, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Windows => serializer.serialize_unit_variant("OsType", 0u32, "Windows"), + Self::Linux => serializer.serialize_unit_variant("OsType", 1u32, "Linux"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The cluster tier."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Tier")] + pub enum Tier { + Standard, + Premium, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Tier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Tier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Tier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Standard => serializer.serialize_unit_variant("Tier", 0u32, "Standard"), + Self::Premium => serializer.serialize_unit_variant("Tier", 1u32, "Premium"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Tier { + fn default() -> Self { + Self::Standard + } + } +} +#[doc = "The cluster create request specification."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterCreateRequestValidationParameters { + #[serde(flatten)] + pub cluster_create_parameters_extended: ClusterCreateParametersExtended, + #[doc = "The cluster name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The tenant id."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "This indicates whether fetch Aadds resource or not."] + #[serde(rename = "fetchAaddsResource", default, skip_serializing_if = "Option::is_none")] + pub fetch_aadds_resource: Option, +} +impl ClusterCreateRequestValidationParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response of cluster create request validation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterCreateValidationResult { + #[doc = "The validation errors."] + #[serde( + rename = "validationErrors", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub validation_errors: Vec, + #[doc = "The validation warnings."] + #[serde( + rename = "validationWarnings", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub validation_warnings: Vec, + #[doc = "The estimated creation duration."] + #[serde(rename = "estimatedCreationDuration", default, skip_serializing_if = "Option::is_none")] + pub estimated_creation_duration: Option, + #[doc = "The Azure active directory domain service resource details."] + #[serde( + rename = "aaddsResourcesDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub aadds_resources_details: Vec, +} +impl ClusterCreateValidationResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The cluster definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterDefinition { + #[doc = "The link to the blueprint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub blueprint: Option, + #[doc = "The type of cluster."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, + #[doc = "The versions of different services in the cluster."] + #[serde(rename = "componentVersion", default, skip_serializing_if = "Option::is_none")] + pub component_version: Option, + #[doc = "The cluster configurations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configurations: Option, +} +impl ClusterDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Disk Encryption Cluster request parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterDiskEncryptionParameters { + #[doc = "Base key vault URI where the customers key is located eg. https://myvault.vault.azure.net"] + #[serde(rename = "vaultUri", default, skip_serializing_if = "Option::is_none")] + pub vault_uri: Option, + #[doc = "Key name that is used for enabling disk encryption."] + #[serde(rename = "keyName", default, skip_serializing_if = "Option::is_none")] + pub key_name: Option, + #[doc = "Specific key version that is used for enabling disk encryption."] + #[serde(rename = "keyVersion", default, skip_serializing_if = "Option::is_none")] + pub key_version: Option, +} +impl ClusterDiskEncryptionParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ClusterGetProperties { + #[doc = "The version of the cluster."] + #[serde(rename = "clusterVersion", default, skip_serializing_if = "Option::is_none")] + pub cluster_version: Option, + #[doc = "The hdp version of the cluster."] + #[serde(rename = "clusterHdpVersion", default, skip_serializing_if = "Option::is_none")] + pub cluster_hdp_version: Option, + #[doc = "The type of operating system."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "The cluster tier."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, + #[doc = "The cluster id."] + #[serde(rename = "clusterId", default, skip_serializing_if = "Option::is_none")] + pub cluster_id: Option, + #[doc = "The cluster definition."] + #[serde(rename = "clusterDefinition")] + pub cluster_definition: ClusterDefinition, + #[doc = "The kafka rest proxy configuration which contains AAD security group information."] + #[serde(rename = "kafkaRestProperties", default, skip_serializing_if = "Option::is_none")] + pub kafka_rest_properties: Option, + #[doc = "The security profile which contains Ssh public key for the HDInsight cluster."] + #[serde(rename = "securityProfile", default, skip_serializing_if = "Option::is_none")] + pub security_profile: Option, + #[doc = "Describes the compute profile."] + #[serde(rename = "computeProfile", default, skip_serializing_if = "Option::is_none")] + pub compute_profile: Option, + #[doc = "The provisioning state, which only appears in the response."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The date on which the cluster was created."] + #[serde(rename = "createdDate", default, skip_serializing_if = "Option::is_none")] + pub created_date: Option, + #[doc = "The state of the cluster."] + #[serde(rename = "clusterState", default, skip_serializing_if = "Option::is_none")] + pub cluster_state: Option, + #[doc = "The quota properties for the cluster."] + #[serde(rename = "quotaInfo", default, skip_serializing_if = "Option::is_none")] + pub quota_info: Option, + #[doc = "The list of errors."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub errors: Vec, + #[doc = "The list of connectivity endpoints."] + #[serde( + rename = "connectivityEndpoints", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub connectivity_endpoints: Vec, + #[doc = "The disk encryption properties"] + #[serde(rename = "diskEncryptionProperties", default, skip_serializing_if = "Option::is_none")] + pub disk_encryption_properties: Option, + #[doc = "The encryption-in-transit properties."] + #[serde(rename = "encryptionInTransitProperties", default, skip_serializing_if = "Option::is_none")] + pub encryption_in_transit_properties: Option, + #[doc = "The storage profile."] + #[serde(rename = "storageProfile", default, skip_serializing_if = "Option::is_none")] + pub storage_profile: Option, + #[doc = "The minimal supported tls version."] + #[serde(rename = "minSupportedTlsVersion", default, skip_serializing_if = "Option::is_none")] + pub min_supported_tls_version: Option, + #[doc = "The configuration that services will be excluded when creating cluster."] + #[serde(rename = "excludedServicesConfig", default, skip_serializing_if = "Option::is_none")] + pub excluded_services_config: Option, + #[doc = "The network properties."] + #[serde(rename = "networkProperties", default, skip_serializing_if = "Option::is_none")] + pub network_properties: Option, + #[doc = "The compute isolation properties."] + #[serde(rename = "computeIsolationProperties", default, skip_serializing_if = "Option::is_none")] + pub compute_isolation_properties: Option, + #[doc = "The private link configurations."] + #[serde( + rename = "privateLinkConfigurations", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_link_configurations: Vec, + #[doc = "The list of private endpoint connections."] + #[serde( + rename = "privateEndpointConnections", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_endpoint_connections: Vec, +} +impl ClusterGetProperties { + pub fn new(cluster_definition: ClusterDefinition) -> Self { + Self { + cluster_version: None, + cluster_hdp_version: None, + os_type: None, + tier: None, + cluster_id: None, + cluster_definition, + kafka_rest_properties: None, + security_profile: None, + compute_profile: None, + provisioning_state: None, + created_date: None, + cluster_state: None, + quota_info: None, + errors: Vec::new(), + connectivity_endpoints: Vec::new(), + disk_encryption_properties: None, + encryption_in_transit_properties: None, + storage_profile: None, + min_supported_tls_version: None, + excluded_services_config: None, + network_properties: None, + compute_isolation_properties: None, + private_link_configurations: Vec::new(), + private_endpoint_connections: Vec::new(), + } + } +} +pub mod cluster_get_properties { + use super::*; + #[doc = "The type of operating system."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OsType")] + pub enum OsType { + Windows, + Linux, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Windows => serializer.serialize_unit_variant("OsType", 0u32, "Windows"), + Self::Linux => serializer.serialize_unit_variant("OsType", 1u32, "Linux"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The cluster tier."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Tier")] + pub enum Tier { + Standard, + Premium, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Tier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Tier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Tier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Standard => serializer.serialize_unit_variant("Tier", 0u32, "Standard"), + Self::Premium => serializer.serialize_unit_variant("Tier", 1u32, "Premium"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The provisioning state, which only appears in the response."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + InProgress, + Failed, + Succeeded, + Canceled, + Deleting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("ProvisioningState", 0u32, "InProgress"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Canceled"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Deleting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Identity for the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterIdentity { + #[doc = "The principal id of cluster identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant id associated with the cluster. This property will only be provided for a system assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The type of identity used for the cluster. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The list of user identities associated with the cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl ClusterIdentity { + pub fn new() -> Self { + Self::default() + } +} +pub mod cluster_identity { + use super::*; + #[doc = "The type of identity used for the cluster. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + None, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SystemAssigned => serializer.serialize_unit_variant("Type", 0u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("Type", 1u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => serializer.serialize_unit_variant("Type", 2u32, "SystemAssigned, UserAssigned"), + Self::None => serializer.serialize_unit_variant("Type", 3u32, "None"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The ListPersistedScriptActions operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterListPersistedScriptActionsResult { + #[doc = "The list of Persisted Script Actions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl ClusterListPersistedScriptActionsResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Cluster operation response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterListResult { + #[doc = "The list of Clusters."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ClusterListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ClusterListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The cluster monitor parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterMonitoringRequest { + #[doc = "The cluster monitor workspace ID."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The cluster monitor workspace key."] + #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] + pub primary_key: Option, +} +impl ClusterMonitoringRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The cluster monitoring status response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterMonitoringResponse { + #[doc = "The status of the monitor on the HDInsight cluster."] + #[serde(rename = "clusterMonitoringEnabled", default, skip_serializing_if = "Option::is_none")] + pub cluster_monitoring_enabled: Option, + #[doc = "The workspace ID of the monitor on the HDInsight cluster."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, +} +impl ClusterMonitoringResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The PatchCluster request parameters"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterPatchParameters { + #[doc = "The resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl ClusterPatchParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Resize Cluster request parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterResizeParameters { + #[doc = "The target instance count for the operation."] + #[serde(rename = "targetInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub target_instance_count: Option, +} +impl ClusterResizeParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The compute isolation properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeIsolationProperties { + #[doc = "The flag indicates whether enable compute isolation or not."] + #[serde(rename = "enableComputeIsolation", default, skip_serializing_if = "Option::is_none")] + pub enable_compute_isolation: Option, + #[doc = "The host sku."] + #[serde(rename = "hostSku", default, skip_serializing_if = "Option::is_none")] + pub host_sku: Option, +} +impl ComputeIsolationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the compute profile."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComputeProfile { + #[doc = "The list of roles in the cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub roles: Vec, +} +impl ComputeProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The connectivity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectivityEndpoint { + #[doc = "The name of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The protocol of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub protocol: Option, + #[doc = "The location of the endpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "The port to connect to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "The private ip address of the endpoint."] + #[serde(rename = "privateIPAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, +} +impl ConnectivityEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The data disks groups for the role."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DataDisksGroups { + #[doc = "The number of disks per node."] + #[serde(rename = "disksPerNode", default, skip_serializing_if = "Option::is_none")] + pub disks_per_node: Option, + #[doc = "ReadOnly. The storage account type. Do not set this value."] + #[serde(rename = "storageAccountType", default, skip_serializing_if = "Option::is_none")] + pub storage_account_type: Option, + #[doc = "ReadOnly. The DiskSize in GB. Do not set this value."] + #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] + pub disk_size_gb: Option, +} +impl DataDisksGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The definition of Dimension."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Dimension { + #[doc = "The name of the dimension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The display name of the dimension."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The display name of the dimension."] + #[serde(rename = "internalName", default, skip_serializing_if = "Option::is_none")] + pub internal_name: Option, + #[doc = "The flag indicates whether the metric will be exported for shoebox or not."] + #[serde(rename = "toBeExportedForShoebox", default, skip_serializing_if = "Option::is_none")] + pub to_be_exported_for_shoebox: Option, +} +impl Dimension { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The disk billing meters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiskBillingMeters { + #[doc = "The managed disk meter guid."] + #[serde(rename = "diskRpMeter", default, skip_serializing_if = "Option::is_none")] + pub disk_rp_meter: Option, + #[doc = "The managed disk billing sku, P30 or S30."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "The managed disk billing tier, Standard or Premium."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tier: Option, +} +impl DiskBillingMeters { + pub fn new() -> Self { + Self::default() + } +} +pub mod disk_billing_meters { + use super::*; + #[doc = "The managed disk billing tier, Standard or Premium."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Tier")] + pub enum Tier { + Standard, + Premium, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Tier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Tier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Tier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Standard => serializer.serialize_unit_variant("Tier", 0u32, "Standard"), + Self::Premium => serializer.serialize_unit_variant("Tier", 1u32, "Premium"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The disk encryption properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiskEncryptionProperties { + #[doc = "Base key vault URI where the customers key is located eg. https://myvault.vault.azure.net"] + #[serde(rename = "vaultUri", default, skip_serializing_if = "Option::is_none")] + pub vault_uri: Option, + #[doc = "Key name that is used for enabling disk encryption."] + #[serde(rename = "keyName", default, skip_serializing_if = "Option::is_none")] + pub key_name: Option, + #[doc = "Specific key version that is used for enabling disk encryption."] + #[serde(rename = "keyVersion", default, skip_serializing_if = "Option::is_none")] + pub key_version: Option, + #[doc = "Algorithm identifier for encryption, default RSA-OAEP."] + #[serde(rename = "encryptionAlgorithm", default, skip_serializing_if = "Option::is_none")] + pub encryption_algorithm: Option, + #[doc = "Resource ID of Managed Identity that is used to access the key vault."] + #[serde(rename = "msiResourceId", default, skip_serializing_if = "Option::is_none")] + pub msi_resource_id: Option, + #[doc = "Indicates whether or not resource disk encryption is enabled."] + #[serde(rename = "encryptionAtHost", default, skip_serializing_if = "Option::is_none")] + pub encryption_at_host: Option, +} +impl DiskEncryptionProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod disk_encryption_properties { + use super::*; + #[doc = "Algorithm identifier for encryption, default RSA-OAEP."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EncryptionAlgorithm")] + pub enum EncryptionAlgorithm { + #[serde(rename = "RSA-OAEP")] + RsaOaep, + #[serde(rename = "RSA-OAEP-256")] + RsaOaep256, + #[serde(rename = "RSA1_5")] + Rsa15, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EncryptionAlgorithm { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EncryptionAlgorithm { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EncryptionAlgorithm { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::RsaOaep => serializer.serialize_unit_variant("EncryptionAlgorithm", 0u32, "RSA-OAEP"), + Self::RsaOaep256 => serializer.serialize_unit_variant("EncryptionAlgorithm", 1u32, "RSA-OAEP-256"), + Self::Rsa15 => serializer.serialize_unit_variant("EncryptionAlgorithm", 2u32, "RSA1_5"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The encryption-in-transit properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EncryptionInTransitProperties { + #[doc = "Indicates whether or not inter cluster node communication is encrypted in transit."] + #[serde(rename = "isEncryptionInTransitEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_encryption_in_transit_enabled: Option, +} +impl EncryptionInTransitProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the format of Error response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "Error code"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Error message indicating why the operation failed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error message associated with the cluster creation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Errors { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl Errors { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The configuration that services will be excluded when creating cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExcludedServicesConfig { + #[doc = "The config id of excluded services."] + #[serde(rename = "excludedServicesConfigId", default, skip_serializing_if = "Option::is_none")] + pub excluded_services_config_id: Option, + #[doc = "The list of excluded services."] + #[serde(rename = "excludedServicesList", default, skip_serializing_if = "Option::is_none")] + pub excluded_services_list: Option, +} +impl ExcludedServicesConfig { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The parameters for the script actions to execute on a running cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExecuteScriptActionParameters { + #[doc = "The list of run time script actions."] + #[serde( + rename = "scriptActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub script_actions: Vec, + #[doc = "Gets or sets if the scripts needs to be persisted."] + #[serde(rename = "persistOnSuccess")] + pub persist_on_success: bool, +} +impl ExecuteScriptActionParameters { + pub fn new(persist_on_success: bool) -> Self { + Self { + script_actions: Vec::new(), + persist_on_success, + } + } +} +#[doc = "Cluster monitoring extensions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Extension { + #[doc = "The workspace ID for the cluster monitoring extension."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The certificate for the cluster monitoring extensions."] + #[serde(rename = "primaryKey", default, skip_serializing_if = "Option::is_none")] + pub primary_key: Option, +} +impl Extension { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Gateway settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GatewaySettings { + #[doc = "Indicates whether or not the gateway settings based authorization is enabled."] + #[serde(rename = "restAuthCredential.isEnabled", default, skip_serializing_if = "Option::is_none")] + pub rest_auth_credential_is_enabled: Option, + #[doc = "The gateway settings user name."] + #[serde(rename = "restAuthCredential.username", default, skip_serializing_if = "Option::is_none")] + pub rest_auth_credential_username: Option, + #[doc = "The gateway settings user password."] + #[serde(rename = "restAuthCredential.password", default, skip_serializing_if = "Option::is_none")] + pub rest_auth_credential_password: Option, +} +impl GatewaySettings { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The hardware profile."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HardwareProfile { + #[doc = "The size of the VM"] + #[serde(rename = "vmSize", default, skip_serializing_if = "Option::is_none")] + pub vm_size: Option, +} +impl HardwareProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The cluster host information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HostInfo { + #[doc = "The host name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The Fully Qualified Domain Name of host"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fqdn: Option, + #[doc = "The effective disk encryption key URL used by the host"] + #[serde(rename = "effectiveDiskEncryptionKeyUrl", default, skip_serializing_if = "Option::is_none")] + pub effective_disk_encryption_key_url: Option, +} +impl HostInfo { + pub fn new() -> Self { + Self::default() + } +} +pub type HostInfoListResult = Vec; +#[doc = "The ip configurations for the private link service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IpConfiguration { + #[doc = "The private link IP configuration id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of private link IP configuration."] + pub name: String, + #[doc = "The type of the private link IP configuration."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The private link ip configuration properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IpConfiguration { + pub fn new(name: String) -> Self { + Self { + id: None, + name, + type_: None, + properties: None, + } + } +} +#[doc = "The private link ip configuration properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IpConfigurationProperties { + #[doc = "The private link configuration provisioning state, which only appears in the response."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Indicates whether this IP configuration is primary for the corresponding NIC."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primary: Option, + #[doc = "The IP address."] + #[serde(rename = "privateIPAddress", default, skip_serializing_if = "Option::is_none")] + pub private_ip_address: Option, + #[doc = "The method that private IP address is allocated."] + #[serde(rename = "privateIPAllocationMethod", default, skip_serializing_if = "Option::is_none")] + pub private_ip_allocation_method: Option, + #[doc = "The azure resource id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, +} +impl IpConfigurationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod ip_configuration_properties { + use super::*; + #[doc = "The private link configuration provisioning state, which only appears in the response."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + InProgress, + Failed, + Succeeded, + Canceled, + Deleting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("ProvisioningState", 0u32, "InProgress"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Canceled"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Deleting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The method that private IP address is allocated."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PrivateIpAllocationMethod")] + pub enum PrivateIpAllocationMethod { + #[serde(rename = "dynamic")] + Dynamic, + #[serde(rename = "static")] + Static, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PrivateIpAllocationMethod { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PrivateIpAllocationMethod { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PrivateIpAllocationMethod { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Dynamic => serializer.serialize_unit_variant("PrivateIpAllocationMethod", 0u32, "dynamic"), + Self::Static => serializer.serialize_unit_variant("PrivateIpAllocationMethod", 1u32, "static"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The kafka rest proxy configuration which contains AAD security group information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct KafkaRestProperties { + #[doc = "The information of AAD security group."] + #[serde(rename = "clientGroupInfo", default, skip_serializing_if = "Option::is_none")] + pub client_group_info: Option, + #[doc = "The configurations that need to be overriden."] + #[serde(rename = "configurationOverride", default, skip_serializing_if = "Option::is_none")] + pub configuration_override: Option, +} +impl KafkaRestProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The ssh username, password, and ssh public key."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LinuxOperatingSystemProfile { + #[doc = "The username."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The password."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, + #[doc = "The list of SSH public keys."] + #[serde(rename = "sshProfile", default, skip_serializing_if = "Option::is_none")] + pub ssh_profile: Option, +} +impl LinuxOperatingSystemProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The details about the localizable name of a type of usage."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LocalizedName { + #[doc = "The name of the used resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The localized name of the used resource."] + #[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")] + pub localized_value: Option, +} +impl LocalizedName { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The details of metric specifications."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MetricSpecifications { + #[doc = "The name of the metric specification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The display name of the metric specification."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The display description of the metric specification."] + #[serde(rename = "displayDescription", default, skip_serializing_if = "Option::is_none")] + pub display_description: Option, + #[doc = "The unit of the metric specification."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "The aggregation type of the metric specification."] + #[serde(rename = "aggregationType", default, skip_serializing_if = "Option::is_none")] + pub aggregation_type: Option, + #[doc = "The supported aggregation types of the metric specification."] + #[serde( + rename = "supportedAggregationTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_aggregation_types: Vec, + #[doc = "The supported time grain types of the metric specification."] + #[serde( + rename = "supportedTimeGrainTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_time_grain_types: Vec, + #[doc = "The flag indicates whether enable regional mdm account or not."] + #[serde(rename = "enableRegionalMdmAccount", default, skip_serializing_if = "Option::is_none")] + pub enable_regional_mdm_account: Option, + #[doc = "The source mdm account."] + #[serde(rename = "sourceMdmAccount", default, skip_serializing_if = "Option::is_none")] + pub source_mdm_account: Option, + #[doc = "The source mdm namespace."] + #[serde(rename = "sourceMdmNamespace", default, skip_serializing_if = "Option::is_none")] + pub source_mdm_namespace: Option, + #[doc = "The metric filter pattern."] + #[serde(rename = "metricFilterPattern", default, skip_serializing_if = "Option::is_none")] + pub metric_filter_pattern: Option, + #[doc = "The flag indicates whether filling gap with zero."] + #[serde(rename = "fillGapWithZero", default, skip_serializing_if = "Option::is_none")] + pub fill_gap_with_zero: Option, + #[doc = "The category of the metric."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The override name of resource id dimension name."] + #[serde(rename = "resourceIdDimensionNameOverride", default, skip_serializing_if = "Option::is_none")] + pub resource_id_dimension_name_override: Option, + #[doc = "The flag indicates whether the metric is internal or not."] + #[serde(rename = "isInternal", default, skip_serializing_if = "Option::is_none")] + pub is_internal: Option, + #[doc = "The override name of delegate metric."] + #[serde(rename = "delegateMetricNameOverride", default, skip_serializing_if = "Option::is_none")] + pub delegate_metric_name_override: Option, + #[doc = "The dimensions of the metric specification."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dimensions: Vec, +} +impl MetricSpecifications { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The request spec of checking name availability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NameAvailabilityCheckRequestParameters { + #[doc = "The resource name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl NameAvailabilityCheckRequestParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response spec of checking name availability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NameAvailabilityCheckResult { + #[doc = "This indicates whether the name is available."] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "The reason of the result."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "The related message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl NameAvailabilityCheckResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The network properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkProperties { + #[doc = "The direction for the resource provider connection."] + #[serde(rename = "resourceProviderConnection", default, skip_serializing_if = "Option::is_none")] + pub resource_provider_connection: Option, + #[doc = "Indicates whether or not private link is enabled."] + #[serde(rename = "privateLink", default, skip_serializing_if = "Option::is_none")] + pub private_link: Option, +} +impl NetworkProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod network_properties { + use super::*; + #[doc = "The direction for the resource provider connection."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ResourceProviderConnection")] + pub enum ResourceProviderConnection { + Inbound, + Outbound, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ResourceProviderConnection { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ResourceProviderConnection { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ResourceProviderConnection { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Inbound => serializer.serialize_unit_variant("ResourceProviderConnection", 0u32, "Inbound"), + Self::Outbound => serializer.serialize_unit_variant("ResourceProviderConnection", 1u32, "Outbound"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates whether or not private link is enabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PrivateLink")] + pub enum PrivateLink { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PrivateLink { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PrivateLink { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PrivateLink { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("PrivateLink", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("PrivateLink", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The HDInsight REST API operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The operation name: {provider}/{resource}/{operation}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The object that represents the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The details of operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The object that represents the operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationDisplay { + #[doc = "The service provider: Microsoft.HDInsight"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The resource on which the operation is performed: Cluster, Applications, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The operation type: read, write, delete, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "Localized friendly description for the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl OperationDisplay { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Result of the request to list HDInsight operations. It contains a list of operations and a URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "The list of HDInsight operations supported by the HDInsight resource provider."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of operation list results if there are any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The details of operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationProperties { + #[doc = "The specification of the service."] + #[serde(rename = "serviceSpecification", default, skip_serializing_if = "Option::is_none")] + pub service_specification: Option, +} +impl OperationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Linux operation systems profile."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OsProfile { + #[doc = "The ssh username, password, and ssh public key."] + #[serde(rename = "linuxOperatingSystemProfile", default, skip_serializing_if = "Option::is_none")] + pub linux_operating_system_profile: Option, +} +impl OsProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The private endpoint."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpoint { + #[doc = "The private endpoint id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl PrivateEndpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The private endpoint connection."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnection { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The private endpoint connection properties."] + pub properties: PrivateEndpointConnectionProperties, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PrivateEndpointConnection { + pub fn new(properties: PrivateEndpointConnectionProperties) -> Self { + Self { + resource: Resource::default(), + properties, + system_data: None, + } + } +} +#[doc = "The list private endpoint connections response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateEndpointConnectionListResult { + #[doc = "The list of private endpoint connections."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PrivateEndpointConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PrivateEndpointConnectionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The private endpoint connection properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateEndpointConnectionProperties { + #[doc = "The private endpoint."] + #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] + pub private_endpoint: Option, + #[doc = "The private link service connection state."] + #[serde(rename = "privateLinkServiceConnectionState")] + pub private_link_service_connection_state: PrivateLinkServiceConnectionState, + #[doc = "The link identifier."] + #[serde(rename = "linkIdentifier", default, skip_serializing_if = "Option::is_none")] + pub link_identifier: Option, + #[doc = "The provisioning state, which only appears in the response."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl PrivateEndpointConnectionProperties { + pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self { + Self { + private_endpoint: None, + private_link_service_connection_state, + link_identifier: None, + provisioning_state: None, + } + } +} +pub mod private_endpoint_connection_properties { + use super::*; + #[doc = "The provisioning state, which only appears in the response."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + InProgress, + Updating, + Failed, + Succeeded, + Canceled, + Deleting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("ProvisioningState", 0u32, "InProgress"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Deleting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The private link configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateLinkConfiguration { + #[doc = "The private link configuration id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of private link configuration."] + pub name: String, + #[doc = "The type of the private link configuration."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The private link configuration properties."] + pub properties: PrivateLinkConfigurationProperties, +} +impl PrivateLinkConfiguration { + pub fn new(name: String, properties: PrivateLinkConfigurationProperties) -> Self { + Self { + id: None, + name, + type_: None, + properties, + } + } +} +#[doc = "The private link configuration properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateLinkConfigurationProperties { + #[doc = "The HDInsight private linkable sub-resource name to apply the private link configuration to. For example, 'headnode', 'gateway', 'edgenode'."] + #[serde(rename = "groupId")] + pub group_id: String, + #[doc = "The private link configuration provisioning state, which only appears in the response."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The IP configurations for the private link service."] + #[serde(rename = "ipConfigurations")] + pub ip_configurations: Vec, +} +impl PrivateLinkConfigurationProperties { + pub fn new(group_id: String, ip_configurations: Vec) -> Self { + Self { + group_id, + provisioning_state: None, + ip_configurations, + } + } +} +pub mod private_link_configuration_properties { + use super::*; + #[doc = "The private link configuration provisioning state, which only appears in the response."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + InProgress, + Failed, + Succeeded, + Canceled, + Deleting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("ProvisioningState", 0u32, "InProgress"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Succeeded"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Canceled"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Deleting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A private link resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of a private link resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl PrivateLinkResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of private link resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceListResult { + #[doc = "Array of private link resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl PrivateLinkResourceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of a private link resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PrivateLinkResourceProperties { + #[doc = "The private link resource group id."] + #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, + #[doc = "The private link resource required member names."] + #[serde( + rename = "requiredMembers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_members: Vec, + #[doc = "The private link resource Private link DNS zone name."] + #[serde( + rename = "requiredZoneNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_zone_names: Vec, +} +impl PrivateLinkResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The private link service connection state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PrivateLinkServiceConnectionState { + #[doc = "The concrete private link service connection."] + pub status: private_link_service_connection_state::Status, + #[doc = "The optional description of the status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Whether there is further actions."] + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, +} +impl PrivateLinkServiceConnectionState { + pub fn new(status: private_link_service_connection_state::Status) -> Self { + Self { + status, + description: None, + actions_required: None, + } + } +} +pub mod private_link_service_connection_state { + use super::*; + #[doc = "The concrete private link service connection."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Approved, + Rejected, + Pending, + Removed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Approved => serializer.serialize_unit_variant("Status", 0u32, "Approved"), + Self::Rejected => serializer.serialize_unit_variant("Status", 1u32, "Rejected"), + Self::Pending => serializer.serialize_unit_variant("Status", 2u32, "Pending"), + Self::Removed => serializer.serialize_unit_variant("Status", 3u32, "Removed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The regional quota capability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaCapability { + #[doc = "The number of cores used in the subscription."] + #[serde(rename = "coresUsed", default, skip_serializing_if = "Option::is_none")] + pub cores_used: Option, + #[doc = "The number of cores that the subscription allowed."] + #[serde(rename = "maxCoresAllowed", default, skip_serializing_if = "Option::is_none")] + pub max_cores_allowed: Option, + #[doc = "The list of region quota capabilities."] + #[serde( + rename = "regionalQuotas", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub regional_quotas: Vec, +} +impl QuotaCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The quota properties for the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QuotaInfo { + #[doc = "The cores used by the cluster."] + #[serde(rename = "coresUsed", default, skip_serializing_if = "Option::is_none")] + pub cores_used: Option, +} +impl QuotaInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The regional quota capacity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegionalQuotaCapability { + #[doc = "The region name."] + #[serde(rename = "regionName", default, skip_serializing_if = "Option::is_none")] + pub region_name: Option, + #[doc = "The number of cores used in the region."] + #[serde(rename = "coresUsed", default, skip_serializing_if = "Option::is_none")] + pub cores_used: Option, + #[doc = "The number of cores available in the region."] + #[serde(rename = "coresAvailable", default, skip_serializing_if = "Option::is_none")] + pub cores_available: Option, +} +impl RegionalQuotaCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The regions capability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegionsCapability { + #[doc = "The list of region capabilities."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub available: Vec, +} +impl RegionsCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The azure resource id."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceId { + #[doc = "The azure resource id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ResourceId { + pub fn new() -> Self { + Self::default() + } +} +pub type RestartHostsParameters = Vec; +#[doc = "Describes a role on the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Role { + #[doc = "The name of the role."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The minimum instance count of the cluster."] + #[serde(rename = "minInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub min_instance_count: Option, + #[doc = "The instance count of the cluster."] + #[serde(rename = "targetInstanceCount", default, skip_serializing_if = "Option::is_none")] + pub target_instance_count: Option, + #[doc = "The name of the virtual machine group."] + #[serde(rename = "VMGroupName", default, skip_serializing_if = "Option::is_none")] + pub vm_group_name: Option, + #[doc = "The autoscale request parameters"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub autoscale: Option, + #[doc = "The hardware profile."] + #[serde(rename = "hardwareProfile", default, skip_serializing_if = "Option::is_none")] + pub hardware_profile: Option, + #[doc = "The Linux operation systems profile."] + #[serde(rename = "osProfile", default, skip_serializing_if = "Option::is_none")] + pub os_profile: Option, + #[doc = "The virtual network properties."] + #[serde(rename = "virtualNetworkProfile", default, skip_serializing_if = "Option::is_none")] + pub virtual_network_profile: Option, + #[doc = "The data disks groups for the role."] + #[serde( + rename = "dataDisksGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub data_disks_groups: Vec, + #[doc = "The list of script actions on the role."] + #[serde( + rename = "scriptActions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub script_actions: Vec, + #[doc = "Indicates whether encrypt the data disks."] + #[serde(rename = "encryptDataDisks", default, skip_serializing_if = "Option::is_none")] + pub encrypt_data_disks: Option, +} +impl Role { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes a script action on a running cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuntimeScriptAction { + #[doc = "The name of the script action."] + pub name: String, + #[doc = "The URI to the script."] + pub uri: String, + #[doc = "The parameters for the script"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option, + #[doc = "The list of roles where script will be executed."] + pub roles: Vec, + #[doc = "The application name of the script action, if any."] + #[serde(rename = "applicationName", default, skip_serializing_if = "Option::is_none")] + pub application_name: Option, +} +impl RuntimeScriptAction { + pub fn new(name: String, uri: String, roles: Vec) -> Self { + Self { + name, + uri, + parameters: None, + roles, + application_name: None, + } + } +} +#[doc = "The execution details of a script action."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuntimeScriptActionDetail { + #[serde(flatten)] + pub runtime_script_action: RuntimeScriptAction, + #[doc = "The execution id of the script action."] + #[serde(rename = "scriptExecutionId", default, skip_serializing_if = "Option::is_none")] + pub script_execution_id: Option, + #[doc = "The start time of script action execution."] + #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The end time of script action execution."] + #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The current execution status of the script action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason why the script action was executed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The summary of script action execution result."] + #[serde( + rename = "executionSummary", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub execution_summary: Vec, + #[doc = "The script action execution debug information."] + #[serde(rename = "debugInformation", default, skip_serializing_if = "Option::is_none")] + pub debug_information: Option, +} +impl RuntimeScriptActionDetail { + pub fn new(runtime_script_action: RuntimeScriptAction) -> Self { + Self { + runtime_script_action, + script_execution_id: None, + start_time: None, + end_time: None, + status: None, + operation: None, + execution_summary: Vec::new(), + debug_information: None, + } + } +} +#[doc = "Describes a script action on role on the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScriptAction { + #[doc = "The name of the script action."] + pub name: String, + #[doc = "The URI to the script."] + pub uri: String, + #[doc = "The parameters for the script provided."] + pub parameters: String, +} +impl ScriptAction { + pub fn new(name: String, uri: String, parameters: String) -> Self { + Self { name, uri, parameters } + } +} +#[doc = "The list script execution history response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptActionExecutionHistoryList { + #[doc = "The list of persisted script action details for the cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ScriptActionExecutionHistoryList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ScriptActionExecutionHistoryList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The execution summary of a script action."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptActionExecutionSummary { + #[doc = "The status of script action execution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The instance count for a given script action execution status."] + #[serde(rename = "instanceCount", default, skip_serializing_if = "Option::is_none")] + pub instance_count: Option, +} +impl ScriptActionExecutionSummary { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The persisted script action for cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptActionPersistedGetResponseSpec { + #[doc = "The name of script action."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The URI to the script."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, + #[doc = "The parameters for the script provided."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parameters: Option, + #[doc = "The list of roles where script will be executed."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub roles: Vec, + #[doc = "The application name for the script action."] + #[serde(rename = "applicationName", default, skip_serializing_if = "Option::is_none")] + pub application_name: Option, +} +impl ScriptActionPersistedGetResponseSpec { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The persisted script action for the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScriptActionsList { + #[doc = "The list of persisted script action details for the cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link (url) to the next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ScriptActionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ScriptActionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The security profile which contains Ssh public key for the HDInsight cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityProfile { + #[doc = "The directory type."] + #[serde(rename = "directoryType", default, skip_serializing_if = "Option::is_none")] + pub directory_type: Option, + #[doc = "The organization's active directory domain."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub domain: Option, + #[doc = "The organizational unit within the Active Directory to place the cluster and service accounts."] + #[serde(rename = "organizationalUnitDN", default, skip_serializing_if = "Option::is_none")] + pub organizational_unit_dn: Option, + #[doc = "The LDAPS protocol URLs to communicate with the Active Directory."] + #[serde( + rename = "ldapsUrls", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ldaps_urls: Vec, + #[doc = "The domain user account that will have admin privileges on the cluster."] + #[serde(rename = "domainUsername", default, skip_serializing_if = "Option::is_none")] + pub domain_username: Option, + #[doc = "The domain admin password."] + #[serde(rename = "domainUserPassword", default, skip_serializing_if = "Option::is_none")] + pub domain_user_password: Option, + #[doc = "Optional. The Distinguished Names for cluster user groups"] + #[serde( + rename = "clusterUsersGroupDNs", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cluster_users_group_d_ns: Vec, + #[doc = "The resource ID of the user's Azure Active Directory Domain Service."] + #[serde(rename = "aaddsResourceId", default, skip_serializing_if = "Option::is_none")] + pub aadds_resource_id: Option, + #[doc = "User assigned identity that has permissions to read and create cluster-related artifacts in the user's AADDS."] + #[serde(rename = "msiResourceId", default, skip_serializing_if = "Option::is_none")] + pub msi_resource_id: Option, +} +impl SecurityProfile { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_profile { + use super::*; + #[doc = "The directory type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DirectoryType")] + pub enum DirectoryType { + ActiveDirectory, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DirectoryType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DirectoryType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DirectoryType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ActiveDirectory => serializer.serialize_unit_variant("DirectoryType", 0u32, "ActiveDirectory"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The specification of the service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceSpecification { + #[doc = "The metric specifications."] + #[serde( + rename = "metricSpecifications", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub metric_specifications: Vec, +} +impl ServiceSpecification { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The list of SSH public keys."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SshProfile { + #[doc = "The list of SSH public keys."] + #[serde( + rename = "publicKeys", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub public_keys: Vec, +} +impl SshProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The SSH public key for the cluster nodes."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SshPublicKey { + #[doc = "The certificate for SSH."] + #[serde(rename = "certificateData", default, skip_serializing_if = "Option::is_none")] + pub certificate_data: Option, +} +impl SshPublicKey { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The storage Account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageAccount { + #[doc = "The name of the storage account."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether or not the storage account is the default storage account."] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option, + #[doc = "The container in the storage account, only to be specified for WASB storage accounts."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub container: Option, + #[doc = "The filesystem, only to be specified for Azure Data Lake Storage Gen 2."] + #[serde(rename = "fileSystem", default, skip_serializing_if = "Option::is_none")] + pub file_system: Option, + #[doc = "The storage account access key."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + #[doc = "The resource ID of storage account, only to be specified for Azure Data Lake Storage Gen 2."] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The managed identity (MSI) that is allowed to access the storage account, only to be specified for Azure Data Lake Storage Gen 2."] + #[serde(rename = "msiResourceId", default, skip_serializing_if = "Option::is_none")] + pub msi_resource_id: Option, + #[doc = "The shared access signature key."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub saskey: Option, + #[doc = "The file share name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fileshare: Option, + #[doc = "Enable secure channel or not, it's an optional field. Default value is false when cluster version < 5.1 and true when cluster version >= 5.1 , "] + #[serde(rename = "enableSecureChannel", default, skip_serializing_if = "Option::is_none")] + pub enable_secure_channel: Option, +} +impl StorageAccount { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The storage profile."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageProfile { + #[doc = "The list of storage accounts in the cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub storageaccounts: Vec, +} +impl StorageProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "The update cluster identity certificate request parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateClusterIdentityCertificateParameters { + #[doc = "The application id."] + #[serde(rename = "applicationId", default, skip_serializing_if = "Option::is_none")] + pub application_id: Option, + #[doc = "The certificate in base64 encoded format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub certificate: Option, + #[doc = "The password of the certificate."] + #[serde(rename = "certificatePassword", default, skip_serializing_if = "Option::is_none")] + pub certificate_password: Option, +} +impl UpdateClusterIdentityCertificateParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The update gateway settings request parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateGatewaySettingsParameters { + #[doc = "Indicates whether or not the gateway settings based authorization is enabled."] + #[serde(rename = "restAuthCredential.isEnabled", default, skip_serializing_if = "Option::is_none")] + pub rest_auth_credential_is_enabled: Option, + #[doc = "The gateway settings user name."] + #[serde(rename = "restAuthCredential.username", default, skip_serializing_if = "Option::is_none")] + pub rest_auth_credential_username: Option, + #[doc = "The gateway settings user password."] + #[serde(rename = "restAuthCredential.password", default, skip_serializing_if = "Option::is_none")] + pub rest_auth_credential_password: Option, +} +impl UpdateGatewaySettingsParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The details about the usage of a particular limited resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Usage { + #[doc = "The type of measurement for usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "The current usage."] + #[serde(rename = "currentValue", default, skip_serializing_if = "Option::is_none")] + pub current_value: Option, + #[doc = "The maximum allowed usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[doc = "The details about the localizable name of a type of usage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl Usage { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The response for the operation to get regional usages for a subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UsagesListResult { + #[doc = "The list of usages."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl UsagesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The User Assigned Identity"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal id of user assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client id of user assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[doc = "The tenant id of user assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The validation error information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ValidationErrorInfo { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error resource."] + #[serde(rename = "errorResource", default, skip_serializing_if = "Option::is_none")] + pub error_resource: Option, + #[doc = "The message arguments"] + #[serde( + rename = "messageArguments", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub message_arguments: Vec, +} +impl ValidationErrorInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The version properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VersionSpec { + #[doc = "The friendly name"] + #[serde(rename = "friendlyName", default, skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[doc = "The display name"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Whether or not the version is the default version."] + #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")] + pub is_default: Option, + #[doc = "The component version property."] + #[serde(rename = "componentVersions", default, skip_serializing_if = "Option::is_none")] + pub component_versions: Option, +} +impl VersionSpec { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The version capability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VersionsCapability { + #[doc = "The list of version capabilities."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub available: Vec, +} +impl VersionsCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The virtual network properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualNetworkProfile { + #[doc = "The ID of the virtual network."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the subnet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, +} +impl VirtualNetworkProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "This class represent a single filter object that defines a multidimensional set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and ClusterVersions. The constraint should be defined based on the following: FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of exclusion/inclusion) and the ordering of the Filters. Later filters override previous settings if conflicted."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VmSizeCompatibilityFilterV2 { + #[doc = "The filtering mode. Effectively this can enabling or disabling the VM sizes in a particular set."] + #[serde(rename = "filterMode", default, skip_serializing_if = "Option::is_none")] + pub filter_mode: Option, + #[doc = "The list of regions under the effect of the filter."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub regions: Vec, + #[doc = "The list of cluster flavors under the effect of the filter."] + #[serde( + rename = "clusterFlavors", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cluster_flavors: Vec, + #[doc = "The list of node types affected by the filter."] + #[serde( + rename = "nodeTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub node_types: Vec, + #[doc = "The list of cluster versions affected in Major.Minor format."] + #[serde( + rename = "clusterVersions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cluster_versions: Vec, + #[doc = "The OSType affected, Windows or Linux."] + #[serde( + rename = "osType", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub os_type: Vec, + #[doc = "The list of virtual machine sizes to include or exclude."] + #[serde( + rename = "vmSizes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vm_sizes: Vec, + #[doc = "Whether apply for ESP cluster. 'true' means only for ESP, 'false' means only for non-ESP, null or empty string or others mean for both."] + #[serde(rename = "espApplied", default, skip_serializing_if = "Option::is_none")] + pub esp_applied: Option, + #[doc = "Whether support compute isolation. 'true' means only for ComputeIsolationEnabled, 'false' means only for regular cluster."] + #[serde(rename = "computeIsolationSupported", default, skip_serializing_if = "Option::is_none")] + pub compute_isolation_supported: Option, +} +impl VmSizeCompatibilityFilterV2 { + pub fn new() -> Self { + Self::default() + } +} +pub mod vm_size_compatibility_filter_v2 { + use super::*; + #[doc = "The filtering mode. Effectively this can enabling or disabling the VM sizes in a particular set."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "FilterMode")] + pub enum FilterMode { + Exclude, + Include, + Recommend, + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for FilterMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for FilterMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for FilterMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Exclude => serializer.serialize_unit_variant("FilterMode", 0u32, "Exclude"), + Self::Include => serializer.serialize_unit_variant("FilterMode", 1u32, "Include"), + Self::Recommend => serializer.serialize_unit_variant("FilterMode", 2u32, "Recommend"), + Self::Default => serializer.serialize_unit_variant("FilterMode", 3u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The vm size property"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VmSizeProperty { + #[doc = "The vm size name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The number of cores that the vm size has."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cores: Option, + #[doc = "The data disk storage tier of the vm size."] + #[serde(rename = "dataDiskStorageTier", default, skip_serializing_if = "Option::is_none")] + pub data_disk_storage_tier: Option, + #[doc = "The label of the vm size."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[doc = "The max data disk count of the vm size."] + #[serde(rename = "maxDataDiskCount", default, skip_serializing_if = "Option::is_none")] + pub max_data_disk_count: Option, + #[doc = "The memory whose unit is MB of the vm size."] + #[serde(rename = "memoryInMb", default, skip_serializing_if = "Option::is_none")] + pub memory_in_mb: Option, + #[doc = "This indicates this vm size is supported by virtual machines or not"] + #[serde(rename = "supportedByVirtualMachines", default, skip_serializing_if = "Option::is_none")] + pub supported_by_virtual_machines: Option, + #[doc = "The indicates this vm size is supported by web worker roles or not"] + #[serde(rename = "supportedByWebWorkerRoles", default, skip_serializing_if = "Option::is_none")] + pub supported_by_web_worker_roles: Option, + #[doc = "The virtual machine resource disk size whose unit is MB of the vm size."] + #[serde(rename = "virtualMachineResourceDiskSizeInMb", default, skip_serializing_if = "Option::is_none")] + pub virtual_machine_resource_disk_size_in_mb: Option, + #[doc = "The web worker resource disk size whose unit is MB of the vm size."] + #[serde(rename = "webWorkerResourceDiskSizeInMb", default, skip_serializing_if = "Option::is_none")] + pub web_worker_resource_disk_size_in_mb: Option, +} +impl VmSizeProperty { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/help/Cargo.toml b/services/mgmt/help/Cargo.toml index 3436136365..bd6880aeef 100644 --- a/services/mgmt/help/Cargo.toml +++ b/services/mgmt/help/Cargo.toml @@ -32,8 +32,9 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2023-01-01-preview", "enable_reqwest"] +default = ["package-2023-06-01", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-2023-06-01" = [] "package-2023-01-01-preview" = [] \ No newline at end of file diff --git a/services/mgmt/help/README.md b/services/mgmt/help/README.md index 97d78773c4..4037f9790a 100644 --- a/services/mgmt/help/README.md +++ b/services/mgmt/help/README.md @@ -6,8 +6,9 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/help/resou To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2023-01-01-preview`. +The default tag is `package-2023-06-01`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-2023-06-01` has 5 operations from 1 API versions: `2023-06-01`. Use crate feature `package-2023-06-01` to enable. The operations will be in the `package_2023_06_01` module. - `package-2023-01-01-preview` has 5 operations from 1 API versions: `2023-01-01-preview`. Use crate feature `package-2023-01-01-preview` to enable. The operations will be in the `package_2023_01_01_preview` module. \ No newline at end of file diff --git a/services/mgmt/help/src/lib.rs b/services/mgmt/help/src/lib.rs index e1cadb226e..754f2eac0e 100644 --- a/services/mgmt/help/src/lib.rs +++ b/services/mgmt/help/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-06-01")] +pub mod package_2023_06_01; +#[cfg(all(feature = "package-2023-06-01", not(feature = "no-default-tag")))] +pub use package_2023_06_01::*; #[cfg(feature = "package-2023-01-01-preview")] pub mod package_2023_01_01_preview; #[cfg(all(feature = "package-2023-01-01-preview", not(feature = "no-default-tag")))] diff --git a/services/mgmt/help/src/package_2023_01_01_preview/mod.rs b/services/mgmt/help/src/package_2023_01_01_preview/mod.rs index c5e9653900..f7d203400c 100644 --- a/services/mgmt/help/src/package_2023_01_01_preview/mod.rs +++ b/services/mgmt/help/src/package_2023_01_01_preview/mod.rs @@ -568,7 +568,7 @@ pub mod discovery_solution { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Solutions Discovery is the initial point of entry within Help API, which helps you identify the relevant solutions for your Azure issue.

You can discover solutions using resourceUri OR resourceUri + problemClassificationId.

We will do our best in returning relevant diagnostics for your Azure issue.

Get the problemClassificationId(s) using this [reference](https://learn.microsoft.com/en-us/rest/api/support/problem-classifications/list?tabs=HTTP).

Note: ‘requiredParameterSets’ from Solutions Discovery API response must be passed via ‘additionalParameters’ as an input to Diagnostics API."] + #[doc = "Solutions Discovery is the initial point of entry within Help API, which helps you identify the relevant solutions for your Azure issue.

You can discover solutions using resourceUri OR resourceUri + problemClassificationId.

We will do our best in returning relevant diagnostics for your Azure issue.

Get the problemClassificationId(s) using this [reference](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP).

Note: ‘requiredParameterSets’ from Solutions Discovery API response must be passed via ‘additionalParameters’ as an input to Diagnostics API."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `scope`: This is an extension resource provider and only resource level extension is supported at the moment."] diff --git a/services/mgmt/help/src/package_2023_01_01_preview/models.rs b/services/mgmt/help/src/package_2023_01_01_preview/models.rs index 61823aa9be..e65c2ebbc0 100644 --- a/services/mgmt/help/src/package_2023_01_01_preview/models.rs +++ b/services/mgmt/help/src/package_2023_01_01_preview/models.rs @@ -218,7 +218,7 @@ pub struct DiscoveryResponse { deserialize_with = "azure_core::util::deserialize_null_as_default", skip_serializing_if = "Vec::is_empty" )] - pub value: Vec, + pub value: Vec, #[doc = "The link used to get the next page of solution metadata."] #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, @@ -572,7 +572,7 @@ impl Resource { } #[doc = "Diagnostic solution metadata."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SolutionMetadata { +pub struct SolutionMetadataProperties { #[doc = "Solution Id."] #[serde(rename = "solutionId", default, skip_serializing_if = "Option::is_none")] pub solution_id: Option, @@ -591,7 +591,21 @@ pub struct SolutionMetadata { )] pub required_parameter_sets: Vec>, } -impl SolutionMetadata { +impl SolutionMetadataProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Solution Metadata resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SolutionMetadataResource { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Diagnostic solution metadata."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SolutionMetadataResource { pub fn new() -> Self { Self::default() } diff --git a/services/mgmt/security/src/package_preview_2022_07/mod.rs b/services/mgmt/help/src/package_2023_06_01/mod.rs similarity index 55% rename from services/mgmt/security/src/package_preview_2022_07/mod.rs rename to services/mgmt/help/src/package_2023_06_01/mod.rs index 9ddd979d6e..b1bbcfca50 100644 --- a/services/mgmt/security/src/package_preview_2022_07/mod.rs +++ b/services/mgmt/help/src/package_2023_06_01/mod.rs @@ -103,41 +103,32 @@ impl Client { pipeline, } } - pub fn application_client(&self) -> application::Client { - application::Client(self.clone()) + pub fn diagnostics_client(&self) -> diagnostics::Client { + diagnostics::Client(self.clone()) } - pub fn applications_client(&self) -> applications::Client { - applications::Client(self.clone()) + pub fn discovery_solution_client(&self) -> discovery_solution::Client { + discovery_solution::Client(self.clone()) } - pub fn security_connector_application_client(&self) -> security_connector_application::Client { - security_connector_application::Client(self.clone()) - } - pub fn security_connector_applications_client(&self) -> security_connector_applications::Client { - security_connector_applications::Client(self.clone()) + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) } } -pub mod applications { +pub mod operations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get a list of all relevant applications over a subscription level scope"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } + #[doc = "Returns list of operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } } } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApplicationsList = serde_json::from_slice(&bytes)?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -174,18 +165,13 @@ pub mod applications { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/applications", - this.client.endpoint(), - &this.subscription_id - ))?; + let mut url = azure_core::Url::parse(&format!("{}/providers/Microsoft.Help/operations", this.client.endpoint(),))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -202,7 +188,7 @@ pub mod applications { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -218,7 +204,7 @@ pub mod applications { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -239,61 +225,54 @@ pub mod applications { } } } -pub mod application { +pub mod diagnostics { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get a specific application for the requested scope by applicationId"] + #[doc = "This API is used to check the uniqueness of a resource name used for a diagnostic check."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `application_id`: The security Application key - unique key for the standard application"] - pub fn get(&self, subscription_id: impl Into, application_id: impl Into) -> get::RequestBuilder { - get::RequestBuilder { + #[doc = "* `scope`: This is an extension resource provider and only resource level extension is supported at the moment."] + pub fn check_name_availability(&self, scope: impl Into) -> check_name_availability::RequestBuilder { + check_name_availability::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), - application_id: application_id.into(), + scope: scope.into(), + check_name_availability_request: None, } } - #[doc = "Creates or update a security application on the given subscription."] + #[doc = "Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `application_id`: The security Application key - unique key for the standard application"] - #[doc = "* `application`: Application over a subscription scope"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - application_id: impl Into, - application: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + #[doc = "* `scope`: This is an extension resource provider and only resource level extension is supported at the moment."] + #[doc = "* `diagnostics_resource_name`: Unique resource name for insight resources"] + pub fn get(&self, scope: impl Into, diagnostics_resource_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), - application_id: application_id.into(), - application: application.into(), + scope: scope.into(), + diagnostics_resource_name: diagnostics_resource_name.into(), } } - #[doc = "Delete an Application over a given scope"] + #[doc = "Diagnostics tells you precisely the root cause of the issue and how to address it. You can get diagnostics once you discover and identify the relevant solution for your Azure issue.

You can create diagnostics using the ‘solutionId’ from Solution Discovery API response and ‘additionalParameters’

Note: ‘requiredParameterSets’ from Solutions Discovery API response must be passed via ‘additionalParameters’ as an input to Diagnostics API"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `application_id`: The security Application key - unique key for the standard application"] - pub fn delete(&self, subscription_id: impl Into, application_id: impl Into) -> delete::RequestBuilder { - delete::RequestBuilder { + #[doc = "* `scope`: This is an extension resource provider and only resource level extension is supported at the moment."] + #[doc = "* `diagnostics_resource_name`: Unique resource name for insight resources"] + pub fn create(&self, scope: impl Into, diagnostics_resource_name: impl Into) -> create::RequestBuilder { + create::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), - application_id: application_id.into(), + scope: scope.into(), + diagnostics_resource_name: diagnostics_resource_name.into(), + diagnostic_resource_request: None, } } } - pub mod get { + pub mod check_name_availability { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Application = serde_json::from_slice(&bytes)?; + let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -330,10 +309,18 @@ pub mod application { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) application_id: String, + pub(crate) scope: String, + pub(crate) check_name_availability_request: Option, } impl RequestBuilder { + #[doc = "The required parameters for availability check."] + pub fn check_name_availability_request( + mut self, + check_name_availability_request: impl Into, + ) -> Self { + self.check_name_availability_request = Some(check_name_availability_request.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -343,12 +330,11 @@ pub mod application { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/applications/{}", + "{}/{}/providers/Microsoft.Help/checkNameAvailability", this.client.endpoint(), - &this.subscription_id, - &this.application_id + &this.scope ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -357,8 +343,13 @@ pub mod application { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); + let req_body = if let Some(check_name_availability_request) = &this.check_name_availability_request { + req.insert_header("content-type", "application/json"); + azure_core::to_json(check_name_availability_request)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -366,8 +357,8 @@ pub mod application { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -378,13 +369,13 @@ pub mod application { } } } - pub mod create_or_update { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Application = serde_json::from_slice(&bytes)?; + let body: models::DiagnosticResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -421,9 +412,8 @@ pub mod application { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) application_id: String, - pub(crate) application: models::Application, + pub(crate) scope: String, + pub(crate) diagnostics_resource_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -435,12 +425,12 @@ pub mod application { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/applications/{}", + "{}/{}/providers/Microsoft.Help/diagnostics/{}", this.client.endpoint(), - &this.subscription_id, - &this.application_id + &this.scope, + &this.diagnostics_resource_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -449,9 +439,8 @@ pub mod application { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.application)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -459,8 +448,8 @@ pub mod application { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -471,9 +460,32 @@ pub mod application { } } } - pub mod delete { + pub mod create { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiagnosticResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -491,10 +503,17 @@ pub mod application { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) application_id: String, + pub(crate) scope: String, + pub(crate) diagnostics_resource_name: String, + pub(crate) diagnostic_resource_request: Option, } impl RequestBuilder { + #[doc = "The required request body for this insightResource invocation."] + pub fn diagnostic_resource_request(mut self, diagnostic_resource_request: impl Into) -> Self { + self.diagnostic_resource_request = Some(diagnostic_resource_request.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -504,12 +523,12 @@ pub mod application { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/applications/{}", + "{}/{}/providers/Microsoft.Help/diagnostics/{}", this.client.endpoint(), - &this.subscription_id, - &this.application_id + &this.scope, + &this.diagnostics_resource_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -518,37 +537,47 @@ pub mod application { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); + let req_body = if let Some(diagnostic_resource_request) = &this.diagnostic_resource_request { + req.insert_header("content-type", "application/json"); + azure_core::to_json(diagnostic_resource_request)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod security_connector_applications { +pub mod discovery_solution { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get a list of all relevant applications over a security connector level scope"] + #[doc = "Solutions Discovery is the initial point of entry within Help API, which helps you identify the relevant solutions for your Azure issue.

You can discover solutions using resourceUri OR resourceUri + problemClassificationId.

We will do our best in returning relevant diagnostics for your Azure issue.

Get the problemClassificationId(s) using this [reference](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP).

Note: ‘requiredParameterSets’ from Solutions Discovery API response must be passed via ‘additionalParameters’ as an input to Diagnostics API."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - security_connector_name: impl Into, - ) -> list::RequestBuilder { + #[doc = "* `scope`: This is an extension resource provider and only resource level extension is supported at the moment."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), + scope: scope.into(), + filter: None, + skiptoken: None, } } } @@ -556,9 +585,9 @@ pub mod security_connector_applications { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApplicationsList = serde_json::from_slice(&bytes)?; + let body: models::DiscoveryResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -595,16 +624,30 @@ pub mod security_connector_applications { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, + pub(crate) scope: String, + pub(crate) filter: Option, + pub(crate) skiptoken: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Can be used to filter solutionIds by 'ProblemClassificationId'. The filter supports only 'and' and 'eq' operators. Example: $filter=ProblemClassificationId eq '1ddda5b4-cf6c-4d4f-91ad-bc38ab0e811e' and ProblemClassificationId eq '0a9673c2-7af6-4e19-90d3-4ee2461076d9'."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."] + pub fn skiptoken(mut self, skiptoken: impl Into) -> Self { + self.skiptoken = Some(skiptoken.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Help/discoverySolutions", + this.client.endpoint(), + &this.scope + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -621,7 +664,7 @@ pub mod security_connector_applications { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -637,7 +680,13 @@ pub mod security_connector_applications { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-06-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(skiptoken) = &this.skiptoken { + req.url_mut().query_pairs_mut().append_pair("$skiptoken", skiptoken); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -658,309 +707,3 @@ pub mod security_connector_applications { } } } -pub mod security_connector_application { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a specific application for the requested scope by applicationId"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `application_id`: The security Application key - unique key for the standard application"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - security_connector_name: impl Into, - application_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - application_id: application_id.into(), - } - } - #[doc = "Creates or update a security Application on the given security connector."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `application_id`: The security Application key - unique key for the standard application"] - #[doc = "* `application`: Application over a subscription scope"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - security_connector_name: impl Into, - application_id: impl Into, - application: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - application_id: application_id.into(), - application: application.into(), - } - } - #[doc = "Delete an Application over a given scope"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `application_id`: The security Application key - unique key for the standard application"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - security_connector_name: impl Into, - application_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - application_id: application_id.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Application = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) application_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name , & this . application_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Application = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) application_id: String, - pub(crate) application: models::Application, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name , & this . application_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.application)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) application_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name , & this . application_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} diff --git a/services/mgmt/help/src/package_2023_06_01/models.rs b/services/mgmt/help/src/package_2023_06_01/models.rs new file mode 100644 index 0000000000..e65c2ebbc0 --- /dev/null +++ b/services/mgmt/help/src/package_2023_06_01/models.rs @@ -0,0 +1,724 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "The check availability request body."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityRequest { + #[doc = "The name of the resource for which availability needs to be checked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl CheckNameAvailabilityRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Response for whether the requested resource name is available or not."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityResponse { + #[doc = "Returns true or false depending on the availability of the name"] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "Reason for why value is not available. This field is returned if nameAvailable is false."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Gets an error message explaining the 'reason' value with more details. This field is returned iif nameAvailable is false."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl CheckNameAvailabilityResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties returned with in an insight."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Diagnostic { + #[doc = "Solution Id"] + #[serde(rename = "solutionId", default, skip_serializing_if = "Option::is_none")] + pub solution_id: Option, + #[doc = "Denotes the status of the diagnostic resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The problems (if any) detected by this insight."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub insights: Vec, + #[doc = "Error definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl Diagnostic { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Solution Invocation with additional params needed for invocation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnosticInvocation { + #[doc = "Solution Id to invoke."] + #[serde(rename = "solutionId", default, skip_serializing_if = "Option::is_none")] + pub solution_id: Option, + #[doc = "Additional parameters required to invoke the solutionId."] + #[serde(rename = "additionalParameters", default, skip_serializing_if = "Option::is_none")] + pub additional_parameters: Option, +} +impl DiagnosticInvocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Diagnostic resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnosticResource { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Diagnostic resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DiagnosticResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Diagnostic resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiagnosticResourceProperties { + #[doc = "Global parameters that can be passed to all solutionIds."] + #[serde(rename = "globalParameters", default, skip_serializing_if = "Option::is_none")] + pub global_parameters: Option, + #[doc = "SolutionIds that are needed to be invoked."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub insights: Vec, + #[doc = "Diagnostic Request Accepted time."] + #[serde(rename = "acceptedAt", default, skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + #[doc = "Status of diagnostic provisioning."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Array of Diagnostics."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub diagnostics: Vec, +} +impl DiagnosticResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod diagnostic_resource_properties { + use super::*; + #[doc = "Status of diagnostic provisioning."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Succeeded, + PartialComplete, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Succeeded"), + Self::PartialComplete => serializer.serialize_unit_variant("ProvisioningState", 1u32, "PartialComplete"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Denotes the status of the diagnostic resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "DiagnosticStatus")] +pub enum DiagnosticStatus { + Failed, + MissingInputs, + Running, + Succeeded, + Timeout, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for DiagnosticStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for DiagnosticStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for DiagnosticStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Failed => serializer.serialize_unit_variant("DiagnosticStatus", 0u32, "Failed"), + Self::MissingInputs => serializer.serialize_unit_variant("DiagnosticStatus", 1u32, "MissingInputs"), + Self::Running => serializer.serialize_unit_variant("DiagnosticStatus", 2u32, "Running"), + Self::Succeeded => serializer.serialize_unit_variant("DiagnosticStatus", 3u32, "Succeeded"), + Self::Timeout => serializer.serialize_unit_variant("DiagnosticStatus", 4u32, "Timeout"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Discovery response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiscoveryResponse { + #[doc = "The list of solution metadata."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of solution metadata."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DiscoveryResponse { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DiscoveryResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Error { + #[doc = "Service specific error code which serves as the substatus for the HTTP error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Service specific error type which serves as additional context for the error herein."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Description of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "An array of additional nested error response info objects, as described by this contract."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl Error { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Detailed insights(s) obtained via the invocation of an insight diagnostic troubleshooter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Insight { + #[doc = "Article id."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "This insight's title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Detailed result content."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option, + #[doc = "Importance level of the insight."] + #[serde(rename = "importanceLevel", default, skip_serializing_if = "Option::is_none")] + pub importance_level: Option, +} +impl Insight { + pub fn new() -> Self { + Self::default() + } +} +pub mod insight { + use super::*; + #[doc = "Importance level of the insight."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ImportanceLevel")] + pub enum ImportanceLevel { + Critical, + Warning, + Information, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ImportanceLevel { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ImportanceLevel { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ImportanceLevel { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Critical => serializer.serialize_unit_variant("ImportanceLevel", 0u32, "Critical"), + Self::Warning => serializer.serialize_unit_variant("ImportanceLevel", 1u32, "Warning"), + Self::Information => serializer.serialize_unit_variant("ImportanceLevel", 2u32, "Information"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Details of a REST API operation, returned from the Resource Provider Operations API"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Localized display information for this particular operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[serde(rename = "actionType", default, skip_serializing_if = "Option::is_none")] + pub action_type: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Localized display information for this particular operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The short, localized friendly description of the operation; suitable for tool tips and detailed views."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(rename = "user,system")] + UserSystem, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UserSystem => serializer.serialize_unit_variant("Origin", 2u32, "user,system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + Internal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Internal => serializer.serialize_unit_variant("ActionType", 0u32, "Internal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of operations supported by the resource provider"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results (if there are any)."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Diagnostic solution metadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SolutionMetadataProperties { + #[doc = "Solution Id."] + #[serde(rename = "solutionId", default, skip_serializing_if = "Option::is_none")] + pub solution_id: Option, + #[doc = "Solution Type."] + #[serde(rename = "solutionType", default, skip_serializing_if = "Option::is_none")] + pub solution_type: Option, + #[doc = "A detailed description of solution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Required parameters for invoking this particular solution."] + #[serde( + rename = "requiredParameterSets", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub required_parameter_sets: Vec>, +} +impl SolutionMetadataProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Solution Metadata resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SolutionMetadataResource { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Diagnostic solution metadata."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SolutionMetadataResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/hybridcloud/Cargo.toml b/services/mgmt/hybridcloud/Cargo.toml new file mode 100644 index 0000000000..5d4dcf32de --- /dev/null +++ b/services/mgmt/hybridcloud/Cargo.toml @@ -0,0 +1,39 @@ +# generated by AutoRust +[package] +name = "azure_mgmt_hybridcloud" +version = "0.11.0" +edition = "2021" +license = "MIT" +description = "generated REST API bindings" +repository = "https://github.com/azure/azure-sdk-for-rust" +homepage = "https://github.com/azure/azure-sdk-for-rust" +documentation = "https://docs.rs/azure_mgmt_hybridcloud" +# Require 1.64.0 for IntoFuture support +# https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#enhancing-await-with-intofuture +rust-version = "1.64.0" + +[lib] +doctest = false + +[dependencies] +azure_core = { path = "../../../sdk/core", version = "0.11", features = [] } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +bytes = "1.3" +futures = "0.3" +time = "0.3" + +[dev-dependencies] +azure_identity = { path = "../../../sdk/identity" } +tokio = { version = "1.23", features = ["macros", "rt-multi-thread"] } +env_logger = "0.10" + +[package.metadata.docs.rs] +all-features = true + +[features] +default = ["package-2023-01-01-preview", "enable_reqwest"] +enable_reqwest = ["azure_core/enable_reqwest"] +enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] +no-default-tag = [] +"package-2023-01-01-preview" = [] \ No newline at end of file diff --git a/services/mgmt/hybridcloud/README.md b/services/mgmt/hybridcloud/README.md new file mode 100644 index 0000000000..e51ab18ec8 --- /dev/null +++ b/services/mgmt/hybridcloud/README.md @@ -0,0 +1,13 @@ +# azure_mgmt_hybridcloud crate + +This is a generated [Azure SDK for Rust](https://github.com/Azure/azure-sdk-for-rust) crate from the Azure REST API specifications listed in: + +https://github.com/Azure/azure-rest-api-specs/blob/main/specification/hybridcloud/resource-manager/readme.md + +To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). + +The default tag is `package-2023-01-01-preview`. + +The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: + +- `package-2023-01-01-preview` has 14 operations from 1 API versions: `2023-01-01-preview`. Use crate feature `package-2023-01-01-preview` to enable. The operations will be in the `package_2023_01_01_preview` module. \ No newline at end of file diff --git a/services/mgmt/hybridcloud/src/lib.rs b/services/mgmt/hybridcloud/src/lib.rs new file mode 100644 index 0000000000..e1cadb226e --- /dev/null +++ b/services/mgmt/hybridcloud/src/lib.rs @@ -0,0 +1,9 @@ +#![allow(clippy::module_inception)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::ptr_arg)] +#![allow(clippy::large_enum_variant)] +#![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2023-01-01-preview")] +pub mod package_2023_01_01_preview; +#[cfg(all(feature = "package-2023-01-01-preview", not(feature = "no-default-tag")))] +pub use package_2023_01_01_preview::*; diff --git a/services/mgmt/security/src/package_preview_2023_03/mod.rs b/services/mgmt/hybridcloud/src/package_2023_01_01_preview/mod.rs similarity index 59% rename from services/mgmt/security/src/package_preview_2023_03/mod.rs rename to services/mgmt/hybridcloud/src/package_2023_01_01_preview/mod.rs index a983b71e31..3bd9fdc3bb 100644 --- a/services/mgmt/security/src/package_preview_2023_03/mod.rs +++ b/services/mgmt/hybridcloud/src/package_2023_01_01_preview/mod.rs @@ -103,32 +103,119 @@ impl Client { pipeline, } } - pub fn security_connectors_client(&self) -> security_connectors::Client { - security_connectors::Client(self.clone()) + pub fn cloud_connections_client(&self) -> cloud_connections::Client { + cloud_connections::Client(self.clone()) } - pub fn security_operators_client(&self) -> security_operators::Client { - security_operators::Client(self.clone()) + pub fn cloud_connectors_client(&self) -> cloud_connectors::Client { + cloud_connectors::Client(self.clone()) + } + pub fn hybrid_cloud_client(&self) -> hybrid_cloud::Client { + hybrid_cloud::Client(self.clone()) } } -pub mod security_connectors { +pub mod hybrid_cloud { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription."] + #[doc = "Lists all of the available HybridCloud Rest API operations."] + pub fn list_operations(&self) -> list_operations::RequestBuilder { + list_operations::RequestBuilder { client: self.0.clone() } + } + } + pub mod list_operations { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.HybridCloud/operations", this.client.endpoint(),))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod cloud_connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Return list of cloud connectors in a subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), } } - #[doc = "Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group."] + #[doc = "Return list of cloud connectors in a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] pub fn list_by_resource_group( &self, subscription_id: impl Into, @@ -140,96 +227,115 @@ pub mod security_connectors { resource_group_name: resource_group_name.into(), } } - #[doc = "Retrieves details of a specific security connector"] + #[doc = "Gets the specified cloud connector in a specified resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connector_name`: The name of the cloud connector resource"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, + cloud_connector_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), + cloud_connector_name: cloud_connector_name.into(), } } - #[doc = "Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated."] + #[doc = "Creates or updates a cloud connector resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `security_connector`: The security connector resource"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connector_name`: The name of the cloud connector resource"] + #[doc = "* `parameters`: The parameters to provide for the created cloud connector resource."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, - security_connector: impl Into, + cloud_connector_name: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - security_connector: security_connector.into(), + cloud_connector_name: cloud_connector_name.into(), + parameters: parameters.into(), } } - #[doc = "Updates a security connector"] + #[doc = "Updates the specified cloud connector tags."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `security_connector`: The security connector resource"] - pub fn update( + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connector_name`: The name of the cloud connector resource"] + #[doc = "* `parameters`: Parameters supplied to update cloud connector tags."] + pub fn update_tags( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, - security_connector: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + cloud_connector_name: impl Into, + parameters: impl Into, + ) -> update_tags::RequestBuilder { + update_tags::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - security_connector: security_connector.into(), + cloud_connector_name: cloud_connector_name.into(), + parameters: parameters.into(), } } - #[doc = "Deletes a security connector."] + #[doc = "Deletes a specified cloud connector resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connector_name`: The name of the cloud connector resource"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, + cloud_connector_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), + cloud_connector_name: cloud_connector_name.into(), + } + } + #[doc = "Returns a list of discovered remote cloud resources via this cloud connector resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connector_name`: The name of the cloud connector resource"] + pub fn discover_resources( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cloud_connector_name: impl Into, + ) -> discover_resources::RequestBuilder { + discover_resources::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cloud_connector_name: cloud_connector_name.into(), } } } - pub mod list { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + let body: models::CloudConnectorListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -269,12 +375,12 @@ pub mod security_connectors { pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/securityConnectors", + "{}/subscriptions/{}/providers/Microsoft.HybridCloud/cloudConnectors", this.client.endpoint(), &this.subscription_id ))?; @@ -294,7 +400,7 @@ pub mod security_connectors { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -310,7 +416,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -334,9 +440,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + let body: models::CloudConnectorListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -377,12 +483,12 @@ pub mod security_connectors { pub(crate) resource_group_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnectors", this.client.endpoint(), &this.subscription_id, &this.resource_group_name @@ -403,7 +509,7 @@ pub mod security_connectors { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -419,7 +525,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -443,9 +549,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + let body: models::CloudConnector = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -484,7 +590,7 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, + pub(crate) cloud_connector_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -496,11 +602,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.cloud_connector_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -511,7 +617,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -520,8 +626,8 @@ pub mod security_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -536,9 +642,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + let body: models::CloudConnector = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -547,6 +653,9 @@ pub mod security_connectors { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -558,6 +667,14 @@ pub mod security_connectors { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for the operation status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -577,10 +694,11 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) security_connector: models::SecurityConnector, + pub(crate) cloud_connector_name: String, + pub(crate) parameters: models::CloudConnector, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -590,11 +708,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.cloud_connector_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -605,9 +723,9 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.security_connector)?; + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -615,8 +733,8 @@ pub mod security_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -627,13 +745,13 @@ pub mod security_connectors { } } } - pub mod update { + pub mod update_tags { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + let body: models::CloudConnector = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -672,8 +790,8 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) security_connector: models::SecurityConnector, + pub(crate) cloud_connector_name: String, + pub(crate) parameters: models::TagsObject, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -685,11 +803,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.cloud_connector_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -700,9 +818,9 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.security_connector)?; + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -710,8 +828,8 @@ pub mod security_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -744,9 +862,10 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, + pub(crate) cloud_connector_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -756,11 +875,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnectors/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.cloud_connector_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -771,97 +890,456 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod discover_resources { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredResources = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cloud_connector_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnectors/{}/discoverResources", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cloud_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod security_operators { +pub mod cloud_connections { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists Microsoft Defender for Cloud securityOperators in the subscription."] + #[doc = "Return list of cloud connections in a subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `pricing_name`: name of the pricing configuration"] - pub fn list(&self, subscription_id: impl Into, pricing_name: impl Into) -> list::RequestBuilder { - list::RequestBuilder { + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Return list of cloud connections in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - pricing_name: pricing_name.into(), + resource_group_name: resource_group_name.into(), } } - #[doc = "Get a specific security operator for the requested scope."] + #[doc = "Gets the specified cloud connection in a specified resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `pricing_name`: name of the pricing configuration"] - #[doc = "* `security_operator_name`: name of the securityOperator"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connection_name`: The name of the cloud connection resource"] pub fn get( &self, subscription_id: impl Into, - pricing_name: impl Into, - security_operator_name: impl Into, + resource_group_name: impl Into, + cloud_connection_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - pricing_name: pricing_name.into(), - security_operator_name: security_operator_name.into(), + resource_group_name: resource_group_name.into(), + cloud_connection_name: cloud_connection_name.into(), } } - #[doc = "Creates Microsoft Defender for Cloud security operator on the given scope."] + #[doc = "Creates or updates a cloud connection resource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `pricing_name`: name of the pricing configuration"] - #[doc = "* `security_operator_name`: name of the securityOperator"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connection_name`: The name of the cloud connection resource"] + #[doc = "* `parameters`: The parameters to provide for the created cloud connection."] pub fn create_or_update( &self, subscription_id: impl Into, - pricing_name: impl Into, - security_operator_name: impl Into, + resource_group_name: impl Into, + cloud_connection_name: impl Into, + parameters: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - pricing_name: pricing_name.into(), - security_operator_name: security_operator_name.into(), + resource_group_name: resource_group_name.into(), + cloud_connection_name: cloud_connection_name.into(), + parameters: parameters.into(), } } - #[doc = "Delete Microsoft Defender for Cloud securityOperator in the subscription."] + #[doc = "Updates the specified cloud connection tags."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `pricing_name`: name of the pricing configuration"] - #[doc = "* `security_operator_name`: name of the securityOperator"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connection_name`: The name of the cloud connection resource"] + #[doc = "* `parameters`: Parameters supplied to update cloud connection tags."] + pub fn update_tags( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cloud_connection_name: impl Into, + parameters: impl Into, + ) -> update_tags::RequestBuilder { + update_tags::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cloud_connection_name: cloud_connection_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a specified cloud connection resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cloud_connection_name`: The name of the cloud connection resource"] pub fn delete( &self, subscription_id: impl Into, - pricing_name: impl Into, - security_operator_name: impl Into, + resource_group_name: impl Into, + cloud_connection_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - pricing_name: pricing_name.into(), - security_operator_name: security_operator_name.into(), + resource_group_name: resource_group_name.into(), + cloud_connection_name: cloud_connection_name.into(), + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CloudConnectionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HybridCloud/cloudConnections", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CloudConnectionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnections", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityOperatorList = serde_json::from_slice(&bytes)?; + let body: models::CloudConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -899,7 +1377,8 @@ pub mod security_operators { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) pricing_name: String, + pub(crate) resource_group_name: String, + pub(crate) cloud_connection_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -911,10 +1390,11 @@ pub mod security_operators { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}/securityOperators", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnections/{}", this.client.endpoint(), &this.subscription_id, - &this.pricing_name + &this.resource_group_name, + &this.cloud_connection_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -934,8 +1414,8 @@ pub mod security_operators { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -946,13 +1426,13 @@ pub mod security_operators { } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityOperator = serde_json::from_slice(&bytes)?; + let body: models::CloudConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -961,6 +1441,9 @@ pub mod security_operators { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -972,6 +1455,14 @@ pub mod security_operators { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "URI to poll for the operation status"] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -990,10 +1481,12 @@ pub mod security_operators { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) pricing_name: String, - pub(crate) security_operator_name: String, + pub(crate) resource_group_name: String, + pub(crate) cloud_connection_name: String, + pub(crate) parameters: models::CloudConnection, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1003,13 +1496,13 @@ pub mod security_operators { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}/securityOperators/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnections/{}", this.client.endpoint(), &this.subscription_id, - &this.pricing_name, - &this.security_operator_name + &this.resource_group_name, + &this.cloud_connection_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1019,7 +1512,8 @@ pub mod security_operators { req.url_mut() .query_pairs_mut() .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1027,8 +1521,8 @@ pub mod security_operators { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1039,13 +1533,13 @@ pub mod security_operators { } } } - pub mod create_or_update { + pub mod update_tags { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityOperator = serde_json::from_slice(&bytes)?; + let body: models::CloudConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1083,8 +1577,9 @@ pub mod security_operators { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) pricing_name: String, - pub(crate) security_operator_name: String, + pub(crate) resource_group_name: String, + pub(crate) cloud_connection_name: String, + pub(crate) parameters: models::TagsObject, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1096,13 +1591,13 @@ pub mod security_operators { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}/securityOperators/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnections/{}", this.client.endpoint(), &this.subscription_id, - &this.pricing_name, - &this.security_operator_name + &this.resource_group_name, + &this.cloud_connection_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1112,7 +1607,8 @@ pub mod security_operators { req.url_mut() .query_pairs_mut() .append_pair(azure_core::query_param::API_VERSION, "2023-01-01-preview"); - let req_body = azure_core::EMPTY_BODY; + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1120,8 +1616,8 @@ pub mod security_operators { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1153,10 +1649,11 @@ pub mod security_operators { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) pricing_name: String, - pub(crate) security_operator_name: String, + pub(crate) resource_group_name: String, + pub(crate) cloud_connection_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1166,11 +1663,11 @@ pub mod security_operators { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}/securityOperators/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCloud/cloudConnections/{}", this.client.endpoint(), &this.subscription_id, - &this.pricing_name, - &this.security_operator_name + &this.resource_group_name, + &this.cloud_connection_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); diff --git a/services/mgmt/hybridcloud/src/package_2023_01_01_preview/models.rs b/services/mgmt/hybridcloud/src/package_2023_01_01_preview/models.rs new file mode 100644 index 0000000000..38bcf9cee2 --- /dev/null +++ b/services/mgmt/hybridcloud/src/package_2023_01_01_preview/models.rs @@ -0,0 +1,713 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Resource which represents the managed network connection between Azure Gateways and remote cloud gateways."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudConnection { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Cloud connection resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "A unique read-only string that changes whenever the resource is updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl CloudConnection { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + etag: None, + } + } +} +#[doc = "Response for the ListCloudConnections API service call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudConnectionListResult { + #[doc = "A list of cloud connection resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to hold the next page of results"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CloudConnectionListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CloudConnectionListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Cloud connection resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudConnectionProperties { + #[doc = "Resource reference properties."] + #[serde(rename = "cloudConnector", default, skip_serializing_if = "Option::is_none")] + pub cloud_connector: Option, + #[doc = "Identifier for the remote cloud resource"] + #[serde(rename = "remoteResourceId", default, skip_serializing_if = "Option::is_none")] + pub remote_resource_id: Option, + #[doc = "Resource reference properties."] + #[serde(rename = "virtualHub", default, skip_serializing_if = "Option::is_none")] + pub virtual_hub: Option, + #[doc = "Shared key of the cloud connection."] + #[serde(rename = "sharedKey", default, skip_serializing_if = "Option::is_none")] + pub shared_key: Option, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl CloudConnectionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Cloud Connector resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudConnector { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Cloud connector resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "A unique read-only string that changes whenever the resource is updated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl CloudConnector { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + etag: None, + } + } +} +#[doc = "Response for the ListCloudConnectors API service call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudConnectorListResult { + #[doc = "A list of cloud connector resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to hold the next page of results"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CloudConnectorListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CloudConnectorListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Cloud connector resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudConnectorProperties { + #[doc = "Account identifier of the remote cloud."] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "The cloud connector type."] + #[serde(rename = "cloudType", default, skip_serializing_if = "Option::is_none")] + pub cloud_type: Option, + #[doc = "The current provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl CloudConnectorProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod cloud_connector_properties { + use super::*; + #[doc = "The cloud connector type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CloudType")] + pub enum CloudType { + #[serde(rename = "AWS")] + Aws, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CloudType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CloudType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CloudType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("CloudType", 0u32, "AWS"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Discovered Resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiscoveredResource { + #[doc = "Remote cloud resource identifier"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Content type of the cloud resource body."] + #[serde(rename = "bodyContentType", default, skip_serializing_if = "Option::is_none")] + pub body_content_type: Option, + #[doc = "Properties of the remote cloud resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub body: Option, +} +impl DiscoveredResource { + pub fn new() -> Self { + Self::default() + } +} +pub mod discovered_resource { + use super::*; + #[doc = "Content type of the cloud resource body."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "BodyContentType")] + pub enum BodyContentType { + Xml, + Json, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for BodyContentType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for BodyContentType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for BodyContentType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Xml => serializer.serialize_unit_variant("BodyContentType", 0u32, "Xml"), + Self::Json => serializer.serialize_unit_variant("BodyContentType", 1u32, "Json"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "API to discover resources in remote cloud referred by the connector."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiscoveredResources { + #[doc = "Remote Cloud Resource filter."] + #[serde(rename = "resourceFilter", default, skip_serializing_if = "Option::is_none")] + pub resource_filter: Option, + #[doc = "List of discovered remote cloud resources."] + #[serde( + rename = "discoveredResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub discovered_resources: Vec, +} +impl DiscoveredResources { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of a REST API operation, returned from the Resource Provider Operations API"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Localized display information for this particular operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[serde(rename = "actionType", default, skip_serializing_if = "Option::is_none")] + pub action_type: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Localized display information for this particular operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The short, localized friendly description of the operation; suitable for tool tips and detailed views."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(rename = "user,system")] + UserSystem, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UserSystem => serializer.serialize_unit_variant("Origin", 2u32, "user,system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + Internal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Internal => serializer.serialize_unit_variant("ActionType", 0u32, "Internal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of operations supported by the resource provider"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results (if there are any)."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The current provisioning state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ProvisioningState")] +pub enum ProvisioningState { + Succeeded, + Updating, + Deleting, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Succeeded"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Remote Cloud Resource filter."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceFilter { + #[doc = "Remote Resource name to filter on."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Remote Resource type to filter on."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Remote Resource location/region to filter on."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "Remote Resource tags to filter on in key:value format."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tag: Option, +} +impl ResourceFilter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Resource reference properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceReference { + #[doc = "Resource ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ResourceReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Tags object for patch operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagsObject { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl TagsObject { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/hybridcompute/Cargo.toml b/services/mgmt/hybridcompute/Cargo.toml index c0e5f12b10..d9ab73e8ae 100644 --- a/services/mgmt/hybridcompute/Cargo.toml +++ b/services/mgmt/hybridcompute/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2022-12", "enable_reqwest"] +default = ["package-preview-2023-03", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-03" = [] "package-preview-2022-12" = [] "package-preview-2022-08" = [] "package-preview-2022-05" = [] -"package-preview-2021-12" = [] -"package-preview-2021-06" = [] \ No newline at end of file +"package-preview-2021-12" = [] \ No newline at end of file diff --git a/services/mgmt/hybridcompute/README.md b/services/mgmt/hybridcompute/README.md index 8df34f895d..d1698c1960 100644 --- a/services/mgmt/hybridcompute/README.md +++ b/services/mgmt/hybridcompute/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/hybridcomp To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2022-12`. +The default tag is `package-preview-2023-03`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-03` has 34 operations from 1 API versions: `2023-03-15-preview`. Use crate feature `package-preview-2023-03` to enable. The operations will be in the `package_preview_2023_03` module. - `package-preview-2022-12` has 30 operations from 1 API versions: `2022-12-27-preview`. Use crate feature `package-preview-2022-12` to enable. The operations will be in the `package_preview_2022_12` module. - `package-preview-2022-08` has 29 operations from 1 API versions: `2022-08-11-preview`. Use crate feature `package-preview-2022-08` to enable. The operations will be in the `package_preview_2022_08` module. - `package-preview-2022-05` has 27 operations from 1 API versions: `2022-05-10-preview`. Use crate feature `package-preview-2022-05` to enable. The operations will be in the `package_preview_2022_05` module. -- `package-preview-2021-12` has 27 operations from 1 API versions: `2021-12-10-preview`. Use crate feature `package-preview-2021-12` to enable. The operations will be in the `package_preview_2021_12` module. -- `package-preview-2021-06` has 27 operations from 1 API versions: `2021-06-10-preview`. Use crate feature `package-preview-2021-06` to enable. The operations will be in the `package_preview_2021_06` module. \ No newline at end of file +- `package-preview-2021-12` has 27 operations from 1 API versions: `2021-12-10-preview`. Use crate feature `package-preview-2021-12` to enable. The operations will be in the `package_preview_2021_12` module. \ No newline at end of file diff --git a/services/mgmt/hybridcompute/src/lib.rs b/services/mgmt/hybridcompute/src/lib.rs index c0c07f7af7..4012ca8d5d 100644 --- a/services/mgmt/hybridcompute/src/lib.rs +++ b/services/mgmt/hybridcompute/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-03")] +pub mod package_preview_2023_03; +#[cfg(all(feature = "package-preview-2023-03", not(feature = "no-default-tag")))] +pub use package_preview_2023_03::*; #[cfg(feature = "package-preview-2022-12")] pub mod package_preview_2022_12; #[cfg(all(feature = "package-preview-2022-12", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_preview_2022_05::*; pub mod package_preview_2021_12; #[cfg(all(feature = "package-preview-2021-12", not(feature = "no-default-tag")))] pub use package_preview_2021_12::*; -#[cfg(feature = "package-preview-2021-06")] -pub mod package_preview_2021_06; -#[cfg(all(feature = "package-preview-2021-06", not(feature = "no-default-tag")))] -pub use package_preview_2021_06::*; diff --git a/services/mgmt/hybridcompute/src/package_preview_2021_06/mod.rs b/services/mgmt/hybridcompute/src/package_preview_2023_03/mod.rs similarity index 78% rename from services/mgmt/hybridcompute/src/package_preview_2021_06/mod.rs rename to services/mgmt/hybridcompute/src/package_preview_2023_03/mod.rs index 36a92e6b6f..fb4e3179fe 100644 --- a/services/mgmt/hybridcompute/src/package_preview_2021_06/mod.rs +++ b/services/mgmt/hybridcompute/src/package_preview_2023_03/mod.rs @@ -103,12 +103,24 @@ impl Client { pipeline, } } + pub fn agent_version_client(&self) -> agent_version::Client { + agent_version::Client(self.clone()) + } + pub fn extension_metadata_client(&self) -> extension_metadata::Client { + extension_metadata::Client(self.clone()) + } + pub fn hybrid_identity_metadata_client(&self) -> hybrid_identity_metadata::Client { + hybrid_identity_metadata::Client(self.clone()) + } pub fn machine_extensions_client(&self) -> machine_extensions::Client { machine_extensions::Client(self.clone()) } pub fn machines_client(&self) -> machines::Client { machines::Client(self.clone()) } + pub fn network_profile_client(&self) -> network_profile::Client { + network_profile::Client(self.clone()) + } pub fn operations_client(&self) -> operations::Client { operations::Client(self.clone()) } @@ -146,7 +158,7 @@ pub mod machines { expand: None, } } - #[doc = "The operation to create or update a hybrid machine resource identity in Azure."] + #[doc = "The operation to create or update a hybrid machine. Please note some properties can be set only during machine creation."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -190,7 +202,7 @@ pub mod machines { parameters: parameters.into(), } } - #[doc = "The operation to remove a hybrid machine identity in Azure."] + #[doc = "The operation to delete a hybrid machine."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -314,7 +326,7 @@ pub mod machines { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(expand) = &this.expand { req.url_mut().query_pairs_mut().append_pair("$expand", expand); } @@ -411,7 +423,7 @@ pub mod machines { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -506,7 +518,7 @@ pub mod machines { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -577,7 +589,7 @@ pub mod machines { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -659,7 +671,7 @@ pub mod machines { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -675,7 +687,7 @@ pub mod machines { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -766,7 +778,7 @@ pub mod machines { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -782,7 +794,7 @@ pub mod machines { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -996,7 +1008,7 @@ pub mod machine_extensions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1093,7 +1105,7 @@ pub mod machine_extensions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.extension_parameters)?; req.set_body(req_body); @@ -1130,6 +1142,9 @@ pub mod machine_extensions { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -1141,6 +1156,22 @@ pub mod machine_extensions { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "The URL of the resource used to check the status of the asynchronous operation."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + #[doc = "The URI to poll for completion status."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1191,7 +1222,7 @@ pub mod machine_extensions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.extension_parameters)?; req.set_body(req_body); @@ -1265,7 +1296,7 @@ pub mod machine_extensions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1355,7 +1386,7 @@ pub mod machine_extensions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1371,7 +1402,7 @@ pub mod machine_extensions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); if let Some(expand) = &this.expand { req.url_mut().query_pairs_mut().append_pair("$expand", expand); } @@ -1470,7 +1501,7 @@ pub mod upgrade_extensions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.extension_upgrade_parameters)?; req.set_body(req_body); @@ -1480,6 +1511,232 @@ pub mod upgrade_extensions { } } } +pub mod extension_metadata { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets an Extension Metadata based on location, publisher, extensionType and version"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The location of the Extension being received."] + #[doc = "* `publisher`: The publisher of the Extension being received."] + #[doc = "* `extension_type`: The extensionType of the Extension being received."] + #[doc = "* `version`: The version of the Extension being received."] + pub fn get( + &self, + subscription_id: impl Into, + location: impl Into, + publisher: impl Into, + extension_type: impl Into, + version: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + publisher: publisher.into(), + extension_type: extension_type.into(), + version: version.into(), + } + } + #[doc = "Gets all Extension versions based on location, publisher, extensionType"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The location of the Extension being received."] + #[doc = "* `publisher`: The publisher of the Extension being received."] + #[doc = "* `extension_type`: The extensionType of the Extension being received."] + pub fn list( + &self, + subscription_id: impl Into, + location: impl Into, + publisher: impl Into, + extension_type: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + publisher: publisher.into(), + extension_type: extension_type.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionValue = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) publisher: String, + pub(crate) extension_type: String, + pub(crate) version: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.HybridCompute/locations/{}/publishers/{}/extensionTypes/{}/versions/{}" , this . client . endpoint () , & this . subscription_id , & this . location , & this . publisher , & this . extension_type , & this . version)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionValueListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) publisher: String, + pub(crate) extension_type: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.HybridCompute/locations/{}/publishers/{}/extensionTypes/{}/versions", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.publisher, + &this.extension_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} pub mod operations { use super::models; pub struct Client(pub(crate) super::Client); @@ -1554,7 +1811,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1564,6 +1821,587 @@ pub mod operations { } } } +pub mod network_profile { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The operation to get network information of hybrid machine"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `machine_name`: The name of the hybrid machine."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + machine_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + machine_name: machine_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NetworkProfile = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) machine_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCompute/machines/{}/networkProfile", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.machine_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod hybrid_identity_metadata { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets HybridIdentityMetadata."] + #[doc = "Implements HybridIdentityMetadata GET method."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `machine_name`: The name of the hybrid machine."] + #[doc = "* `metadata_name`: Name of the HybridIdentityMetadata."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + machine_name: impl Into, + metadata_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + machine_name: machine_name.into(), + metadata_name: metadata_name.into(), + } + } + #[doc = "Implements GET HybridIdentityMetadata in a machine."] + #[doc = "Returns the list of HybridIdentityMetadata of the given machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `machine_name`: The name of the hybrid machine."] + pub fn list_by_machines( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + machine_name: impl Into, + ) -> list_by_machines::RequestBuilder { + list_by_machines::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + machine_name: machine_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HybridIdentityMetadata = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) machine_name: String, + pub(crate) metadata_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCompute/machines/{}/hybridIdentityMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.machine_name, + &this.metadata_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_machines { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HybridIdentityMetadataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) machine_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.HybridCompute/machines/{}/hybridIdentityMetadata", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.machine_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod agent_version { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all Agent Versions along with the download link currently present."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `os_type`: Defines the os type."] + pub fn list(&self, os_type: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + os_type: os_type.into(), + } + } + #[doc = "Gets an Agent Version along with the download link currently present."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `os_type`: Defines the os type"] + #[doc = "* `version`: Defines the agent version. To get latest, use latest or else a specific agent version."] + pub fn get(&self, os_type: impl Into, version: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + os_type: os_type.into(), + version: version.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AgentVersionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) os_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.HybridCompute/osType/{}/agentVersions", + this.client.endpoint(), + &this.os_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AgentVersion = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) os_type: String, + pub(crate) version: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.HybridCompute/osType/{}/agentVersions/{}", + this.client.endpoint(), + &this.os_type, + &this.version + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} pub mod private_link_scopes { use super::models; pub struct Client(pub(crate) super::Client); @@ -1786,7 +2624,7 @@ pub mod private_link_scopes { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1802,7 +2640,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1895,7 +2733,7 @@ pub mod private_link_scopes { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1911,7 +2749,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2003,7 +2841,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2097,7 +2935,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2192,7 +3030,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.private_link_scope_tags)?; req.set_body(req_body); @@ -2264,7 +3102,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2345,7 +3183,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2438,7 +3276,7 @@ pub mod private_link_scopes { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2575,7 +3413,7 @@ pub mod private_link_resources { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2591,7 +3429,7 @@ pub mod private_link_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2678,7 +3516,7 @@ pub mod private_link_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2859,7 +3697,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2949,7 +3787,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3016,7 +3854,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3094,7 +3932,7 @@ pub mod private_endpoint_connections { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3110,7 +3948,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-10-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? diff --git a/services/mgmt/hybridcompute/src/package_preview_2021_06/models.rs b/services/mgmt/hybridcompute/src/package_preview_2023_03/models.rs similarity index 66% rename from services/mgmt/hybridcompute/src/package_preview_2021_06/models.rs rename to services/mgmt/hybridcompute/src/package_preview_2023_03/models.rs index af068c4b47..43f5da1daa 100644 --- a/services/mgmt/hybridcompute/src/package_preview_2021_06/models.rs +++ b/services/mgmt/hybridcompute/src/package_preview_2023_03/models.rs @@ -3,6 +3,235 @@ use serde::de::{value, Deserializer, IntoDeserializer}; use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; +#[doc = "Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AgentConfiguration { + #[doc = "Specifies the URL of the proxy to be used."] + #[serde(rename = "proxyUrl", default, skip_serializing_if = "Option::is_none")] + pub proxy_url: Option, + #[doc = "Specifies the list of ports that the agent will be able to listen on."] + #[serde( + rename = "incomingConnectionsPorts", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub incoming_connections_ports: Vec, + #[doc = "Array of extensions that are allowed to be installed or updated."] + #[serde( + rename = "extensionsAllowList", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub extensions_allow_list: Vec, + #[doc = "Array of extensions that are blocked (cannot be installed or updated)"] + #[serde( + rename = "extensionsBlockList", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub extensions_block_list: Vec, + #[doc = "List of service names which should not use the specified proxy server."] + #[serde( + rename = "proxyBypass", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub proxy_bypass: Vec, + #[doc = "Specifies whether the extension service is enabled or disabled."] + #[serde(rename = "extensionsEnabled", default, skip_serializing_if = "Option::is_none")] + pub extensions_enabled: Option, + #[doc = "Specified whether the guest configuration service is enabled or disabled."] + #[serde(rename = "guestConfigurationEnabled", default, skip_serializing_if = "Option::is_none")] + pub guest_configuration_enabled: Option, + #[doc = "Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists and guest configuration, maintained by Microsoft."] + #[serde(rename = "configMode", default, skip_serializing_if = "Option::is_none")] + pub config_mode: Option, +} +impl AgentConfiguration { + pub fn new() -> Self { + Self::default() + } +} +pub mod agent_configuration { + use super::*; + #[doc = "Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists and guest configuration, maintained by Microsoft."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ConfigMode")] + pub enum ConfigMode { + #[serde(rename = "full")] + Full, + #[serde(rename = "monitor")] + Monitor, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ConfigMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ConfigMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ConfigMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Full => serializer.serialize_unit_variant("ConfigMode", 0u32, "full"), + Self::Monitor => serializer.serialize_unit_variant("ConfigMode", 1u32, "monitor"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The info w.r.t Agent Upgrade."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AgentUpgrade { + #[doc = "Specifies the version info w.r.t AgentUpgrade for the machine."] + #[serde(rename = "desiredVersion", default, skip_serializing_if = "Option::is_none")] + pub desired_version: Option, + #[doc = "The correlation ID passed in from RSM per upgrade."] + #[serde(rename = "correlationId", default, skip_serializing_if = "Option::is_none")] + pub correlation_id: Option, + #[doc = "Specifies if RSM should try to upgrade this machine"] + #[serde(rename = "enableAutomaticUpgrade", default, skip_serializing_if = "Option::is_none")] + pub enable_automatic_upgrade: Option, + #[doc = "Specifies the version of the last attempt"] + #[serde(rename = "lastAttemptDesiredVersion", default, skip_serializing_if = "Option::is_none")] + pub last_attempt_desired_version: Option, + #[doc = "Timestamp of last upgrade attempt"] + #[serde(rename = "lastAttemptTimestamp", default, skip_serializing_if = "Option::is_none")] + pub last_attempt_timestamp: Option, + #[doc = "Specifies the status of Agent Upgrade."] + #[serde(rename = "lastAttemptStatus", default, skip_serializing_if = "Option::is_none")] + pub last_attempt_status: Option, + #[doc = "Failure message of last upgrade attempt if any."] + #[serde(rename = "lastAttemptMessage", default, skip_serializing_if = "Option::is_none")] + pub last_attempt_message: Option, +} +impl AgentUpgrade { + pub fn new() -> Self { + Self::default() + } +} +pub mod agent_upgrade { + use super::*; + #[doc = "Specifies the status of Agent Upgrade."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastAttemptStatus")] + pub enum LastAttemptStatus { + Success, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastAttemptStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastAttemptStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastAttemptStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Success => serializer.serialize_unit_variant("LastAttemptStatus", 0u32, "Success"), + Self::Failed => serializer.serialize_unit_variant("LastAttemptStatus", 1u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes properties of Agent Version."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AgentVersion { + #[doc = "Represents the agent version."] + #[serde(rename = "agentVersion", default, skip_serializing_if = "Option::is_none")] + pub agent_version: Option, + #[doc = "Represents the download link of specific agent version."] + #[serde(rename = "downloadLink", default, skip_serializing_if = "Option::is_none")] + pub download_link: Option, + #[doc = "Defines the os type."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, +} +impl AgentVersion { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes AgentVersions List."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AgentVersionsList { + #[doc = "The list of available Agent Versions."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next 10 available Agent Versions."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl AgentVersionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The metadata of the cloud environment (Azure/GCP/AWS/OCI...)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudMetadata { + #[doc = "Specifies the cloud provider (Azure/AWS/GCP...)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, +} +impl CloudMetadata { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties that can identify extensions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConfigurationExtension { + #[doc = "Publisher of the extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "Type of the extension."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl ConfigurationExtension { + pub fn new() -> Self { + Self::default() + } +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ConnectionDetail { #[doc = "Azure resource Id"] @@ -120,6 +349,60 @@ impl ExtensionTargetProperties { Self::default() } } +#[doc = "Describes a Extension Metadata"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionValue { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Describes Extension Metadata properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ExtensionValue { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The List Extension Metadata response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionValueListResult { + #[doc = "The list of extension metadata"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl azure_core::Continuable for ExtensionValueListResult { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ExtensionValueListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes Extension Metadata properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionValueProperties { + #[doc = "The version of the Extension being received."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "The type of the Extension being received."] + #[serde(rename = "extensionType", default, skip_serializing_if = "Option::is_none")] + pub extension_type: Option, + #[doc = "The publisher of the Extension being received."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, +} +impl ExtensionValueProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "An Azure Arc PrivateLinkScope definition."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct HybridComputePrivateLinkScope { @@ -187,6 +470,64 @@ impl HybridComputePrivateLinkScopeProperties { Self::default() } } +#[doc = "Defines the HybridIdentityMetadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridIdentityMetadata { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Defines the resource properties."] + pub properties: HybridIdentityMetadataProperties, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl HybridIdentityMetadata { + pub fn new(properties: HybridIdentityMetadataProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + system_data: None, + } + } +} +#[doc = "List of HybridIdentityMetadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridIdentityMetadataList { + #[doc = "Url to follow for getting next page of HybridIdentityMetadata."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of HybridIdentityMetadata"] + pub value: Vec, +} +impl azure_core::Continuable for HybridIdentityMetadataList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl HybridIdentityMetadataList { + pub fn new(value: Vec) -> Self { + Self { next_link: None, value } + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HybridIdentityMetadataProperties { + #[doc = "The unique identifier for the resource."] + #[serde(rename = "vmId", default, skip_serializing_if = "Option::is_none")] + pub vm_id: Option, + #[doc = "The Public Key."] + #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] + pub public_key: Option, + #[doc = "Identity for the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl HybridIdentityMetadataProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Identity for the resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Identity { @@ -213,6 +554,24 @@ pub mod identity { SystemAssigned, } } +#[doc = "Describes properties of the IP address."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IpAddress { + #[doc = "Represents the IP Address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[doc = "Represents the Ip Address Version."] + #[serde(rename = "ipAddressVersion", default, skip_serializing_if = "Option::is_none")] + pub ip_address_version: Option, + #[doc = "Describes the subnet."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subnet: Option, +} +impl IpAddress { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Describes a hybrid machine."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Machine { @@ -221,20 +580,75 @@ pub struct Machine { #[doc = "Describes the properties of a hybrid machine."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, + #[doc = "The list of extensions affiliated to the machine"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resources: Vec, #[doc = "Identity for the resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub identity: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, + #[doc = "Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, } impl Machine { pub fn new(tracked_resource: TrackedResource) -> Self { Self { tracked_resource, properties: None, + resources: Vec::new(), identity: None, - system_data: None, + kind: None, + } + } +} +pub mod machine { + use super::*; + #[doc = "Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + #[serde(rename = "AVS")] + Avs, + #[serde(rename = "HCI")] + Hci, + #[serde(rename = "SCVMM")] + Scvmm, + VMware, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Avs => serializer.serialize_unit_variant("Kind", 0u32, "AVS"), + Self::Hci => serializer.serialize_unit_variant("Kind", 1u32, "HCI"), + Self::Scvmm => serializer.serialize_unit_variant("Kind", 2u32, "SCVMM"), + Self::VMware => serializer.serialize_unit_variant("Kind", 3u32, "VMware"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } } @@ -246,16 +660,12 @@ pub struct MachineExtension { #[doc = "Describes the properties of a Machine Extension."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, } impl MachineExtension { pub fn new(tracked_resource: TrackedResource) -> Self { Self { tracked_resource, properties: None, - system_data: None, } } } @@ -364,6 +774,9 @@ pub struct MachineExtensionProperties { #[doc = "Specifies the version of the script handler."] #[serde(rename = "typeHandlerVersion", default, skip_serializing_if = "Option::is_none")] pub type_handler_version: Option, + #[doc = "Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available."] + #[serde(rename = "enableAutomaticUpgrade", default, skip_serializing_if = "Option::is_none")] + pub enable_automatic_upgrade: Option, #[doc = "Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true."] #[serde(rename = "autoUpgradeMinorVersion", default, skip_serializing_if = "Option::is_none")] pub auto_upgrade_minor_version: Option, @@ -414,6 +827,9 @@ pub struct MachineExtensionUpdateProperties { #[doc = "Specifies the version of the script handler."] #[serde(rename = "typeHandlerVersion", default, skip_serializing_if = "Option::is_none")] pub type_handler_version: Option, + #[doc = "Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available."] + #[serde(rename = "enableAutomaticUpgrade", default, skip_serializing_if = "Option::is_none")] + pub enable_automatic_upgrade: Option, #[doc = "Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true."] #[serde(rename = "autoUpgradeMinorVersion", default, skip_serializing_if = "Option::is_none")] pub auto_upgrade_minor_version: Option, @@ -429,7 +845,7 @@ impl MachineExtensionUpdateProperties { Self::default() } } -#[doc = "Describes the Machine Extension Upgrade Properties"] +#[doc = "Describes the Machine Extension Upgrade Properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MachineExtensionUpgrade { #[doc = "Describes the Machine Extension Target Properties"] @@ -492,6 +908,18 @@ pub struct MachineProperties { #[doc = "Metadata pertaining to the geographic location of the resource."] #[serde(rename = "locationData", default, skip_serializing_if = "Option::is_none")] pub location_data: Option, + #[doc = "Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM."] + #[serde(rename = "agentConfiguration", default, skip_serializing_if = "Option::is_none")] + pub agent_configuration: Option, + #[doc = "Reports the state and behavior of dependent services."] + #[serde(rename = "serviceStatuses", default, skip_serializing_if = "Option::is_none")] + pub service_statuses: Option, + #[doc = "The metadata of the cloud environment (Azure/GCP/AWS/OCI...)."] + #[serde(rename = "cloudMetadata", default, skip_serializing_if = "Option::is_none")] + pub cloud_metadata: Option, + #[doc = "The info w.r.t Agent Upgrade."] + #[serde(rename = "agentUpgrade", default, skip_serializing_if = "Option::is_none")] + pub agent_upgrade: Option, #[doc = "Specifies the operating system settings for the hybrid machine."] #[serde(rename = "osProfile", default, skip_serializing_if = "Option::is_none")] pub os_profile: Option, @@ -539,7 +967,7 @@ pub struct MachineProperties { #[doc = "Specifies the Arc Machine's unique SMBIOS ID"] #[serde(rename = "vmUuid", default, skip_serializing_if = "Option::is_none")] pub vm_uuid: Option, - #[doc = "Machine Extensions information"] + #[doc = "Machine Extensions information (deprecated field)"] #[serde( default, deserialize_with = "azure_core::util::deserialize_null_as_default", @@ -570,6 +998,9 @@ pub struct MachineProperties { #[doc = "Detected properties from the machine."] #[serde(rename = "detectedProperties", default, skip_serializing_if = "Option::is_none")] pub detected_properties: Option, + #[doc = "Describes the network information on this machine."] + #[serde(rename = "networkProfile", default, skip_serializing_if = "Option::is_none")] + pub network_profile: Option, } impl MachineProperties { pub fn new() -> Self { @@ -626,6 +1057,9 @@ pub struct MachineUpdate { #[doc = "Identity for the resource."] #[serde(default, skip_serializing_if = "Option::is_none")] pub identity: Option, + #[doc = "Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, #[doc = "Describes the ARM updatable properties of a hybrid machine."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, @@ -635,6 +1069,53 @@ impl MachineUpdate { Self::default() } } +pub mod machine_update { + use super::*; + #[doc = "Indicates which kind of VM fabric the instance is an instance of, such as HCI or SCVMM etc."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + #[serde(rename = "AVS")] + Avs, + #[serde(rename = "HCI")] + Hci, + #[serde(rename = "SCVMM")] + Scvmm, + VMware, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Avs => serializer.serialize_unit_variant("Kind", 0u32, "AVS"), + Self::Hci => serializer.serialize_unit_variant("Kind", 1u32, "HCI"), + Self::Scvmm => serializer.serialize_unit_variant("Kind", 2u32, "SCVMM"), + Self::VMware => serializer.serialize_unit_variant("Kind", 3u32, "VMware"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "Describes the ARM updatable properties of a hybrid machine."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct MachineUpdateProperties { @@ -644,6 +1125,12 @@ pub struct MachineUpdateProperties { #[doc = "Specifies the operating system settings for the hybrid machine."] #[serde(rename = "osProfile", default, skip_serializing_if = "Option::is_none")] pub os_profile: Option, + #[doc = "The metadata of the cloud environment (Azure/GCP/AWS/OCI...)."] + #[serde(rename = "cloudMetadata", default, skip_serializing_if = "Option::is_none")] + pub cloud_metadata: Option, + #[doc = "The info w.r.t Agent Upgrade."] + #[serde(rename = "agentUpgrade", default, skip_serializing_if = "Option::is_none")] + pub agent_upgrade: Option, #[doc = "The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any."] #[serde(rename = "parentClusterResourceId", default, skip_serializing_if = "Option::is_none")] pub parent_cluster_resource_id: Option, @@ -656,6 +1143,40 @@ impl MachineUpdateProperties { Self::default() } } +#[doc = "Describes a network interface."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkInterface { + #[doc = "The list of IP addresses in this interface."] + #[serde( + rename = "ipAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ip_addresses: Vec, +} +impl NetworkInterface { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the network information on this machine."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkProfile { + #[doc = "The list of network interfaces."] + #[serde( + rename = "networkInterfaces", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_interfaces: Vec, +} +impl NetworkProfile { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Specifies the operating system settings for the hybrid machine."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct OsProfile { @@ -735,6 +1256,9 @@ pub struct OperationValue { #[doc = "Describes the properties of a Hybrid Compute Operation Value Display."] #[serde(default, skip_serializing_if = "Option::is_none")] pub display: Option, + #[doc = "This property indicates if the operation is an action or a data action"] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, } impl OperationValue { pub fn new() -> Self { @@ -767,13 +1291,98 @@ impl OperationValueDisplay { pub struct PatchSettings { #[doc = "Specifies the assessment mode."] #[serde(rename = "assessmentMode", default, skip_serializing_if = "Option::is_none")] - pub assessment_mode: Option, + pub assessment_mode: Option, + #[doc = "Specifies the patch mode."] + #[serde(rename = "patchMode", default, skip_serializing_if = "Option::is_none")] + pub patch_mode: Option, } impl PatchSettings { pub fn new() -> Self { Self::default() } } +pub mod patch_settings { + use super::*; + #[doc = "Specifies the assessment mode."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AssessmentMode")] + pub enum AssessmentMode { + ImageDefault, + AutomaticByPlatform, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AssessmentMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AssessmentMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AssessmentMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ImageDefault => serializer.serialize_unit_variant("AssessmentMode", 0u32, "ImageDefault"), + Self::AutomaticByPlatform => serializer.serialize_unit_variant("AssessmentMode", 1u32, "AutomaticByPlatform"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Specifies the patch mode."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PatchMode")] + pub enum PatchMode { + ImageDefault, + AutomaticByPlatform, + #[serde(rename = "AutomaticByOS")] + AutomaticByOs, + Manual, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PatchMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PatchMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PatchMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ImageDefault => serializer.serialize_unit_variant("PatchMode", 0u32, "ImageDefault"), + Self::AutomaticByPlatform => serializer.serialize_unit_variant("PatchMode", 1u32, "AutomaticByPlatform"), + Self::AutomaticByOs => serializer.serialize_unit_variant("PatchMode", 2u32, "AutomaticByOS"), + Self::Manual => serializer.serialize_unit_variant("PatchMode", 3u32, "Manual"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "A private endpoint connection"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PrivateEndpointConnection { @@ -849,6 +1458,14 @@ pub struct PrivateEndpointConnectionProperties { #[doc = "State of the private endpoint connection."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, + #[doc = "List of group IDs."] + #[serde( + rename = "groupIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub group_ids: Vec, } impl PrivateEndpointConnectionProperties { pub fn new() -> Self { @@ -1073,6 +1690,9 @@ pub struct Resource { #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, } impl Resource { pub fn new() -> Self { @@ -1091,6 +1711,48 @@ impl ResourceUpdate { Self::default() } } +#[doc = "Describes the status and behavior of a service."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceStatus { + #[doc = "The current status of the service."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The behavior of the service when the Arc-enabled machine starts up."] + #[serde(rename = "startupType", default, skip_serializing_if = "Option::is_none")] + pub startup_type: Option, +} +impl ServiceStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Reports the state and behavior of dependent services."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServiceStatuses { + #[doc = "Describes the status and behavior of a service."] + #[serde(rename = "extensionService", default, skip_serializing_if = "Option::is_none")] + pub extension_service: Option, + #[doc = "Describes the status and behavior of a service."] + #[serde(rename = "guestConfigurationService", default, skip_serializing_if = "Option::is_none")] + pub guest_configuration_service: Option, +} +impl ServiceStatuses { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the subnet."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Subnet { + #[doc = "Represents address prefix."] + #[serde(rename = "addressPrefix", default, skip_serializing_if = "Option::is_none")] + pub address_prefix: Option, +} +impl Subnet { + pub fn new() -> Self { + Self::default() + } +} #[doc = "A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct TagsResource { diff --git a/services/mgmt/hybridconnectivity/src/package_2023_03/mod.rs b/services/mgmt/hybridconnectivity/src/package_2023_03/mod.rs index 9276b03264..c3ee1752f7 100644 --- a/services/mgmt/hybridconnectivity/src/package_2023_03/mod.rs +++ b/services/mgmt/hybridconnectivity/src/package_2023_03/mod.rs @@ -337,6 +337,7 @@ pub mod endpoints { resource_uri: resource_uri.into(), endpoint_name: endpoint_name.into(), expiresin: None, + list_ingress_gateway_credentials_request: None, } } #[doc = "Fetches the managed proxy details "] @@ -956,6 +957,7 @@ pub mod endpoints { pub(crate) resource_uri: String, pub(crate) endpoint_name: String, pub(crate) expiresin: Option, + pub(crate) list_ingress_gateway_credentials_request: Option, } impl RequestBuilder { #[doc = "The is how long the endpoint access token is valid (in seconds)."] @@ -963,6 +965,14 @@ pub mod endpoints { self.expiresin = Some(expiresin); self } + #[doc = "Object of type ListIngressGatewayCredentialsRequest"] + pub fn list_ingress_gateway_credentials_request( + mut self, + list_ingress_gateway_credentials_request: impl Into, + ) -> Self { + self.list_ingress_gateway_credentials_request = Some(list_ingress_gateway_credentials_request.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -990,8 +1000,13 @@ pub mod endpoints { if let Some(expiresin) = &this.expiresin { req.url_mut().query_pairs_mut().append_pair("expiresin", &expiresin.to_string()); } - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + let req_body = + if let Some(list_ingress_gateway_credentials_request) = &this.list_ingress_gateway_credentials_request { + req.insert_header("content-type", "application/json"); + azure_core::to_json(list_ingress_gateway_credentials_request)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } diff --git a/services/mgmt/hybridconnectivity/src/package_2023_03/models.rs b/services/mgmt/hybridconnectivity/src/package_2023_03/models.rs index a1ecd78b5f..f32eda01de 100644 --- a/services/mgmt/hybridconnectivity/src/package_2023_03/models.rs +++ b/services/mgmt/hybridconnectivity/src/package_2023_03/models.rs @@ -285,6 +285,60 @@ pub mod list_credentials_request { } } } +#[doc = "Represent ListIngressGatewayCredentials Request object."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ListIngressGatewayCredentialsRequest { + #[doc = "The name of the service."] + #[serde(rename = "serviceName", default, skip_serializing_if = "Option::is_none")] + pub service_name: Option, +} +impl ListIngressGatewayCredentialsRequest { + pub fn new() -> Self { + Self::default() + } +} +pub mod list_ingress_gateway_credentials_request { + use super::*; + #[doc = "The name of the service."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ServiceName")] + pub enum ServiceName { + #[serde(rename = "SSH")] + Ssh, + #[serde(rename = "WAC")] + Wac, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ServiceName { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ServiceName { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ServiceName { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Ssh => serializer.serialize_unit_variant("ServiceName", 0u32, "SSH"), + Self::Wac => serializer.serialize_unit_variant("ServiceName", 1u32, "WAC"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "Represent ManageProxy Request object."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ManagedProxyRequest { diff --git a/services/mgmt/kubernetesconfiguration/Cargo.toml b/services/mgmt/kubernetesconfiguration/Cargo.toml index 3b183da4be..8f2a3a4931 100644 --- a/services/mgmt/kubernetesconfiguration/Cargo.toml +++ b/services/mgmt/kubernetesconfiguration/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2022-11", "enable_reqwest"] +default = ["package-preview-2023-05", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-05" = [] "package-preview-2022-04" = [] "package-preview-2022-01-15" = [] "package-preview-2022-01" = [] -"package-preview-2021-11" = [] -"package-2022-11" = [] \ No newline at end of file +"package-preview-2021-11" = [] \ No newline at end of file diff --git a/services/mgmt/kubernetesconfiguration/README.md b/services/mgmt/kubernetesconfiguration/README.md index f55fedc937..ced127ff00 100644 --- a/services/mgmt/kubernetesconfiguration/README.md +++ b/services/mgmt/kubernetesconfiguration/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/kubernetes To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2022-11`. +The default tag is `package-preview-2023-05`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-05` has 10 operations from 2 API versions: `2023-05-01`, `2023-05-01-preview`. Use crate feature `package-preview-2023-05` to enable. The operations will be in the `package_preview_2023_05` module. - `package-preview-2022-04` has 30 operations from 2 API versions: `2022-03-01`, `2022-04-02-preview`. Use crate feature `package-preview-2022-04` to enable. The operations will be in the `package_preview_2022_04` module. - `package-preview-2022-01-15` has 22 operations from 2 API versions: `2022-01-01-preview`, `2022-01-15-preview`. Use crate feature `package-preview-2022-01-15` to enable. The operations will be in the `package_preview_2022_01_15` module. - `package-preview-2022-01` has 22 operations from 1 API versions: `2022-01-01-preview`. Use crate feature `package-preview-2022-01` to enable. The operations will be in the `package_preview_2022_01` module. -- `package-preview-2021-11` has 22 operations from 1 API versions: `2021-11-01-preview`. Use crate feature `package-preview-2021-11` to enable. The operations will be in the `package_preview_2021_11` module. -- `package-2022-11` has 18 operations from 1 API versions: `2022-11-01`. Use crate feature `package-2022-11` to enable. The operations will be in the `package_2022_11` module. \ No newline at end of file +- `package-preview-2021-11` has 22 operations from 1 API versions: `2021-11-01-preview`. Use crate feature `package-preview-2021-11` to enable. The operations will be in the `package_preview_2021_11` module. \ No newline at end of file diff --git a/services/mgmt/kubernetesconfiguration/src/lib.rs b/services/mgmt/kubernetesconfiguration/src/lib.rs index a7d332bd4c..580eab7eba 100644 --- a/services/mgmt/kubernetesconfiguration/src/lib.rs +++ b/services/mgmt/kubernetesconfiguration/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-05")] +pub mod package_preview_2023_05; +#[cfg(all(feature = "package-preview-2023-05", not(feature = "no-default-tag")))] +pub use package_preview_2023_05::*; #[cfg(feature = "package-preview-2022-04")] pub mod package_preview_2022_04; #[cfg(all(feature = "package-preview-2022-04", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_preview_2022_01::*; pub mod package_preview_2021_11; #[cfg(all(feature = "package-preview-2021-11", not(feature = "no-default-tag")))] pub use package_preview_2021_11::*; -#[cfg(feature = "package-2022-11")] -pub mod package_2022_11; -#[cfg(all(feature = "package-2022-11", not(feature = "no-default-tag")))] -pub use package_2022_11::*; diff --git a/services/mgmt/kubernetesconfiguration/src/package_2022_11/models.rs b/services/mgmt/kubernetesconfiguration/src/package_2022_11/models.rs deleted file mode 100644 index 42690e8935..0000000000 --- a/services/mgmt/kubernetesconfiguration/src/package_2022_11/models.rs +++ /dev/null @@ -1,1872 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "Parameters to reconcile to the AzureBlob source kind type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureBlobDefinition { - #[doc = "The URL to sync for the flux configuration Azure Blob storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, - #[doc = "The Azure Blob container name to sync from the url endpoint for the flux configuration."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The maximum time to attempt to reconcile the cluster Azure Blob source with the remote."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the cluster Azure Blob source with the remote."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "Parameters to authenticate using Service Principal."] - #[serde(rename = "servicePrincipal", default, skip_serializing_if = "Option::is_none")] - pub service_principal: Option, - #[doc = "The account key (shared key) to access the storage account"] - #[serde(rename = "accountKey", default, skip_serializing_if = "Option::is_none")] - pub account_key: Option, - #[doc = "The Shared Access token to access the storage container"] - #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] - pub sas_token: Option, - #[doc = "Parameters to authenticate using a Managed Identity."] - #[serde(rename = "managedIdentity", default, skip_serializing_if = "Option::is_none")] - pub managed_identity: Option, - #[doc = "Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets."] - #[serde(rename = "localAuthRef", default, skip_serializing_if = "Option::is_none")] - pub local_auth_ref: Option, -} -impl AzureBlobDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to reconcile to the AzureBlob source kind type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureBlobPatchDefinition { - #[doc = "The URL to sync for the flux configuration Azure Blob storage account."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, - #[doc = "The Azure Blob container name to sync from the url endpoint for the flux configuration."] - #[serde(rename = "containerName", default, skip_serializing_if = "Option::is_none")] - pub container_name: Option, - #[doc = "The maximum time to attempt to reconcile the cluster Azure Blob source with the remote."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the cluster Azure Blob source with the remote."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "Parameters to authenticate using Service Principal."] - #[serde(rename = "servicePrincipal", default, skip_serializing_if = "Option::is_none")] - pub service_principal: Option, - #[doc = "The account key (shared key) to access the storage account"] - #[serde(rename = "accountKey", default, skip_serializing_if = "Option::is_none")] - pub account_key: Option, - #[doc = "The Shared Access token to access the storage container"] - #[serde(rename = "sasToken", default, skip_serializing_if = "Option::is_none")] - pub sas_token: Option, - #[doc = "Parameters to authenticate using a Managed Identity."] - #[serde(rename = "managedIdentity", default, skip_serializing_if = "Option::is_none")] - pub managed_identity: Option, - #[doc = "Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets."] - #[serde(rename = "localAuthRef", default, skip_serializing_if = "Option::is_none")] - pub local_auth_ref: Option, -} -impl AzureBlobPatchDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to reconcile to the Bucket source kind type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BucketDefinition { - #[doc = "The URL to sync for the flux configuration S3 bucket."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, - #[doc = "The bucket name to sync from the url endpoint for the flux configuration."] - #[serde(rename = "bucketName", default, skip_serializing_if = "Option::is_none")] - pub bucket_name: Option, - #[doc = "Specify whether to use insecure communication when puling data from the S3 bucket."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub insecure: Option, - #[doc = "The maximum time to attempt to reconcile the cluster bucket source with the remote."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the cluster bucket source with the remote."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "Plaintext access key used to securely access the S3 bucket"] - #[serde(rename = "accessKey", default, skip_serializing_if = "Option::is_none")] - pub access_key: Option, - #[doc = "Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets."] - #[serde(rename = "localAuthRef", default, skip_serializing_if = "Option::is_none")] - pub local_auth_ref: Option, -} -impl BucketDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to reconcile to the Bucket source kind type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BucketPatchDefinition { - #[doc = "The URL to sync for the flux configuration S3 bucket."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, - #[doc = "The bucket name to sync from the url endpoint for the flux configuration."] - #[serde(rename = "bucketName", default, skip_serializing_if = "Option::is_none")] - pub bucket_name: Option, - #[doc = "Specify whether to use insecure communication when puling data from the S3 bucket."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub insecure: Option, - #[doc = "The maximum time to attempt to reconcile the cluster bucket source with the remote."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the cluster bucket source with the remote."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "Plaintext access key used to securely access the S3 bucket"] - #[serde(rename = "accessKey", default, skip_serializing_if = "Option::is_none")] - pub access_key: Option, - #[doc = "Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets."] - #[serde(rename = "localAuthRef", default, skip_serializing_if = "Option::is_none")] - pub local_auth_ref: Option, -} -impl BucketPatchDefinition { - pub fn new() -> Self { - Self::default() - } -} -pub type ChartValues = String; -pub type ChartVersion = String; -#[doc = "Compliance Status details"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ComplianceStatus { - #[doc = "The compliance state of the configuration."] - #[serde(rename = "complianceState", default, skip_serializing_if = "Option::is_none")] - pub compliance_state: Option, - #[doc = "Datetime the configuration was last applied."] - #[serde(rename = "lastConfigApplied", default, with = "azure_core::date::rfc3339::option")] - pub last_config_applied: Option, - #[doc = "Message from when the configuration was applied."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "Level of the message."] - #[serde(rename = "messageLevel", default, skip_serializing_if = "Option::is_none")] - pub message_level: Option, -} -impl ComplianceStatus { - pub fn new() -> Self { - Self::default() - } -} -pub mod compliance_status { - use super::*; - #[doc = "The compliance state of the configuration."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ComplianceState")] - pub enum ComplianceState { - Pending, - Compliant, - Noncompliant, - Installed, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ComplianceState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ComplianceState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ComplianceState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Pending => serializer.serialize_unit_variant("ComplianceState", 0u32, "Pending"), - Self::Compliant => serializer.serialize_unit_variant("ComplianceState", 1u32, "Compliant"), - Self::Noncompliant => serializer.serialize_unit_variant("ComplianceState", 2u32, "Noncompliant"), - Self::Installed => serializer.serialize_unit_variant("ComplianceState", 3u32, "Installed"), - Self::Failed => serializer.serialize_unit_variant("ComplianceState", 4u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "Level of the message."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "MessageLevel")] - pub enum MessageLevel { - Error, - Warning, - Information, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for MessageLevel { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for MessageLevel { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for MessageLevel { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("MessageLevel", 0u32, "Error"), - Self::Warning => serializer.serialize_unit_variant("MessageLevel", 1u32, "Warning"), - Self::Information => serializer.serialize_unit_variant("MessageLevel", 2u32, "Information"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Name-value pairs of protected configuration settings for the configuration"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ConfigurationProtectedSettings {} -impl ConfigurationProtectedSettings { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorDetail { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl ErrorDetail { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The Extension object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Extension { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "Properties of an Extension resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Identity for the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, - #[doc = "Plan for the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plan: Option, -} -impl Extension { - pub fn new() -> Self { - Self::default() - } -} -pub mod extension { - use super::*; - #[doc = "Properties of an Extension resource"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher."] - #[serde(rename = "extensionType", default, skip_serializing_if = "Option::is_none")] - pub extension_type: Option, - #[doc = "Flag to note if this extension participates in auto upgrade of minor version, or not."] - #[serde(rename = "autoUpgradeMinorVersion", default, skip_serializing_if = "Option::is_none")] - pub auto_upgrade_minor_version: Option, - #[doc = "ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'."] - #[serde(rename = "releaseTrain", default, skip_serializing_if = "Option::is_none")] - pub release_train: Option, - #[doc = "User-specified version of the extension for this extension to 'pin'. To use 'version', autoUpgradeMinorVersion must be 'false'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, - #[doc = "Scope of the extension. It can be either Cluster or Namespace; but not both."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, - #[doc = "Configuration settings, as name-value pairs for configuring this extension."] - #[serde(rename = "configurationSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_settings: Option, - #[doc = "Configuration settings that are sensitive, as name-value pairs for configuring this extension."] - #[serde(rename = "configurationProtectedSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_protected_settings: Option, - #[doc = "Currently installed version of the extension."] - #[serde(rename = "currentVersion", default, skip_serializing_if = "Option::is_none")] - pub current_version: Option, - #[doc = "The provisioning state of the resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Status from this extension."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub statuses: Vec, - #[doc = "The error detail."] - #[serde(rename = "errorInfo", default, skip_serializing_if = "Option::is_none")] - pub error_info: Option, - #[doc = "Custom Location settings properties."] - #[serde(rename = "customLocationSettings", default, skip_serializing_if = "Option::is_none")] - pub custom_location_settings: Option, - #[doc = "Uri of the Helm package"] - #[serde(rename = "packageUri", default, skip_serializing_if = "Option::is_none")] - pub package_uri: Option, - #[doc = "Identity of the Extension resource in an AKS cluster"] - #[serde(rename = "aksAssignedIdentity", default, skip_serializing_if = "Option::is_none")] - pub aks_assigned_identity: Option, - #[doc = "Flag to note if this extension is a system extension"] - #[serde(rename = "isSystemExtension", default, skip_serializing_if = "Option::is_none")] - pub is_system_extension: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } - pub mod properties { - use super::*; - #[doc = "Identity of the Extension resource in an AKS cluster"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct AksAssignedIdentity { - #[doc = "The principal ID of resource identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The tenant ID of resource."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "The identity type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl AksAssignedIdentity { - pub fn new() -> Self { - Self::default() - } - } - pub mod aks_assigned_identity { - use super::*; - #[doc = "The identity type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - SystemAssigned, - UserAssigned, - } - } - } -} -#[doc = "Status from the extension."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExtensionStatus { - #[doc = "Status code provided by the Extension"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "Short description of status of the extension."] - #[serde(rename = "displayStatus", default, skip_serializing_if = "Option::is_none")] - pub display_status: Option, - #[doc = "Level of the status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "Detailed message of the status from the Extension."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "DateLiteral (per ISO8601) noting the time of installation status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub time: Option, -} -impl ExtensionStatus { - pub fn new() -> Self { - Self::default() - } -} -pub mod extension_status { - use super::*; - #[doc = "Level of the status."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Level")] - pub enum Level { - Error, - Warning, - Information, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Level { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Level { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Level { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Error => serializer.serialize_unit_variant("Level", 0u32, "Error"), - Self::Warning => serializer.serialize_unit_variant("Level", 1u32, "Warning"), - Self::Information => serializer.serialize_unit_variant("Level", 2u32, "Information"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Level { - fn default() -> Self { - Self::Information - } - } -} -#[doc = "Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ExtensionsList { - #[doc = "List of Extensions within a Kubernetes cluster."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to get the next set of extension objects, if any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ExtensionsList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ExtensionsList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Compliance state of the cluster object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "FluxComplianceStateDefinition")] -pub enum FluxComplianceStateDefinition { - Compliant, - #[serde(rename = "Non-Compliant")] - NonCompliant, - Pending, - Suspended, - Unknown, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for FluxComplianceStateDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for FluxComplianceStateDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for FluxComplianceStateDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Compliant => serializer.serialize_unit_variant("FluxComplianceStateDefinition", 0u32, "Compliant"), - Self::NonCompliant => serializer.serialize_unit_variant("FluxComplianceStateDefinition", 1u32, "Non-Compliant"), - Self::Pending => serializer.serialize_unit_variant("FluxComplianceStateDefinition", 2u32, "Pending"), - Self::Suspended => serializer.serialize_unit_variant("FluxComplianceStateDefinition", 3u32, "Suspended"), - Self::Unknown => serializer.serialize_unit_variant("FluxComplianceStateDefinition", 4u32, "Unknown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for FluxComplianceStateDefinition { - fn default() -> Self { - Self::Unknown - } -} -#[doc = "The Flux Configuration object returned in Get & Put response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FluxConfiguration { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "Properties to create a Flux Configuration resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl FluxConfiguration { - pub fn new() -> Self { - Self::default() - } -} -pub mod flux_configuration { - use super::*; - #[doc = "Properties to create a Flux Configuration resource"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Scope at which the configuration will be installed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, - #[doc = "The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, - #[doc = "Source Kind to pull the configuration data from."] - #[serde(rename = "sourceKind", default, skip_serializing_if = "Option::is_none")] - pub source_kind: Option, - #[doc = "Whether this configuration should suspend its reconciliation of its kustomizations and sources."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub suspend: Option, - #[doc = "Parameters to reconcile to the GitRepository source kind type."] - #[serde(rename = "gitRepository", default, skip_serializing_if = "Option::is_none")] - pub git_repository: Option, - #[doc = "Parameters to reconcile to the Bucket source kind type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bucket: Option, - #[doc = "Parameters to reconcile to the AzureBlob source kind type."] - #[serde(rename = "azureBlob", default, skip_serializing_if = "Option::is_none")] - pub azure_blob: Option, - #[doc = "Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kustomizations: Option, - #[doc = "Key-value pairs of protected configuration settings for the configuration"] - #[serde(rename = "configurationProtectedSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_protected_settings: Option, - #[doc = "Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects provisioned by the fluxConfiguration."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub statuses: Vec, - #[doc = "Public Key associated with this fluxConfiguration (either generated within the cluster or provided by the user)."] - #[serde(rename = "repositoryPublicKey", default, skip_serializing_if = "Option::is_none")] - pub repository_public_key: Option, - #[doc = "Branch and/or SHA of the source commit synced with the cluster."] - #[serde(rename = "sourceSyncedCommitId", default, skip_serializing_if = "Option::is_none")] - pub source_synced_commit_id: Option, - #[doc = "Datetime the fluxConfiguration synced its source on the cluster."] - #[serde(rename = "sourceUpdatedAt", default, with = "azure_core::date::rfc3339::option")] - pub source_updated_at: Option, - #[doc = "Datetime the fluxConfiguration synced its status on the cluster with Azure."] - #[serde(rename = "statusUpdatedAt", default, with = "azure_core::date::rfc3339::option")] - pub status_updated_at: Option, - #[doc = "Compliance state of the cluster object."] - #[serde(rename = "complianceState", default, skip_serializing_if = "Option::is_none")] - pub compliance_state: Option, - #[doc = "The provisioning state of the resource."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Error message returned to the user in the case of provisioning failure."] - #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] - pub error_message: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Flux Configuration Patch Request object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FluxConfigurationPatch { - #[doc = "Updatable properties of an Flux Configuration Patch Request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl FluxConfigurationPatch { - pub fn new() -> Self { - Self::default() - } -} -pub mod flux_configuration_patch { - use super::*; - #[doc = "Updatable properties of an Flux Configuration Patch Request"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Source Kind to pull the configuration data from."] - #[serde(rename = "sourceKind", default, skip_serializing_if = "Option::is_none")] - pub source_kind: Option, - #[doc = "Whether this configuration should suspend its reconciliation of its kustomizations and sources."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub suspend: Option, - #[doc = "Parameters to reconcile to the GitRepository source kind type."] - #[serde(rename = "gitRepository", default, skip_serializing_if = "Option::is_none")] - pub git_repository: Option, - #[doc = "Parameters to reconcile to the Bucket source kind type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bucket: Option, - #[doc = "Parameters to reconcile to the AzureBlob source kind type."] - #[serde(rename = "azureBlob", default, skip_serializing_if = "Option::is_none")] - pub azure_blob: Option, - #[doc = "Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kustomizations: Option, - #[doc = "Key-value pairs of protected configuration settings for the configuration"] - #[serde(rename = "configurationProtectedSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_protected_settings: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FluxConfigurationsList { - #[doc = "List of Flux Configurations within a Kubernetes cluster."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to get the next set of configuration objects, if any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for FluxConfigurationsList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl FluxConfigurationsList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to reconcile to the GitRepository source kind type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GitRepositoryDefinition { - #[doc = "The URL to sync for the flux configuration git repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, - #[doc = "The maximum time to attempt to reconcile the cluster git repository source with the remote."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the cluster git repository source with the remote."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "The source reference for the GitRepository object."] - #[serde(rename = "repositoryRef", default, skip_serializing_if = "Option::is_none")] - pub repository_ref: Option, - #[doc = "Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH"] - #[serde(rename = "sshKnownHosts", default, skip_serializing_if = "Option::is_none")] - pub ssh_known_hosts: Option, - #[doc = "Plaintext HTTPS username used to access private git repositories over HTTPS"] - #[serde(rename = "httpsUser", default, skip_serializing_if = "Option::is_none")] - pub https_user: Option, - #[doc = "Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS"] - #[serde(rename = "httpsCACert", default, skip_serializing_if = "Option::is_none")] - pub https_ca_cert: Option, - #[doc = "Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets."] - #[serde(rename = "localAuthRef", default, skip_serializing_if = "Option::is_none")] - pub local_auth_ref: Option, -} -impl GitRepositoryDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to reconcile to the GitRepository source kind type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GitRepositoryPatchDefinition { - #[doc = "The URL to sync for the flux configuration git repository."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, - #[doc = "The maximum time to attempt to reconcile the cluster git repository source with the remote."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the cluster git repository source with the remote."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "The source reference for the GitRepository object."] - #[serde(rename = "repositoryRef", default, skip_serializing_if = "Option::is_none")] - pub repository_ref: Option, - #[doc = "Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH"] - #[serde(rename = "sshKnownHosts", default, skip_serializing_if = "Option::is_none")] - pub ssh_known_hosts: Option, - #[doc = "Plaintext HTTPS username used to access private git repositories over HTTPS"] - #[serde(rename = "httpsUser", default, skip_serializing_if = "Option::is_none")] - pub https_user: Option, - #[doc = "Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS"] - #[serde(rename = "httpsCACert", default, skip_serializing_if = "Option::is_none")] - pub https_ca_cert: Option, - #[doc = "Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets."] - #[serde(rename = "localAuthRef", default, skip_serializing_if = "Option::is_none")] - pub local_auth_ref: Option, -} -impl GitRepositoryPatchDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties for Helm operator."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HelmOperatorProperties { - #[doc = "Version of the operator Helm chart."] - #[serde(rename = "chartVersion", default, skip_serializing_if = "Option::is_none")] - pub chart_version: Option, - #[doc = "Values override for the operator Helm chart."] - #[serde(rename = "chartValues", default, skip_serializing_if = "Option::is_none")] - pub chart_values: Option, -} -impl HelmOperatorProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Properties for HelmRelease objects"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HelmReleasePropertiesDefinition { - #[doc = "The revision number of the last released object change"] - #[serde(rename = "lastRevisionApplied", default, skip_serializing_if = "Option::is_none")] - pub last_revision_applied: Option, - #[doc = "Object reference to a Kubernetes object on a cluster"] - #[serde(rename = "helmChartRef", default, skip_serializing_if = "Option::is_none")] - pub helm_chart_ref: Option, - #[doc = "Total number of times that the HelmRelease failed to install or upgrade"] - #[serde(rename = "failureCount", default, skip_serializing_if = "Option::is_none")] - pub failure_count: Option, - #[doc = "Number of times that the HelmRelease failed to install"] - #[serde(rename = "installFailureCount", default, skip_serializing_if = "Option::is_none")] - pub install_failure_count: Option, - #[doc = "Number of times that the HelmRelease failed to upgrade"] - #[serde(rename = "upgradeFailureCount", default, skip_serializing_if = "Option::is_none")] - pub upgrade_failure_count: Option, -} -impl HelmReleasePropertiesDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Identity for the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Identity { - #[doc = "The principal ID of resource identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The tenant ID of resource."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "The identity type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Identity { - pub fn new() -> Self { - Self::default() - } -} -pub mod identity { - use super::*; - #[doc = "The identity type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - SystemAssigned, - } -} -#[doc = "The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KustomizationDefinition { - #[doc = "Name of the Kustomization, matching the key in the Kustomizations object map."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The path in the source reference to reconcile on the cluster."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, - #[doc = "Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation."] - #[serde( - rename = "dependsOn", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub depends_on: Vec, - #[doc = "The maximum time to attempt to reconcile the Kustomization on the cluster."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the Kustomization on the cluster."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation."] - #[serde(rename = "retryIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub retry_interval_in_seconds: Option, - #[doc = "Enable/disable garbage collections of Kubernetes objects created by this Kustomization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub prune: Option, - #[doc = "Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub force: Option, -} -impl KustomizationDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct KustomizationPatchDefinition { - #[doc = "The path in the source reference to reconcile on the cluster."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub path: Option, - #[doc = "Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation."] - #[serde( - rename = "dependsOn", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub depends_on: Vec, - #[doc = "The maximum time to attempt to reconcile the Kustomization on the cluster."] - #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")] - pub timeout_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the Kustomization on the cluster."] - #[serde(rename = "syncIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub sync_interval_in_seconds: Option, - #[doc = "The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation."] - #[serde(rename = "retryIntervalInSeconds", default, skip_serializing_if = "Option::is_none")] - pub retry_interval_in_seconds: Option, - #[doc = "Enable/disable garbage collections of Kubernetes objects created by this Kustomization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub prune: Option, - #[doc = "Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub force: Option, -} -impl KustomizationPatchDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Specify whether to validate the Kubernetes objects referenced in the Kustomization before applying them to the cluster."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "KustomizationValidationDefinition")] -pub enum KustomizationValidationDefinition { - #[serde(rename = "none")] - None, - #[serde(rename = "client")] - Client, - #[serde(rename = "server")] - Server, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for KustomizationValidationDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for KustomizationValidationDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for KustomizationValidationDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::None => serializer.serialize_unit_variant("KustomizationValidationDefinition", 0u32, "none"), - Self::Client => serializer.serialize_unit_variant("KustomizationValidationDefinition", 1u32, "client"), - Self::Server => serializer.serialize_unit_variant("KustomizationValidationDefinition", 2u32, "server"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for KustomizationValidationDefinition { - fn default() -> Self { - Self::None - } -} -#[doc = "Parameters to authenticate using a Managed Identity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedIdentityDefinition { - #[doc = "The client Id for authenticating a Managed Identity."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, -} -impl ManagedIdentityDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to authenticate using a Managed Identity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ManagedIdentityPatchDefinition { - #[doc = "The client Id for authenticating a Managed Identity."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, -} -impl ManagedIdentityPatchDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Object reference to a Kubernetes object on a cluster"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ObjectReferenceDefinition { - #[doc = "Name of the object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Namespace of the object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, -} -impl ObjectReferenceDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Status condition of Kubernetes object"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ObjectStatusConditionDefinition { - #[doc = "Last time this status condition has changed"] - #[serde(rename = "lastTransitionTime", default, with = "azure_core::date::rfc3339::option")] - pub last_transition_time: Option, - #[doc = "A more verbose description of the object status condition"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "Reason for the specified status condition type status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, - #[doc = "Status of the Kubernetes object condition type"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Object status condition type for this object"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl ObjectStatusConditionDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Statuses of objects deployed by the user-specified kustomizations from the git repository."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ObjectStatusDefinition { - #[doc = "Name of the applied object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Namespace of the applied object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, - #[doc = "Kind of the applied object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, - #[doc = "Compliance state of the cluster object."] - #[serde(rename = "complianceState", default, skip_serializing_if = "Option::is_none")] - pub compliance_state: Option, - #[doc = "Object reference to a Kubernetes object on a cluster"] - #[serde(rename = "appliedBy", default, skip_serializing_if = "Option::is_none")] - pub applied_by: Option, - #[doc = "List of Kubernetes object status conditions present on the cluster"] - #[serde( - rename = "statusConditions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub status_conditions: Vec, - #[doc = "Properties for HelmRelease objects"] - #[serde(rename = "helmReleaseProperties", default, skip_serializing_if = "Option::is_none")] - pub helm_release_properties: Option, -} -impl ObjectStatusDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The async operations in progress, in the cluster."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OperationStatusList { - #[doc = "List of async operations in progress, in the cluster."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to get the next set of Operation Result objects, if any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for OperationStatusList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl OperationStatusList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The current status of an async operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct OperationStatusResult { - #[doc = "Fully qualified ID for the async operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Name of the async operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Operation status."] - pub status: String, - #[doc = "Additional information, if available."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl OperationStatusResult { - pub fn new(status: String) -> Self { - Self { - id: None, - name: None, - status, - properties: None, - error: None, - } - } -} -#[doc = "Scope at which the operator will be installed."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OperatorScopeDefinition")] -pub enum OperatorScopeDefinition { - #[serde(rename = "cluster")] - Cluster, - #[serde(rename = "namespace")] - Namespace, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OperatorScopeDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OperatorScopeDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OperatorScopeDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Cluster => serializer.serialize_unit_variant("OperatorScopeDefinition", 0u32, "cluster"), - Self::Namespace => serializer.serialize_unit_variant("OperatorScopeDefinition", 1u32, "namespace"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for OperatorScopeDefinition { - fn default() -> Self { - Self::Cluster - } -} -#[doc = "Type of the operator"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "OperatorTypeDefinition")] -pub enum OperatorTypeDefinition { - Flux, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for OperatorTypeDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for OperatorTypeDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for OperatorTypeDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Flux => serializer.serialize_unit_variant("OperatorTypeDefinition", 0u32, "Flux"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Plan for the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Plan { - #[doc = "A user defined name of the 3rd Party Artifact that is being procured."] - pub name: String, - #[doc = "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic"] - pub publisher: String, - #[doc = "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. "] - pub product: String, - #[doc = "A publisher provided promotion code as provisioned in Data Market for the said product/artifact."] - #[serde(rename = "promotionCode", default, skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - #[doc = "The version of the desired product/artifact."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, -} -impl Plan { - pub fn new(name: String, publisher: String, product: String) -> Self { - Self { - name, - publisher, - product, - promotion_code: None, - version: None, - } - } -} -#[doc = "The provisioning state of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ProvisioningStateDefinition")] -pub enum ProvisioningStateDefinition { - Succeeded, - Failed, - Canceled, - Creating, - Updating, - Deleting, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ProvisioningStateDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ProvisioningStateDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ProvisioningStateDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningStateDefinition", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningStateDefinition", 1u32, "Failed"), - Self::Canceled => serializer.serialize_unit_variant("ProvisioningStateDefinition", 2u32, "Canceled"), - Self::Creating => serializer.serialize_unit_variant("ProvisioningStateDefinition", 3u32, "Creating"), - Self::Updating => serializer.serialize_unit_variant("ProvisioningStateDefinition", 4u32, "Updating"), - Self::Deleting => serializer.serialize_unit_variant("ProvisioningStateDefinition", 5u32, "Deleting"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProxyResource { - #[serde(flatten)] - pub resource: Resource, -} -impl ProxyResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The source reference for the GitRepository object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RepositoryRefDefinition { - #[doc = "The git repository branch name to checkout."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub branch: Option, - #[doc = "The git repository tag name to checkout. This takes precedence over branch."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag: Option, - #[doc = "The semver range used to match against git repository tags. This takes precedence over tag."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub semver: Option, - #[doc = "The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub commit: Option, -} -impl RepositoryRefDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Supported operation of this resource provider."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceProviderOperation { - #[doc = "Operation name, in format of {provider}/{resource}/{operation}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Display metadata associated with the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, - #[doc = "The flag that indicates whether the operation applies to data plane."] - #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] - pub is_data_action: Option, - #[doc = "Origin of the operation"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option, -} -impl ResourceProviderOperation { - pub fn new() -> Self { - Self::default() - } -} -pub mod resource_provider_operation { - use super::*; - #[doc = "Display metadata associated with the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Display { - #[doc = "Resource provider: Microsoft KubernetesConfiguration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[doc = "Resource on which the operation is performed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "Type of operation: get, read, delete, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, - #[doc = "Description of this operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - } - impl Display { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Result of the request to list operations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceProviderOperationList { - #[doc = "List of operations supported by this resource provider."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to the next set of results, if any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ResourceProviderOperationList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ResourceProviderOperationList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Scope of the extension. It can be either Cluster or Namespace; but not both."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Scope { - #[doc = "Specifies that the scope of the extension is Cluster"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub cluster: Option, - #[doc = "Specifies that the scope of the extension is Namespace"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub namespace: Option, -} -impl Scope { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Specifies that the scope of the extension is Cluster"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScopeCluster { - #[doc = "Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created"] - #[serde(rename = "releaseNamespace", default, skip_serializing_if = "Option::is_none")] - pub release_namespace: Option, -} -impl ScopeCluster { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Scope at which the configuration will be installed."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScopeDefinition")] -pub enum ScopeDefinition { - #[serde(rename = "cluster")] - Cluster, - #[serde(rename = "namespace")] - Namespace, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScopeDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScopeDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScopeDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Cluster => serializer.serialize_unit_variant("ScopeDefinition", 0u32, "cluster"), - Self::Namespace => serializer.serialize_unit_variant("ScopeDefinition", 1u32, "namespace"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -impl Default for ScopeDefinition { - fn default() -> Self { - Self::Cluster - } -} -#[doc = "Specifies that the scope of the extension is Namespace"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScopeNamespace { - #[doc = "Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created"] - #[serde(rename = "targetNamespace", default, skip_serializing_if = "Option::is_none")] - pub target_namespace: Option, -} -impl ScopeNamespace { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to authenticate using Service Principal."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalDefinition { - #[doc = "The client Id for authenticating a Service Principal."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "The tenant Id for authenticating a Service Principal"] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "The client secret for authenticating a Service Principal"] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[doc = "Base64-encoded certificate used to authenticate a Service Principal "] - #[serde(rename = "clientCertificate", default, skip_serializing_if = "Option::is_none")] - pub client_certificate: Option, - #[doc = "The password for the certificate used to authenticate a Service Principal "] - #[serde(rename = "clientCertificatePassword", default, skip_serializing_if = "Option::is_none")] - pub client_certificate_password: Option, - #[doc = "Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication for the Client Certificate"] - #[serde(rename = "clientCertificateSendChain", default, skip_serializing_if = "Option::is_none")] - pub client_certificate_send_chain: Option, -} -impl ServicePrincipalDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Parameters to authenticate using Service Principal."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServicePrincipalPatchDefinition { - #[doc = "The client Id for authenticating a Service Principal."] - #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[doc = "The tenant Id for authenticating a Service Principal"] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "The client secret for authenticating a Service Principal"] - #[serde(rename = "clientSecret", default, skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[doc = "Base64-encoded certificate used to authenticate a Service Principal "] - #[serde(rename = "clientCertificate", default, skip_serializing_if = "Option::is_none")] - pub client_certificate: Option, - #[doc = "The password for the certificate used to authenticate a Service Principal "] - #[serde(rename = "clientCertificatePassword", default, skip_serializing_if = "Option::is_none")] - pub client_certificate_password: Option, - #[doc = "Specifies whether to include x5c header in client claims when acquiring a token to enable subject name / issuer based authentication for the Client Certificate"] - #[serde(rename = "clientCertificateSendChain", default, skip_serializing_if = "Option::is_none")] - pub client_certificate_send_chain: Option, -} -impl ServicePrincipalPatchDefinition { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The SourceControl Configuration object returned in Get & Put response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SourceControlConfiguration { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "Properties to create a Source Control Configuration resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl SourceControlConfiguration { - pub fn new() -> Self { - Self::default() - } -} -pub mod source_control_configuration { - use super::*; - #[doc = "Properties to create a Source Control Configuration resource"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Url of the SourceControl Repository."] - #[serde(rename = "repositoryUrl", default, skip_serializing_if = "Option::is_none")] - pub repository_url: Option, - #[doc = "The namespace to which this operator is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only."] - #[serde(rename = "operatorNamespace", default, skip_serializing_if = "Option::is_none")] - pub operator_namespace: Option, - #[doc = "Instance name of the operator - identifying the specific configuration."] - #[serde(rename = "operatorInstanceName", default, skip_serializing_if = "Option::is_none")] - pub operator_instance_name: Option, - #[doc = "Type of the operator"] - #[serde(rename = "operatorType", default, skip_serializing_if = "Option::is_none")] - pub operator_type: Option, - #[doc = "Any Parameters for the Operator instance in string format."] - #[serde(rename = "operatorParams", default, skip_serializing_if = "Option::is_none")] - pub operator_params: Option, - #[doc = "Name-value pairs of protected configuration settings for the configuration"] - #[serde(rename = "configurationProtectedSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_protected_settings: Option, - #[doc = "Scope at which the operator will be installed."] - #[serde(rename = "operatorScope", default, skip_serializing_if = "Option::is_none")] - pub operator_scope: Option, - #[doc = "Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user)."] - #[serde(rename = "repositoryPublicKey", default, skip_serializing_if = "Option::is_none")] - pub repository_public_key: Option, - #[doc = "Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances"] - #[serde(rename = "sshKnownHostsContents", default, skip_serializing_if = "Option::is_none")] - pub ssh_known_hosts_contents: Option, - #[doc = "Option to enable Helm Operator for this git configuration."] - #[serde(rename = "enableHelmOperator", default, skip_serializing_if = "Option::is_none")] - pub enable_helm_operator: Option, - #[doc = "Properties for Helm operator."] - #[serde(rename = "helmOperatorProperties", default, skip_serializing_if = "Option::is_none")] - pub helm_operator_properties: Option, - #[doc = "The provisioning state of the resource provider."] - #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] - pub provisioning_state: Option, - #[doc = "Compliance Status details"] - #[serde(rename = "complianceStatus", default, skip_serializing_if = "Option::is_none")] - pub compliance_status: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } - pub mod properties { - use super::*; - #[doc = "The provisioning state of the resource provider."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ProvisioningState")] - pub enum ProvisioningState { - Accepted, - Deleting, - Running, - Succeeded, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ProvisioningState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ProvisioningState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ProvisioningState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"), - Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Deleting"), - Self::Running => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Running"), - Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } -} -#[doc = "Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SourceControlConfigurationList { - #[doc = "List of Source Control Configurations within a Kubernetes cluster."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL to get the next set of configuration objects, if any."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for SourceControlConfigurationList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl SourceControlConfigurationList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Source Kind to pull the configuration data from."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "SourceKindDefinition")] -pub enum SourceKindDefinition { - GitRepository, - Bucket, - AzureBlob, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for SourceKindDefinition { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for SourceKindDefinition { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for SourceKindDefinition { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::GitRepository => serializer.serialize_unit_variant("SourceKindDefinition", 0u32, "GitRepository"), - Self::Bucket => serializer.serialize_unit_variant("SourceKindDefinition", 1u32, "Bucket"), - Self::AzureBlob => serializer.serialize_unit_variant("SourceKindDefinition", 2u32, "AzureBlob"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The Extension Patch Request object."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct PatchExtension { - #[doc = "Updatable properties of an Extension Patch Request"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl PatchExtension { - pub fn new() -> Self { - Self::default() - } -} -pub mod patch_extension { - use super::*; - #[doc = "Updatable properties of an Extension Patch Request"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Properties { - #[doc = "Flag to note if this extension participates in auto upgrade of minor version, or not."] - #[serde(rename = "autoUpgradeMinorVersion", default, skip_serializing_if = "Option::is_none")] - pub auto_upgrade_minor_version: Option, - #[doc = "ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'."] - #[serde(rename = "releaseTrain", default, skip_serializing_if = "Option::is_none")] - pub release_train: Option, - #[doc = "Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, - #[doc = "Configuration settings, as name-value pairs for configuring this extension."] - #[serde(rename = "configurationSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_settings: Option, - #[doc = "Configuration settings that are sensitive, as name-value pairs for configuring this extension."] - #[serde(rename = "configurationProtectedSettings", default, skip_serializing_if = "Option::is_none")] - pub configuration_protected_settings: Option, - } - impl Properties { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/mod.rs b/services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/mod.rs new file mode 100644 index 0000000000..cc5d74645a --- /dev/null +++ b/services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/mod.rs @@ -0,0 +1,1522 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn extension_types_client(&self) -> extension_types::Client { + extension_types::Client(self.clone()) + } + pub fn operation_status_client(&self) -> operation_status::Client { + operation_status::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } +} +pub mod extension_types { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all Extension Types for the location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The name of Azure region."] + pub fn location_list(&self, subscription_id: impl Into, location: impl Into) -> location_list::RequestBuilder { + location_list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + publisher_id: None, + offer_id: None, + plan_id: None, + release_train: None, + cluster_type: None, + } + } + #[doc = "Get an extension type for the location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The name of Azure region."] + #[doc = "* `extension_type_name`: Name of the Extension Type."] + pub fn location_get( + &self, + subscription_id: impl Into, + location: impl Into, + extension_type_name: impl Into, + ) -> location_get::RequestBuilder { + location_get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + extension_type_name: extension_type_name.into(), + } + } + #[doc = "List the versions for an extension type and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The name of Azure region."] + #[doc = "* `extension_type_name`: Name of the Extension Type."] + pub fn list_versions( + &self, + subscription_id: impl Into, + location: impl Into, + extension_type_name: impl Into, + ) -> list_versions::RequestBuilder { + list_versions::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + extension_type_name: extension_type_name.into(), + release_train: None, + cluster_type: None, + major_version: None, + show_latest: None, + } + } + #[doc = "Get details of a version for an extension type and location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location`: The name of Azure region."] + #[doc = "* `extension_type_name`: Name of the Extension Type."] + #[doc = "* `version_number`: Version number of the Extension Type."] + pub fn get_version( + &self, + subscription_id: impl Into, + location: impl Into, + extension_type_name: impl Into, + version_number: impl Into, + ) -> get_version::RequestBuilder { + get_version::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location: location.into(), + extension_type_name: extension_type_name.into(), + version_number: version_number.into(), + } + } + #[doc = "List installable Extension Types for the cluster based region and type for the cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cluster_rp`: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService."] + #[doc = "* `cluster_resource_name`: The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters, appliances."] + #[doc = "* `cluster_name`: The name of the kubernetes cluster."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_rp: impl Into, + cluster_resource_name: impl Into, + cluster_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_rp: cluster_rp.into(), + cluster_resource_name: cluster_resource_name.into(), + cluster_name: cluster_name.into(), + publisher_id: None, + offer_id: None, + plan_id: None, + release_train: None, + } + } + #[doc = "Get an Extension Type installable to the cluster based region and type for the cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cluster_rp`: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService."] + #[doc = "* `cluster_resource_name`: The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters, appliances."] + #[doc = "* `cluster_name`: The name of the kubernetes cluster."] + #[doc = "* `extension_type_name`: Name of the Extension Type."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_rp: impl Into, + cluster_resource_name: impl Into, + cluster_name: impl Into, + extension_type_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_rp: cluster_rp.into(), + cluster_resource_name: cluster_resource_name.into(), + cluster_name: cluster_name.into(), + extension_type_name: extension_type_name.into(), + } + } + #[doc = "List the version for an Extension Type installable to the cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cluster_rp`: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService."] + #[doc = "* `cluster_resource_name`: The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters, appliances."] + #[doc = "* `cluster_name`: The name of the kubernetes cluster."] + #[doc = "* `extension_type_name`: Name of the Extension Type."] + pub fn cluster_list_versions( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_rp: impl Into, + cluster_resource_name: impl Into, + cluster_name: impl Into, + extension_type_name: impl Into, + ) -> cluster_list_versions::RequestBuilder { + cluster_list_versions::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_rp: cluster_rp.into(), + cluster_resource_name: cluster_resource_name.into(), + cluster_name: cluster_name.into(), + extension_type_name: extension_type_name.into(), + release_train: None, + major_version: None, + show_latest: None, + } + } + #[doc = "Get details of a version for an Extension Type installable to the cluster."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cluster_rp`: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService."] + #[doc = "* `cluster_resource_name`: The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters, appliances."] + #[doc = "* `cluster_name`: The name of the kubernetes cluster."] + #[doc = "* `extension_type_name`: Name of the Extension Type."] + #[doc = "* `version_number`: Version number of the Extension Type."] + pub fn cluster_get_version( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_rp: impl Into, + cluster_resource_name: impl Into, + cluster_name: impl Into, + extension_type_name: impl Into, + version_number: impl Into, + ) -> cluster_get_version::RequestBuilder { + cluster_get_version::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_rp: cluster_rp.into(), + cluster_resource_name: cluster_resource_name.into(), + cluster_name: cluster_name.into(), + extension_type_name: extension_type_name.into(), + version_number: version_number.into(), + } + } + } + pub mod location_list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTypesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) publisher_id: Option, + pub(crate) offer_id: Option, + pub(crate) plan_id: Option, + pub(crate) release_train: Option, + pub(crate) cluster_type: Option, + } + impl RequestBuilder { + #[doc = "Filter results by Publisher ID of a marketplace extension type"] + pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { + self.publisher_id = Some(publisher_id.into()); + self + } + #[doc = "Filter results by Offer or Product ID of a marketplace extension type"] + pub fn offer_id(mut self, offer_id: impl Into) -> Self { + self.offer_id = Some(offer_id.into()); + self + } + #[doc = "Filter results by Plan ID of a marketplace extension type"] + pub fn plan_id(mut self, plan_id: impl Into) -> Self { + self.plan_id = Some(plan_id.into()); + self + } + #[doc = "Filter results by release train (default value is stable)"] + pub fn release_train(mut self, release_train: impl Into) -> Self { + self.release_train = Some(release_train.into()); + self + } + #[doc = "Filter results by the cluster type for extension types"] + pub fn cluster_type(mut self, cluster_type: impl Into) -> Self { + self.cluster_type = Some(cluster_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.KubernetesConfiguration/locations/{}/extensionTypes", + this.client.endpoint(), + &this.subscription_id, + &this.location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut().query_pairs_mut().append_pair("publisherId", publisher_id); + } + if let Some(offer_id) = &this.offer_id { + req.url_mut().query_pairs_mut().append_pair("offerId", offer_id); + } + if let Some(plan_id) = &this.plan_id { + req.url_mut().query_pairs_mut().append_pair("planId", plan_id); + } + if let Some(release_train) = &this.release_train { + req.url_mut().query_pairs_mut().append_pair("releaseTrain", release_train); + } + if let Some(cluster_type) = &this.cluster_type { + req.url_mut().query_pairs_mut().append_pair("clusterType", cluster_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod location_get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionType = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) extension_type_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.KubernetesConfiguration/locations/{}/extensionTypes/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.extension_type_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_versions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTypeVersionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) extension_type_name: String, + pub(crate) release_train: Option, + pub(crate) cluster_type: Option, + pub(crate) major_version: Option, + pub(crate) show_latest: Option, + } + impl RequestBuilder { + #[doc = "Filter results by release train (default value is stable)"] + pub fn release_train(mut self, release_train: impl Into) -> Self { + self.release_train = Some(release_train.into()); + self + } + #[doc = "Filter results by the cluster type for extension types"] + pub fn cluster_type(mut self, cluster_type: impl Into) -> Self { + self.cluster_type = Some(cluster_type.into()); + self + } + #[doc = "Filter results by the major version of an extension type"] + pub fn major_version(mut self, major_version: impl Into) -> Self { + self.major_version = Some(major_version.into()); + self + } + #[doc = "Filter results by only the latest version (based on other query parameters)"] + pub fn show_latest(mut self, show_latest: bool) -> Self { + self.show_latest = Some(show_latest); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.KubernetesConfiguration/locations/{}/extensionTypes/{}/versions", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.extension_type_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(release_train) = &this.release_train { + req.url_mut().query_pairs_mut().append_pair("releaseTrain", release_train); + } + if let Some(cluster_type) = &this.cluster_type { + req.url_mut().query_pairs_mut().append_pair("clusterType", cluster_type); + } + if let Some(major_version) = &this.major_version { + req.url_mut().query_pairs_mut().append_pair("majorVersion", major_version); + } + if let Some(show_latest) = &this.show_latest { + req.url_mut().query_pairs_mut().append_pair("showLatest", &show_latest.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTypeVersionForReleaseTrain = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location: String, + pub(crate) extension_type_name: String, + pub(crate) version_number: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.KubernetesConfiguration/locations/{}/extensionTypes/{}/versions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.extension_type_name, + &this.version_number + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTypesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_rp: String, + pub(crate) cluster_resource_name: String, + pub(crate) cluster_name: String, + pub(crate) publisher_id: Option, + pub(crate) offer_id: Option, + pub(crate) plan_id: Option, + pub(crate) release_train: Option, + } + impl RequestBuilder { + #[doc = "Filter results by Publisher ID of a marketplace extension type"] + pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { + self.publisher_id = Some(publisher_id.into()); + self + } + #[doc = "Filter results by Offer or Product ID of a marketplace extension type"] + pub fn offer_id(mut self, offer_id: impl Into) -> Self { + self.offer_id = Some(offer_id.into()); + self + } + #[doc = "Filter results by Plan ID of a marketplace extension type"] + pub fn plan_id(mut self, plan_id: impl Into) -> Self { + self.plan_id = Some(plan_id.into()); + self + } + #[doc = "Filter results by release train (default value is stable)"] + pub fn release_train(mut self, release_train: impl Into) -> Self { + self.release_train = Some(release_train.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.KubernetesConfiguration/extensionTypes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_rp , & this . cluster_resource_name , & this . cluster_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut().query_pairs_mut().append_pair("publisherId", publisher_id); + } + if let Some(offer_id) = &this.offer_id { + req.url_mut().query_pairs_mut().append_pair("offerId", offer_id); + } + if let Some(plan_id) = &this.plan_id { + req.url_mut().query_pairs_mut().append_pair("planId", plan_id); + } + if let Some(release_train) = &this.release_train { + req.url_mut().query_pairs_mut().append_pair("releaseTrain", release_train); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionType = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_rp: String, + pub(crate) cluster_resource_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_type_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_rp , & this . cluster_resource_name , & this . cluster_name , & this . extension_type_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod cluster_list_versions { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTypeVersionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_rp: String, + pub(crate) cluster_resource_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_type_name: String, + pub(crate) release_train: Option, + pub(crate) major_version: Option, + pub(crate) show_latest: Option, + } + impl RequestBuilder { + #[doc = "Filter results by release train (default value is stable)"] + pub fn release_train(mut self, release_train: impl Into) -> Self { + self.release_train = Some(release_train.into()); + self + } + #[doc = "Filter results by the major version of an extension type"] + pub fn major_version(mut self, major_version: impl Into) -> Self { + self.major_version = Some(major_version.into()); + self + } + #[doc = "Filter results by only the latest version (based on other query parameters)"] + pub fn show_latest(mut self, show_latest: bool) -> Self { + self.show_latest = Some(show_latest); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{}/versions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_rp , & this . cluster_resource_name , & this . cluster_name , & this . extension_type_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(release_train) = &this.release_train { + req.url_mut().query_pairs_mut().append_pair("releaseTrain", release_train); + } + if let Some(major_version) = &this.major_version { + req.url_mut().query_pairs_mut().append_pair("majorVersion", major_version); + } + if let Some(show_latest) = &this.show_latest { + req.url_mut().query_pairs_mut().append_pair("showLatest", &show_latest.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod cluster_get_version { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExtensionTypeVersionForReleaseTrain = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_rp: String, + pub(crate) cluster_resource_name: String, + pub(crate) cluster_name: String, + pub(crate) extension_type_name: String, + pub(crate) version_number: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{}/versions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_rp , & this . cluster_resource_name , & this . cluster_name , & this . extension_type_name , & this . version_number)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod operation_status { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List Async Operations, currently in progress, in a cluster"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cluster_rp`: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService."] + #[doc = "* `cluster_resource_name`: The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters."] + #[doc = "* `cluster_name`: The name of the kubernetes cluster."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cluster_rp: impl Into, + cluster_resource_name: impl Into, + cluster_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cluster_rp: cluster_rp.into(), + cluster_resource_name: cluster_resource_name.into(), + cluster_name: cluster_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationStatusList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cluster_rp: String, + pub(crate) cluster_resource_name: String, + pub(crate) cluster_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.KubernetesConfiguration/operations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cluster_rp , & this . cluster_resource_name , & this . cluster_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the available operations the KubernetesConfiguration resource provider supports."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ResourceProviderOperationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.KubernetesConfiguration/operations", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} diff --git a/services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/models.rs b/services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/models.rs new file mode 100644 index 0000000000..0d8f33a347 --- /dev/null +++ b/services/mgmt/kubernetesconfiguration/src/package_preview_2023_05/models.rs @@ -0,0 +1,496 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Extension scope settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ClusterScopeSettings { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Extension scope settings"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ClusterScopeSettings { + pub fn new() -> Self { + Self::default() + } +} +pub mod cluster_scope_settings { + use super::*; + #[doc = "Extension scope settings"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Describes if multiple instances of the extension are allowed"] + #[serde(rename = "allowMultipleInstances", default, skip_serializing_if = "Option::is_none")] + pub allow_multiple_instances: Option, + #[doc = "Default extension release namespace"] + #[serde(rename = "defaultReleaseNamespace", default, skip_serializing_if = "Option::is_none")] + pub default_release_namespace: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Extension Type object."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionType { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ExtensionType { + pub fn new() -> Self { + Self::default() + } +} +pub mod extension_type { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "Is this Extension Type a system extension."] + #[serde(rename = "isSystemExtension", default, skip_serializing_if = "Option::is_none")] + pub is_system_extension: Option, + #[doc = "Should an identity for this cluster resource be created"] + #[serde(rename = "isManagedIdentityRequired", default, skip_serializing_if = "Option::is_none")] + pub is_managed_identity_required: Option, + #[doc = "Description of the extension type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Name of the publisher for the Extension Type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "Plan information only for the Marketplace Extension Type."] + #[serde(rename = "planInfo", default, skip_serializing_if = "Option::is_none")] + pub plan_info: Option, + #[doc = "Cluster Types supported for this Extension Type."] + #[serde( + rename = "supportedClusterTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_cluster_types: Vec, + #[doc = "Supported Kubernetes Scopes for this Extension Type."] + #[serde(rename = "supportedScopes", default, skip_serializing_if = "Option::is_none")] + pub supported_scopes: Option, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } + pub mod properties { + use super::*; + #[doc = "Plan information only for the Marketplace Extension Type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct PlanInfo { + #[doc = "Publisher ID of the Marketplace Extension Type."] + #[serde(rename = "publisherId", default, skip_serializing_if = "Option::is_none")] + pub publisher_id: Option, + #[doc = "Plan ID of the Marketplace Extension Type."] + #[serde(rename = "planId", default, skip_serializing_if = "Option::is_none")] + pub plan_id: Option, + #[doc = "Offer or Product ID of the Marketplace Extension Type."] + #[serde(rename = "offerId", default, skip_serializing_if = "Option::is_none")] + pub offer_id: Option, + } + impl PlanInfo { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "Supported Kubernetes Scopes for this Extension Type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SupportedScopes { + #[doc = "The default scope of the extension type. This scope will be used if the user does not provide a scope while creating an extension."] + #[serde(rename = "defaultScope", default, skip_serializing_if = "Option::is_none")] + pub default_scope: Option, + #[doc = "Extension scope settings"] + #[serde(rename = "clusterScopeSettings", default, skip_serializing_if = "Option::is_none")] + pub cluster_scope_settings: Option, + } + impl SupportedScopes { + pub fn new() -> Self { + Self::default() + } + } + } +} +#[doc = "The Extension Type Version object."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionTypeVersionForReleaseTrain { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ExtensionTypeVersionForReleaseTrain { + pub fn new() -> Self { + Self::default() + } +} +pub mod extension_type_version_for_release_train { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Properties { + #[doc = "The version number for the extension type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "The list of supported Kubernetes cluster versions for this extension type"] + #[serde(rename = "unsupportedKubernetesVersions", default, skip_serializing_if = "Option::is_none")] + pub unsupported_kubernetes_versions: Option, + #[doc = "A list of supported cluster types for this version of the Extension Type"] + #[serde( + rename = "supportedClusterTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_cluster_types: Vec, + } + impl Properties { + pub fn new() -> Self { + Self::default() + } + } + pub mod properties { + use super::*; + #[doc = "The list of supported Kubernetes cluster versions for this extension type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct UnsupportedKubernetesVersions { + #[serde(rename = "connectedCluster", default, skip_serializing_if = "Option::is_none")] + pub connected_cluster: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub appliances: Option, + #[serde(rename = "provisionedCluster", default, skip_serializing_if = "Option::is_none")] + pub provisioned_cluster: Option, + #[serde(rename = "managedCluster", default, skip_serializing_if = "Option::is_none")] + pub managed_cluster: Option, + } + impl UnsupportedKubernetesVersions { + pub fn new() -> Self { + Self::default() + } + } + } +} +pub type ExtensionTypeVersionUnsupportedKubernetesMatrix = Vec; +#[doc = "List Extension Type Versions. It contains a list of ExtensionTypeVersionForReleaseTrain objects."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionTypeVersionsList { + #[doc = "List of Extension Type Versions for an Extension Type in a Release Train."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of extension objects, if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExtensionTypeVersionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExtensionTypeVersionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List Extension Types. It contains a list of ExtensionType objects and a URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtensionTypesList { + #[doc = "List of Extension Types."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of extension type objects, if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExtensionTypesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExtensionTypesList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The async operations in progress, in the cluster."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationStatusList { + #[doc = "List of async operations in progress, in the cluster."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of Operation Result objects, if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationStatusList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationStatusList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The current status of an async operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationStatusResult { + #[doc = "Fully qualified ID for the async operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the async operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Operation status."] + pub status: String, + #[doc = "Additional information, if available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl OperationStatusResult { + pub fn new(status: String) -> Self { + Self { + id: None, + name: None, + status, + properties: None, + error: None, + } + } +} +#[doc = "The provisioning state of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ProvisioningStateDefinition")] +pub enum ProvisioningStateDefinition { + Succeeded, + Failed, + Canceled, + Creating, + Updating, + Deleting, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ProvisioningStateDefinition { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ProvisioningStateDefinition { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ProvisioningStateDefinition { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningStateDefinition", 0u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningStateDefinition", 1u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningStateDefinition", 2u32, "Canceled"), + Self::Creating => serializer.serialize_unit_variant("ProvisioningStateDefinition", 3u32, "Creating"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningStateDefinition", 4u32, "Updating"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningStateDefinition", 5u32, "Deleting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Supported operation of this resource provider."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceProviderOperation { + #[doc = "Operation name, in format of {provider}/{resource}/{operation}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Display metadata associated with the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The flag that indicates whether the operation applies to data plane."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Origin of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, +} +impl ResourceProviderOperation { + pub fn new() -> Self { + Self::default() + } +} +pub mod resource_provider_operation { + use super::*; + #[doc = "Display metadata associated with the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "Resource provider: Microsoft KubernetesConfiguration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "Resource on which the operation is performed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "Type of operation: get, read, delete, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "Description of this operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Result of the request to list operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceProviderOperationList { + #[doc = "List of operations supported by this resource provider."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to the next set of results, if any."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ResourceProviderOperationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ResourceProviderOperationList { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/liftrqumulo/Cargo.toml b/services/mgmt/liftrqumulo/Cargo.toml index 9de23e9fe9..70a161e760 100644 --- a/services/mgmt/liftrqumulo/Cargo.toml +++ b/services/mgmt/liftrqumulo/Cargo.toml @@ -32,9 +32,10 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2022-10-12-preview", "enable_reqwest"] +default = ["package-2022-10", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] "package-2022-10-12-preview" = [] +"package-2022-10" = [] "package-2022-06-27-preview" = [] \ No newline at end of file diff --git a/services/mgmt/liftrqumulo/README.md b/services/mgmt/liftrqumulo/README.md index fbe4c6665a..4edf3ee453 100644 --- a/services/mgmt/liftrqumulo/README.md +++ b/services/mgmt/liftrqumulo/README.md @@ -6,9 +6,10 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/liftrqumul To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2022-10-12-preview`. +The default tag is `package-2022-10`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: - `package-2022-10-12-preview` has 7 operations from 1 API versions: `2022-10-12-preview`. Use crate feature `package-2022-10-12-preview` to enable. The operations will be in the `package_2022_10_12_preview` module. +- `package-2022-10` has 7 operations from 1 API versions: `2022-10-12`. Use crate feature `package-2022-10` to enable. The operations will be in the `package_2022_10` module. - `package-2022-06-27-preview` has 7 operations from 1 API versions: `2022-06-27-preview`. Use crate feature `package-2022-06-27-preview` to enable. The operations will be in the `package_2022_06_27_preview` module. \ No newline at end of file diff --git a/services/mgmt/liftrqumulo/src/lib.rs b/services/mgmt/liftrqumulo/src/lib.rs index 631a799979..58a3d3cc6d 100644 --- a/services/mgmt/liftrqumulo/src/lib.rs +++ b/services/mgmt/liftrqumulo/src/lib.rs @@ -7,6 +7,10 @@ pub mod package_2022_10_12_preview; #[cfg(all(feature = "package-2022-10-12-preview", not(feature = "no-default-tag")))] pub use package_2022_10_12_preview::*; +#[cfg(feature = "package-2022-10")] +pub mod package_2022_10; +#[cfg(all(feature = "package-2022-10", not(feature = "no-default-tag")))] +pub use package_2022_10::*; #[cfg(feature = "package-2022-06-27-preview")] pub mod package_2022_06_27_preview; #[cfg(all(feature = "package-2022-06-27-preview", not(feature = "no-default-tag")))] diff --git a/services/mgmt/security/src/package_preview_2022_08/mod.rs b/services/mgmt/liftrqumulo/src/package_2022_10/mod.rs similarity index 76% rename from services/mgmt/security/src/package_preview_2022_08/mod.rs rename to services/mgmt/liftrqumulo/src/package_2022_10/mod.rs index df7a9c25c4..5a5514acc6 100644 --- a/services/mgmt/security/src/package_preview_2022_08/mod.rs +++ b/services/mgmt/liftrqumulo/src/package_2022_10/mod.rs @@ -103,29 +103,144 @@ impl Client { pipeline, } } - pub fn security_connectors_client(&self) -> security_connectors::Client { - security_connectors::Client(self.clone()) + pub fn file_systems_client(&self) -> file_systems::Client { + file_systems::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the operations for the provider"] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!("{}/providers/Qumulo.Storage/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } } } -pub mod security_connectors { +pub mod file_systems { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription."] + #[doc = "List FileSystemResource resources by subscription ID"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), } } - #[doc = "Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group."] + #[doc = "List FileSystemResource resources by resource group"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] pub fn list_by_resource_group( &self, subscription_id: impl Into, @@ -137,96 +252,96 @@ pub mod security_connectors { resource_group_name: resource_group_name.into(), } } - #[doc = "Retrieves details of a specific security connector"] + #[doc = "Get a FileSystemResource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `file_system_name`: Name of the File System resource"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, + file_system_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), + file_system_name: file_system_name.into(), } } - #[doc = "Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated."] + #[doc = "Create a FileSystemResource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `security_connector`: The security connector resource"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `file_system_name`: Name of the File System resource"] + #[doc = "* `resource`: Resource create parameters."] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, - security_connector: impl Into, + file_system_name: impl Into, + resource: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - security_connector: security_connector.into(), + file_system_name: file_system_name.into(), + resource: resource.into(), } } - #[doc = "Updates a security connector"] + #[doc = "Update a FileSystemResource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] - #[doc = "* `security_connector`: The security connector resource"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `file_system_name`: Name of the File System resource"] + #[doc = "* `properties`: The resource properties to be updated."] pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, - security_connector: impl Into, + file_system_name: impl Into, + properties: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), - security_connector: security_connector.into(), + file_system_name: file_system_name.into(), + properties: properties.into(), } } - #[doc = "Deletes a security connector."] + #[doc = "Delete a FileSystemResource"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: Azure subscription ID"] - #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] - #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `file_system_name`: Name of the File System resource"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - security_connector_name: impl Into, + file_system_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - security_connector_name: security_connector_name.into(), + file_system_name: file_system_name.into(), } } } - pub mod list { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + let body: models::FileSystemResourceListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -266,12 +381,12 @@ pub mod security_connectors { pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.Security/securityConnectors", + "{}/subscriptions/{}/providers/Qumulo.Storage/fileSystems", this.client.endpoint(), &this.subscription_id ))?; @@ -291,7 +406,7 @@ pub mod security_connectors { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -307,7 +422,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -331,9 +446,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + let body: models::FileSystemResourceListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -374,12 +489,12 @@ pub mod security_connectors { pub(crate) resource_group_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors", + "{}/subscriptions/{}/resourceGroups/{}/providers/Qumulo.Storage/fileSystems", this.client.endpoint(), &this.subscription_id, &this.resource_group_name @@ -400,7 +515,7 @@ pub mod security_connectors { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -416,7 +531,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -440,9 +555,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + let body: models::FileSystemResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -481,7 +596,7 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, + pub(crate) file_system_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -493,11 +608,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Qumulo.Storage/fileSystems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.file_system_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -508,7 +623,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -517,8 +632,8 @@ pub mod security_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -533,9 +648,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + let body: models::FileSystemResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -574,10 +689,11 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) security_connector: models::SecurityConnector, + pub(crate) file_system_name: String, + pub(crate) resource: models::FileSystemResource, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -587,11 +703,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Qumulo.Storage/fileSystems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.file_system_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -602,9 +718,9 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.security_connector)?; + let req_body = azure_core::to_json(&this.resource)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -612,8 +728,8 @@ pub mod security_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -628,9 +744,9 @@ pub mod security_connectors { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + let body: models::FileSystemResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -669,8 +785,8 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, - pub(crate) security_connector: models::SecurityConnector, + pub(crate) file_system_name: String, + pub(crate) properties: models::FileSystemResourceUpdate, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -682,11 +798,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Qumulo.Storage/fileSystems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.file_system_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -697,9 +813,9 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.security_connector)?; + let req_body = azure_core::to_json(&this.properties)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -707,8 +823,8 @@ pub mod security_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -741,9 +857,10 @@ pub mod security_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) security_connector_name: String, + pub(crate) file_system_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -753,11 +870,11 @@ pub mod security_connectors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Qumulo.Storage/fileSystems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.security_connector_name + &this.file_system_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -768,7 +885,7 @@ pub mod security_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-10-12"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) diff --git a/services/mgmt/liftrqumulo/src/package_2022_10/models.rs b/services/mgmt/liftrqumulo/src/package_2022_10/models.rs new file mode 100644 index 0000000000..f6dcbe8600 --- /dev/null +++ b/services/mgmt/liftrqumulo/src/package_2022_10/models.rs @@ -0,0 +1,688 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A FileSystem Resource by Qumulo"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileSystemResource { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Properties specific to the Qumulo File System resource"] + pub properties: FileSystemResourceProperties, + #[doc = "Name of the File System resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl FileSystemResource { + pub fn new(tracked_resource: TrackedResource, properties: FileSystemResourceProperties) -> Self { + Self { + tracked_resource, + properties, + name: None, + identity: None, + } + } +} +#[doc = "The response of a FileSystemResource list operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileSystemResourceListResult { + #[doc = "The FileSystemResource items on this page"] + pub value: Vec, + #[doc = "The link to the next page of items"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for FileSystemResourceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl FileSystemResourceListResult { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Properties specific to the Qumulo File System resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileSystemResourceProperties { + #[doc = "MarketplaceDetails of Qumulo FileSystem resource"] + #[serde(rename = "marketplaceDetails")] + pub marketplace_details: MarketplaceDetails, + #[doc = "Provisioning State of the File system resource"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Storage Sku"] + #[serde(rename = "storageSku")] + pub storage_sku: StorageSku, + #[doc = "User Details of Qumulo FileSystem resource"] + #[serde(rename = "userDetails")] + pub user_details: UserDetails, + #[doc = "Delegated subnet id for Vnet injection"] + #[serde(rename = "delegatedSubnetId")] + pub delegated_subnet_id: String, + #[doc = "File system Id of the resource"] + #[serde(rename = "clusterLoginUrl", default, skip_serializing_if = "Option::is_none")] + pub cluster_login_url: Option, + #[doc = "Private IPs of the resource"] + #[serde( + rename = "privateIPs", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_i_ps: Vec, + #[doc = "Initial administrator password of the resource"] + #[serde(rename = "adminPassword")] + pub admin_password: String, + #[doc = "Storage capacity in TB"] + #[serde(rename = "initialCapacity")] + pub initial_capacity: i32, + #[doc = "Availability zone"] + #[serde(rename = "availabilityZone", default, skip_serializing_if = "Option::is_none")] + pub availability_zone: Option, +} +impl FileSystemResourceProperties { + pub fn new( + marketplace_details: MarketplaceDetails, + storage_sku: StorageSku, + user_details: UserDetails, + delegated_subnet_id: String, + admin_password: String, + initial_capacity: i32, + ) -> Self { + Self { + marketplace_details, + provisioning_state: None, + storage_sku, + user_details, + delegated_subnet_id, + cluster_login_url: None, + private_i_ps: Vec::new(), + admin_password, + initial_capacity, + availability_zone: None, + } + } +} +#[doc = "The type used for update operations of the FileSystemResource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FileSystemResourceUpdate { + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The updatable properties of the FileSystemResource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl FileSystemResourceUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The updatable properties of the FileSystemResource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FileSystemResourceUpdateProperties { + #[doc = "MarketplaceDetails of Qumulo FileSystem resource"] + #[serde(rename = "marketplaceDetails", default, skip_serializing_if = "Option::is_none")] + pub marketplace_details: Option, + #[doc = "User Details of Qumulo FileSystem resource"] + #[serde(rename = "userDetails", default, skip_serializing_if = "Option::is_none")] + pub user_details: Option, + #[doc = "Delegated subnet id for Vnet injection"] + #[serde(rename = "delegatedSubnetId", default, skip_serializing_if = "Option::is_none")] + pub delegated_subnet_id: Option, + #[doc = "File system Id of the resource"] + #[serde(rename = "clusterLoginUrl", default, skip_serializing_if = "Option::is_none")] + pub cluster_login_url: Option, + #[doc = "Private IPs of the resource"] + #[serde( + rename = "privateIPs", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub private_i_ps: Vec, +} +impl FileSystemResourceUpdateProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ManagedServiceIdentity { + #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] + #[serde(rename = "type")] + pub type_: ManagedServiceIdentityType, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl ManagedServiceIdentity { + pub fn new(type_: ManagedServiceIdentityType) -> Self { + Self { + principal_id: None, + tenant_id: None, + type_, + user_assigned_identities: None, + } + } +} +#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ManagedServiceIdentityType")] +pub enum ManagedServiceIdentityType { + None, + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ManagedServiceIdentityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ManagedServiceIdentityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ManagedServiceIdentityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => { + serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned, UserAssigned") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "MarketplaceDetails of Qumulo FileSystem resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MarketplaceDetails { + #[doc = "Marketplace Subscription Id"] + #[serde(rename = "marketplaceSubscriptionId", default, skip_serializing_if = "Option::is_none")] + pub marketplace_subscription_id: Option, + #[doc = "Plan Id"] + #[serde(rename = "planId")] + pub plan_id: String, + #[doc = "Offer Id"] + #[serde(rename = "offerId")] + pub offer_id: String, + #[doc = "Publisher Id"] + #[serde(rename = "publisherId")] + pub publisher_id: String, + #[doc = "Marketplace subscription status of the file system resource"] + #[serde(rename = "marketplaceSubscriptionStatus", default, skip_serializing_if = "Option::is_none")] + pub marketplace_subscription_status: Option, +} +impl MarketplaceDetails { + pub fn new(plan_id: String, offer_id: String, publisher_id: String) -> Self { + Self { + marketplace_subscription_id: None, + plan_id, + offer_id, + publisher_id, + marketplace_subscription_status: None, + } + } +} +#[doc = "Marketplace subscription status of the file system resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum MarketplaceSubscriptionStatus { + PendingFulfillmentStart, + Subscribed, + Suspended, + Unsubscribed, +} +#[doc = "Details of a REST API operation, returned from the Resource Provider Operations API"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for ARM/control-plane operations."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Localized display information for this particular operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[serde(rename = "actionType", default, skip_serializing_if = "Option::is_none")] + pub action_type: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "Localized display information for this particular operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\"."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The short, localized friendly description of the operation; suitable for tool tips and detailed views."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\""] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(rename = "user,system")] + UserSystem, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("Origin", 0u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 1u32, "system"), + Self::UserSystem => serializer.serialize_unit_variant("Origin", 2u32, "user,system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + Internal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Internal => serializer.serialize_unit_variant("ActionType", 0u32, "Internal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "List of operations supported by the resource provider"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL to get the next set of operation list results (if there are any)."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Provisioning State of the File system resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum ProvisioningState { + Accepted, + Creating, + Updating, + Deleting, + Succeeded, + Failed, + Canceled, + Deleted, + NotSpecified, +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Storage Sku"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum StorageSku { + Standard, + Performance, +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User assigned identity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client ID of the assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User Details of Qumulo FileSystem resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserDetails { + #[doc = "User Email"] + pub email: String, +} +impl UserDetails { + pub fn new(email: String) -> Self { + Self { email } + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs b/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs index dab47e7136..cf6c88f842 100644 --- a/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs +++ b/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview/models.rs @@ -1762,6 +1762,9 @@ pub struct ServerPropertiesForUpdate { #[doc = "The date encryption for cmk."] #[serde(rename = "dataEncryption", default, skip_serializing_if = "Option::is_none")] pub data_encryption: Option, + #[doc = "Network related properties of a server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub network: Option, } impl ServerPropertiesForUpdate { pub fn new() -> Self { diff --git a/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview_privatelink/mod.rs b/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview_privatelink/mod.rs index 2f9ab1a833..9a66da06b8 100644 --- a/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview_privatelink/mod.rs +++ b/services/mgmt/mysql/src/package_flexibleserver_2022_09_30_preview_privatelink/mod.rs @@ -3462,7 +3462,7 @@ pub mod location_based_capabilities { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3478,7 +3478,7 @@ pub mod location_based_capabilities { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -3594,7 +3594,7 @@ pub mod check_virtual_network_subnet_usage { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -3712,7 +3712,7 @@ pub mod check_name_availability { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.name_availability_request)?; req.set_body(req_body); @@ -3825,7 +3825,7 @@ pub mod check_name_availability_without_location { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.name_availability_request)?; req.set_body(req_body); @@ -3923,7 +3923,7 @@ pub mod get_private_dns_zone_suffix { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -4022,7 +4022,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4038,7 +4038,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-12-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-09-30-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? diff --git a/services/mgmt/portalservices/src/package_2023_01_01_preview/models.rs b/services/mgmt/portalservices/src/package_2023_01_01_preview/models.rs index b9c4567f82..e80ccf58e0 100644 --- a/services/mgmt/portalservices/src/package_2023_01_01_preview/models.rs +++ b/services/mgmt/portalservices/src/package_2023_01_01_preview/models.rs @@ -64,18 +64,24 @@ impl ErrorResponse { } } #[doc = "The contents of the file to compile."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PortalTenantCompileFile { #[doc = "The contents of the file."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub contents: Option, + pub contents: serde_json::Value, #[doc = "The contents of the string source."] #[serde(rename = "stringSource", default, skip_serializing_if = "Option::is_none")] pub string_source: Option, + #[doc = "The contents of referenced files. The property name is the relative file path and the value is its contents."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub files: Option, } impl PortalTenantCompileFile { - pub fn new() -> Self { - Self::default() + pub fn new(contents: serde_json::Value) -> Self { + Self { + contents, + string_source: None, + files: None, + } } } #[doc = "The runtime result of source compilation"] diff --git a/services/mgmt/postgresql/Cargo.toml b/services/mgmt/postgresql/Cargo.toml index bebd394bbd..3dbe18e7b4 100644 --- a/services/mgmt/postgresql/Cargo.toml +++ b/services/mgmt/postgresql/Cargo.toml @@ -36,8 +36,8 @@ default = ["package-flexibleserver-2022-12-01", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-flexibleserver-2023-03-01-preview" = [] "package-flexibleserver-2022-12-01" = [] "package-flexibleserver-2022-03-privatepreview" = [] "package-flexibleserver-2022-03-preview" = [] -"package-flexibleserver-2022-01-preview" = [] -"package-flexibleserver-2021-06-preview" = [] \ No newline at end of file +"package-flexibleserver-2022-01-preview" = [] \ No newline at end of file diff --git a/services/mgmt/postgresql/README.md b/services/mgmt/postgresql/README.md index b04edb03f9..079c774c7a 100644 --- a/services/mgmt/postgresql/README.md +++ b/services/mgmt/postgresql/README.md @@ -10,8 +10,8 @@ The default tag is `package-flexibleserver-2022-12-01`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-flexibleserver-2023-03-01-preview` has 46 operations from 1 API versions: `2023-03-01-preview`. Use crate feature `package-flexibleserver-2023-03-01-preview` to enable. The operations will be in the `package_flexibleserver_2023_03_01_preview` module. - `package-flexibleserver-2022-12-01` has 34 operations from 1 API versions: `2022-12-01`. Use crate feature `package-flexibleserver-2022-12-01` to enable. The operations will be in the `package_flexibleserver_2022_12_01` module. - `package-flexibleserver-2022-03-privatepreview` has 29 operations from 2 API versions: `2022-01-20-preview`, `2022-03-08-privatepreview`. Use crate feature `package-flexibleserver-2022-03-privatepreview` to enable. The operations will be in the `package_flexibleserver_2022_03_privatepreview` module. - `package-flexibleserver-2022-03-preview` has 34 operations from 1 API versions: `2022-03-08-preview`. Use crate feature `package-flexibleserver-2022-03-preview` to enable. The operations will be in the `package_flexibleserver_2022_03_preview` module. -- `package-flexibleserver-2022-01-preview` has 28 operations from 1 API versions: `2022-01-20-preview`. Use crate feature `package-flexibleserver-2022-01-preview` to enable. The operations will be in the `package_flexibleserver_2022_01_preview` module. -- `package-flexibleserver-2021-06-preview` has 34 operations from 2 API versions: `2021-03-31-privatepreview`, `2021-06-01-preview`. Use crate feature `package-flexibleserver-2021-06-preview` to enable. The operations will be in the `package_flexibleserver_2021_06_preview` module. \ No newline at end of file +- `package-flexibleserver-2022-01-preview` has 28 operations from 1 API versions: `2022-01-20-preview`. Use crate feature `package-flexibleserver-2022-01-preview` to enable. The operations will be in the `package_flexibleserver_2022_01_preview` module. \ No newline at end of file diff --git a/services/mgmt/postgresql/src/lib.rs b/services/mgmt/postgresql/src/lib.rs index efdf15711b..9ba2e576f2 100644 --- a/services/mgmt/postgresql/src/lib.rs +++ b/services/mgmt/postgresql/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-flexibleserver-2023-03-01-preview")] +pub mod package_flexibleserver_2023_03_01_preview; +#[cfg(all(feature = "package-flexibleserver-2023-03-01-preview", not(feature = "no-default-tag")))] +pub use package_flexibleserver_2023_03_01_preview::*; #[cfg(feature = "package-flexibleserver-2022-12-01")] pub mod package_flexibleserver_2022_12_01; #[cfg(all(feature = "package-flexibleserver-2022-12-01", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_flexibleserver_2022_03_preview::*; pub mod package_flexibleserver_2022_01_preview; #[cfg(all(feature = "package-flexibleserver-2022-01-preview", not(feature = "no-default-tag")))] pub use package_flexibleserver_2022_01_preview::*; -#[cfg(feature = "package-flexibleserver-2021-06-preview")] -pub mod package_flexibleserver_2021_06_preview; -#[cfg(all(feature = "package-flexibleserver-2021-06-preview", not(feature = "no-default-tag")))] -pub use package_flexibleserver_2021_06_preview::*; diff --git a/services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/models.rs b/services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/models.rs deleted file mode 100644 index 0415b5a695..0000000000 --- a/services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/models.rs +++ /dev/null @@ -1,2124 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "Represents a recommendation action advisor."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Advisor { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a recommendation action advisor."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Advisor { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a recommendation action advisor."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AdvisorProperties {} -impl AdvisorProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of query statistics."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AdvisorsResultList { - #[doc = "The list of recommendation action advisors."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for AdvisorsResultList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl AdvisorsResultList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Backup properties of a server"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Backup { - #[doc = "Backup retention days for the server."] - #[serde(rename = "backupRetentionDays", default, skip_serializing_if = "Option::is_none")] - pub backup_retention_days: Option, - #[doc = "A value indicating whether Geo-Redundant backup is enabled on the server."] - #[serde(rename = "geoRedundantBackup", default, skip_serializing_if = "Option::is_none")] - pub geo_redundant_backup: Option, - #[doc = "The earliest restore point time (ISO8601 format) for server."] - #[serde(rename = "earliestRestoreDate", default, with = "azure_core::date::rfc3339::option")] - pub earliest_restore_date: Option, -} -impl Backup { - pub fn new() -> Self { - Self::default() - } -} -pub mod backup { - use super::*; - #[doc = "A value indicating whether Geo-Redundant backup is enabled on the server."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "GeoRedundantBackup")] - pub enum GeoRedundantBackup { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for GeoRedundantBackup { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for GeoRedundantBackup { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for GeoRedundantBackup { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("GeoRedundantBackup", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("GeoRedundantBackup", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for GeoRedundantBackup { - fn default() -> Self { - Self::Disabled - } - } -} -#[doc = "location capability"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CapabilitiesListResult { - #[doc = "A list of supported capabilities."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for CapabilitiesListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl CapabilitiesListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Location capabilities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CapabilityProperties { - #[doc = "zone name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub zone: Option, - #[doc = "A value indicating whether a new server in this region can have geo-backups to paired region."] - #[serde(rename = "geoBackupSupported", default, skip_serializing_if = "Option::is_none")] - pub geo_backup_supported: Option, - #[doc = "A value indicating whether a new server in this region can support multi zone HA."] - #[serde(rename = "zoneRedundantHaSupported", default, skip_serializing_if = "Option::is_none")] - pub zone_redundant_ha_supported: Option, - #[doc = "A value indicating whether a new server in this region can have geo-backups to paired region."] - #[serde(rename = "zoneRedundantHaAndGeoBackupSupported", default, skip_serializing_if = "Option::is_none")] - pub zone_redundant_ha_and_geo_backup_supported: Option, - #[serde( - rename = "supportedFlexibleServerEditions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_flexible_server_editions: Vec, - #[serde( - rename = "supportedHyperscaleNodeEditions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_hyperscale_node_editions: Vec, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl CapabilityProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An error response from the Batch service."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudError { - #[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for CloudError { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl CloudError { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a Configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Configuration { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl Configuration { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of server configurations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ConfigurationListResult { - #[doc = "The list of server configurations."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The link used to get the next page of operations."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ConfigurationListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ConfigurationListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ConfigurationProperties { - #[doc = "Value of the configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "Description of the configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Default value of the configuration."] - #[serde(rename = "defaultValue", default, skip_serializing_if = "Option::is_none")] - pub default_value: Option, - #[doc = "Data type of the configuration."] - #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] - pub data_type: Option, - #[doc = "Allowed values of the configuration."] - #[serde(rename = "allowedValues", default, skip_serializing_if = "Option::is_none")] - pub allowed_values: Option, - #[doc = "Source of the configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "Configuration dynamic or static."] - #[serde(rename = "isDynamicConfig", default, skip_serializing_if = "Option::is_none")] - pub is_dynamic_config: Option, - #[doc = "Configuration read-only or not."] - #[serde(rename = "isReadOnly", default, skip_serializing_if = "Option::is_none")] - pub is_read_only: Option, - #[doc = "Configuration is pending restart or not."] - #[serde(rename = "isConfigPendingRestart", default, skip_serializing_if = "Option::is_none")] - pub is_config_pending_restart: Option, - #[doc = "Configuration unit."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unit: Option, - #[doc = "Configuration documentation link."] - #[serde(rename = "documentationLink", default, skip_serializing_if = "Option::is_none")] - pub documentation_link: Option, -} -impl ConfigurationProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod configuration_properties { - use super::*; - #[doc = "Data type of the configuration."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "DataType")] - pub enum DataType { - Boolean, - Numeric, - Integer, - Enumeration, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for DataType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for DataType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for DataType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Boolean => serializer.serialize_unit_variant("DataType", 0u32, "Boolean"), - Self::Numeric => serializer.serialize_unit_variant("DataType", 1u32, "Numeric"), - Self::Integer => serializer.serialize_unit_variant("DataType", 2u32, "Integer"), - Self::Enumeration => serializer.serialize_unit_variant("DataType", 3u32, "Enumeration"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Represents a Database."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Database { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a database."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl Database { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A List of databases."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabaseListResult { - #[doc = "The list of databases housed in a server"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The link used to get the next page of databases."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for DatabaseListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl DatabaseListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a database."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DatabaseProperties { - #[doc = "The charset of the database."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub charset: Option, - #[doc = "The collation of the database."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub collation: Option, -} -impl DatabaseProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Delegated subnet usage data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct DelegatedSubnetUsage { - #[doc = "name of the subnet"] - #[serde(rename = "subnetName", default, skip_serializing_if = "Option::is_none")] - pub subnet_name: Option, - #[doc = "Number of used delegated subnets"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub usage: Option, -} -impl DelegatedSubnetUsage { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a server firewall rule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FirewallRule { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a server firewall rule."] - pub properties: FirewallRuleProperties, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl FirewallRule { - pub fn new(properties: FirewallRuleProperties) -> Self { - Self { - proxy_resource: ProxyResource::default(), - properties, - system_data: None, - } - } -} -#[doc = "A list of firewall rules."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FirewallRuleListResult { - #[doc = "The list of firewall rules in a server."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The link used to get the next page of operations."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for FirewallRuleListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl FirewallRuleListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a server firewall rule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct FirewallRuleProperties { - #[doc = "The start IP address of the server firewall rule. Must be IPv4 format."] - #[serde(rename = "startIpAddress")] - pub start_ip_address: String, - #[doc = "The end IP address of the server firewall rule. Must be IPv4 format."] - #[serde(rename = "endIpAddress")] - pub end_ip_address: String, -} -impl FirewallRuleProperties { - pub fn new(start_ip_address: String, end_ip_address: String) -> Self { - Self { - start_ip_address, - end_ip_address, - } - } -} -#[doc = "Flexible server edition capabilities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct FlexibleServerEditionCapability { - #[doc = "Server edition name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The list of editions supported by this server edition."] - #[serde( - rename = "supportedStorageEditions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_storage_editions: Vec, - #[doc = "The list of server versions supported by this server edition."] - #[serde( - rename = "supportedServerVersions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_server_versions: Vec, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl FlexibleServerEditionCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "High availability properties of a server"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HighAvailability { - #[doc = "The HA mode for the server."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[doc = "A state of a HA server that is visible to user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "availability zone information of the standby."] - #[serde(rename = "standbyAvailabilityZone", default, skip_serializing_if = "Option::is_none")] - pub standby_availability_zone: Option, -} -impl HighAvailability { - pub fn new() -> Self { - Self::default() - } -} -pub mod high_availability { - use super::*; - #[doc = "The HA mode for the server."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Mode")] - pub enum Mode { - Disabled, - ZoneRedundant, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Mode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Mode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Mode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Disabled => serializer.serialize_unit_variant("Mode", 0u32, "Disabled"), - Self::ZoneRedundant => serializer.serialize_unit_variant("Mode", 1u32, "ZoneRedundant"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - impl Default for Mode { - fn default() -> Self { - Self::Disabled - } - } - #[doc = "A state of a HA server that is visible to user."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "State")] - pub enum State { - NotEnabled, - CreatingStandby, - ReplicatingData, - FailingOver, - Healthy, - RemovingStandby, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for State { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for State { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for State { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotEnabled => serializer.serialize_unit_variant("State", 0u32, "NotEnabled"), - Self::CreatingStandby => serializer.serialize_unit_variant("State", 1u32, "CreatingStandby"), - Self::ReplicatingData => serializer.serialize_unit_variant("State", 2u32, "ReplicatingData"), - Self::FailingOver => serializer.serialize_unit_variant("State", 3u32, "FailingOver"), - Self::Healthy => serializer.serialize_unit_variant("State", 4u32, "Healthy"), - Self::RemovingStandby => serializer.serialize_unit_variant("State", 5u32, "RemovingStandby"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Hyperscale node edition capabilities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HyperscaleNodeEditionCapability { - #[doc = "Server edition name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The list of editions supported by this server edition."] - #[serde( - rename = "supportedStorageEditions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_storage_editions: Vec, - #[doc = "The list of server versions supported by this server edition."] - #[serde( - rename = "supportedServerVersions", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_server_versions: Vec, - #[doc = "The list of Node Types supported by this server edition."] - #[serde( - rename = "supportedNodeTypes", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_node_types: Vec, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl HyperscaleNodeEditionCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Maintenance window properties of a server."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct MaintenanceWindow { - #[doc = "indicates whether custom window is enabled or disabled"] - #[serde(rename = "customWindow", default, skip_serializing_if = "Option::is_none")] - pub custom_window: Option, - #[doc = "start hour for maintenance window"] - #[serde(rename = "startHour", default, skip_serializing_if = "Option::is_none")] - pub start_hour: Option, - #[doc = "start minute for maintenance window"] - #[serde(rename = "startMinute", default, skip_serializing_if = "Option::is_none")] - pub start_minute: Option, - #[doc = "day of week for maintenance window"] - #[serde(rename = "dayOfWeek", default, skip_serializing_if = "Option::is_none")] - pub day_of_week: Option, -} -impl MaintenanceWindow { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a resource name availability."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NameAvailability { - #[doc = "Error Message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "Indicates whether the resource name is available."] - #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] - pub name_available: Option, - #[doc = "name of the PostgreSQL server."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "type of the server"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The name availability reason."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, -} -impl NameAvailability { - pub fn new() -> Self { - Self::default() - } -} -pub mod name_availability { - use super::*; - #[doc = "The name availability reason."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Reason")] - pub enum Reason { - Invalid, - AlreadyExists, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Reason { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Reason { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Reason { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Invalid => serializer.serialize_unit_variant("Reason", 0u32, "Invalid"), - Self::AlreadyExists => serializer.serialize_unit_variant("Reason", 1u32, "AlreadyExists"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Request from client to check resource name availability."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct NameAvailabilityRequest { - #[doc = "Resource name to verify."] - pub name: String, - #[doc = "Resource type used for verification."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl NameAvailabilityRequest { - pub fn new(name: String) -> Self { - Self { name, type_: None } - } -} -#[doc = "Network properties of a server"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Network { - #[doc = "public network access is enabled or not"] - #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] - pub public_network_access: Option, - #[doc = "delegated subnet arm resource id."] - #[serde(rename = "delegatedSubnetResourceId", default, skip_serializing_if = "Option::is_none")] - pub delegated_subnet_resource_id: Option, - #[doc = "private dns zone arm resource id."] - #[serde(rename = "privateDnsZoneArmResourceId", default, skip_serializing_if = "Option::is_none")] - pub private_dns_zone_arm_resource_id: Option, -} -impl Network { - pub fn new() -> Self { - Self::default() - } -} -pub mod network { - use super::*; - #[doc = "public network access is enabled or not"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "PublicNetworkAccess")] - pub enum PublicNetworkAccess { - Enabled, - Disabled, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for PublicNetworkAccess { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for PublicNetworkAccess { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for PublicNetworkAccess { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), - Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "node type capability"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct NodeTypeCapability { - #[doc = "note type name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "note type"] - #[serde(rename = "nodeType", default, skip_serializing_if = "Option::is_none")] - pub node_type: Option, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl NodeTypeCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "REST API operation definition."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Operation { - #[doc = "The name of the operation being performed on this particular object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Display metadata associated with the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, - #[doc = "Indicates whether the operation is a data action"] - #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] - pub is_data_action: Option, - #[doc = "The intended executor of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub origin: Option, - #[doc = "Additional descriptions for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Operation { - pub fn new() -> Self { - Self::default() - } -} -pub mod operation { - use super::*; - #[doc = "The intended executor of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Origin")] - pub enum Origin { - NotSpecified, - #[serde(rename = "user")] - User, - #[serde(rename = "system")] - System, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Origin { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Origin { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Origin { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NotSpecified => serializer.serialize_unit_variant("Origin", 0u32, "NotSpecified"), - Self::User => serializer.serialize_unit_variant("Origin", 1u32, "user"), - Self::System => serializer.serialize_unit_variant("Origin", 2u32, "system"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Display metadata associated with the operation."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OperationDisplay { - #[doc = "Operation resource provider name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[doc = "Resource on which the operation is performed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub resource: Option, - #[doc = "Localized friendly name for the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operation: Option, - #[doc = "Operation description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl OperationDisplay { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of resource provider operations."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct OperationListResult { - #[doc = "Collection of available operation details"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "URL client should use to fetch the next page (per server side paging).\r\nIt's null for now, added for future use."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl OperationListResult { - pub fn new() -> Self { - Self::default() - } -} -pub type PrivateDnsZoneSuffix = String; -#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ProxyResource { - #[serde(flatten)] - pub resource: Resource, -} -impl ProxyResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Result of Query Performance Insight data reset."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryPerformanceInsightResetDataResult { - #[doc = "Indicates result of the operation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "result operation message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, -} -impl QueryPerformanceInsightResetDataResult { - pub fn new() -> Self { - Self::default() - } -} -pub mod query_performance_insight_reset_data_result { - use super::*; - #[doc = "Indicates result of the operation."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Status")] - pub enum Status { - Succeeded, - Failed, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Status { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Status { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Succeeded => serializer.serialize_unit_variant("Status", 0u32, "Succeeded"), - Self::Failed => serializer.serialize_unit_variant("Status", 1u32, "Failed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Represents a Query Statistic."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryStatistic { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a query statistic."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl QueryStatistic { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a query statistic."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryStatisticProperties { - #[doc = "Database query identifier."] - #[serde(rename = "queryId", default, skip_serializing_if = "Option::is_none")] - pub query_id: Option, - #[doc = "Observation start time."] - #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] - pub start_time: Option, - #[doc = "Observation end time."] - #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] - pub end_time: Option, - #[doc = "Aggregation function name."] - #[serde(rename = "aggregationFunction", default, skip_serializing_if = "Option::is_none")] - pub aggregation_function: Option, - #[doc = "The list of database names."] - #[serde( - rename = "databaseNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub database_names: Vec, - #[doc = "Number of query executions in this time interval."] - #[serde(rename = "queryExecutionCount", default, skip_serializing_if = "Option::is_none")] - pub query_execution_count: Option, - #[doc = "Metric name."] - #[serde(rename = "metricName", default, skip_serializing_if = "Option::is_none")] - pub metric_name: Option, - #[doc = "Metric display name."] - #[serde(rename = "metricDisplayName", default, skip_serializing_if = "Option::is_none")] - pub metric_display_name: Option, - #[doc = "Metric value."] - #[serde(rename = "metricValue", default, skip_serializing_if = "Option::is_none")] - pub metric_value: Option, - #[doc = "Metric value unit."] - #[serde(rename = "metricValueUnit", default, skip_serializing_if = "Option::is_none")] - pub metric_value_unit: Option, -} -impl QueryStatisticProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a Query Text."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryText { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a query text."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl QueryText { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a query text."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryTextProperties { - #[doc = "Query identifier unique to the server."] - #[serde(rename = "queryId", default, skip_serializing_if = "Option::is_none")] - pub query_id: Option, - #[doc = "Query text."] - #[serde(rename = "queryText", default, skip_serializing_if = "Option::is_none")] - pub query_text: Option, -} -impl QueryTextProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of query texts."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryTextsResultList { - #[doc = "The list of query texts."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for QueryTextsResultList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl QueryTextsResultList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a Recommendation Action."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecommendationAction { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a recommendation action."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl RecommendationAction { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a recommendation action."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecommendationActionProperties { - #[doc = "Advisor name."] - #[serde(rename = "advisorName", default, skip_serializing_if = "Option::is_none")] - pub advisor_name: Option, - #[doc = "Recommendation action session identifier."] - #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")] - pub session_id: Option, - #[doc = "Recommendation action identifier."] - #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")] - pub action_id: Option, - #[doc = "Recommendation action creation time."] - #[serde(rename = "createdTime", default, with = "azure_core::date::rfc3339::option")] - pub created_time: Option, - #[doc = "Recommendation action expiration time."] - #[serde(rename = "expirationTime", default, with = "azure_core::date::rfc3339::option")] - pub expiration_time: Option, - #[doc = "Recommendation action reason."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, - #[doc = "Recommendation action type."] - #[serde(rename = "recommendationType", default, skip_serializing_if = "Option::is_none")] - pub recommendation_type: Option, - #[doc = "Recommendation action details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub details: Option, -} -impl RecommendationActionProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of recommendation actions."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RecommendationActionsResultList { - #[doc = "The list of recommendation action advisors."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for RecommendationActionsResultList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl RecommendationActionsResultList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents server restart parameters."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RestartParameter { - #[doc = "Indicates whether to restart the server with failover."] - #[serde(rename = "restartWithFailover", default, skip_serializing_if = "Option::is_none")] - pub restart_with_failover: Option, - #[doc = "Failover mode."] - #[serde(rename = "failoverMode", default, skip_serializing_if = "Option::is_none")] - pub failover_mode: Option, -} -impl RestartParameter { - pub fn new() -> Self { - Self::default() - } -} -pub mod restart_parameter { - use super::*; - #[doc = "Failover mode."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "FailoverMode")] - pub enum FailoverMode { - PlannedFailover, - ForcedFailover, - PlannedSwitchover, - ForcedSwitchover, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for FailoverMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for FailoverMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for FailoverMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::PlannedFailover => serializer.serialize_unit_variant("FailoverMode", 0u32, "PlannedFailover"), - Self::ForcedFailover => serializer.serialize_unit_variant("FailoverMode", 1u32, "ForcedFailover"), - Self::PlannedSwitchover => serializer.serialize_unit_variant("FailoverMode", 2u32, "PlannedSwitchover"), - Self::ForcedSwitchover => serializer.serialize_unit_variant("FailoverMode", 3u32, "ForcedSwitchover"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Represents a server."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Server { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Sku information related properties of a server."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[doc = "The properties of a server."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, -} -impl Server { - pub fn new(tracked_resource: TrackedResource) -> Self { - Self { - tracked_resource, - sku: None, - properties: None, - system_data: None, - } - } -} -#[doc = "Represents a server to be updated."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServerForUpdate { - #[doc = "The location the resource resides in."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "Sku information related properties of a server."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub sku: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, - #[doc = "Application-specific metadata in the form of key-value pairs."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl ServerForUpdate { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of servers."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServerListResult { - #[doc = "The list of flexible servers"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The link used to get the next page of operations."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ServerListResult { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ServerListResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a server."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServerProperties { - #[doc = "The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation)."] - #[serde(rename = "administratorLogin", default, skip_serializing_if = "Option::is_none")] - pub administrator_login: Option, - #[doc = "The administrator login password (required for server creation)."] - #[serde(rename = "administratorLoginPassword", default, skip_serializing_if = "Option::is_none")] - pub administrator_login_password: Option, - #[doc = "The version of a server."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, - #[doc = "The minor version of the server."] - #[serde(rename = "minorVersion", default, skip_serializing_if = "Option::is_none")] - pub minor_version: Option, - #[doc = "A state of a server that is visible to user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The fully qualified domain name of a server."] - #[serde(rename = "fullyQualifiedDomainName", default, skip_serializing_if = "Option::is_none")] - pub fully_qualified_domain_name: Option, - #[doc = "Storage properties of a server"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub storage: Option, - #[doc = "Backup properties of a server"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub backup: Option, - #[doc = "Network properties of a server"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub network: Option, - #[doc = "High availability properties of a server"] - #[serde(rename = "highAvailability", default, skip_serializing_if = "Option::is_none")] - pub high_availability: Option, - #[doc = "Maintenance window properties of a server."] - #[serde(rename = "maintenanceWindow", default, skip_serializing_if = "Option::is_none")] - pub maintenance_window: Option, - #[doc = "The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore'."] - #[serde(rename = "sourceServerResourceId", default, skip_serializing_if = "Option::is_none")] - pub source_server_resource_id: Option, - #[doc = "Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore'."] - #[serde(rename = "pointInTimeUTC", default, with = "azure_core::date::rfc3339::option")] - pub point_in_time_utc: Option, - #[doc = "availability zone information of the server."] - #[serde(rename = "availabilityZone", default, skip_serializing_if = "Option::is_none")] - pub availability_zone: Option, - #[doc = "The mode to create a new PostgreSQL server."] - #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] - pub create_mode: Option, -} -impl ServerProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod server_properties { - use super::*; - #[doc = "A state of a server that is visible to user."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "State")] - pub enum State { - Ready, - Dropping, - Disabled, - Starting, - Stopping, - Stopped, - Updating, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for State { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for State { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for State { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Ready => serializer.serialize_unit_variant("State", 0u32, "Ready"), - Self::Dropping => serializer.serialize_unit_variant("State", 1u32, "Dropping"), - Self::Disabled => serializer.serialize_unit_variant("State", 2u32, "Disabled"), - Self::Starting => serializer.serialize_unit_variant("State", 3u32, "Starting"), - Self::Stopping => serializer.serialize_unit_variant("State", 4u32, "Stopping"), - Self::Stopped => serializer.serialize_unit_variant("State", 5u32, "Stopped"), - Self::Updating => serializer.serialize_unit_variant("State", 6u32, "Updating"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The mode to create a new PostgreSQL server."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreateMode")] - pub enum CreateMode { - Default, - Create, - Update, - PointInTimeRestore, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreateMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreateMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreateMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("CreateMode", 0u32, "Default"), - Self::Create => serializer.serialize_unit_variant("CreateMode", 1u32, "Create"), - Self::Update => serializer.serialize_unit_variant("CreateMode", 2u32, "Update"), - Self::PointInTimeRestore => serializer.serialize_unit_variant("CreateMode", 3u32, "PointInTimeRestore"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServerPropertiesForUpdate { - #[doc = "The password of the administrator login."] - #[serde(rename = "administratorLoginPassword", default, skip_serializing_if = "Option::is_none")] - pub administrator_login_password: Option, - #[doc = "Storage properties of a server"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub storage: Option, - #[doc = "Backup properties of a server"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub backup: Option, - #[doc = "High availability properties of a server"] - #[serde(rename = "highAvailability", default, skip_serializing_if = "Option::is_none")] - pub high_availability: Option, - #[doc = "Maintenance window properties of a server."] - #[serde(rename = "maintenanceWindow", default, skip_serializing_if = "Option::is_none")] - pub maintenance_window: Option, - #[doc = "The mode to update a new PostgreSQL server."] - #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] - pub create_mode: Option, -} -impl ServerPropertiesForUpdate { - pub fn new() -> Self { - Self::default() - } -} -pub mod server_properties_for_update { - use super::*; - #[doc = "The mode to update a new PostgreSQL server."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreateMode")] - pub enum CreateMode { - Default, - Update, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreateMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreateMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreateMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("CreateMode", 0u32, "Default"), - Self::Update => serializer.serialize_unit_variant("CreateMode", 1u32, "Update"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The version of a server."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ServerVersion")] -pub enum ServerVersion { - #[serde(rename = "13")] - N13, - #[serde(rename = "12")] - N12, - #[serde(rename = "11")] - N11, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ServerVersion { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ServerVersion { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ServerVersion { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::N13 => serializer.serialize_unit_variant("ServerVersion", 0u32, "13"), - Self::N12 => serializer.serialize_unit_variant("ServerVersion", 1u32, "12"), - Self::N11 => serializer.serialize_unit_variant("ServerVersion", 2u32, "11"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "Server version capabilities."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ServerVersionCapability { - #[doc = "server version"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "supportedVcores", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_vcores: Vec, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl ServerVersionCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Sku information related properties of a server."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Sku { - #[doc = "The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3."] - pub name: String, - #[doc = "The tier of the particular SKU, e.g. Burstable."] - pub tier: sku::Tier, -} -impl Sku { - pub fn new(name: String, tier: sku::Tier) -> Self { - Self { name, tier } - } -} -pub mod sku { - use super::*; - #[doc = "The tier of the particular SKU, e.g. Burstable."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Tier")] - pub enum Tier { - Burstable, - GeneralPurpose, - MemoryOptimized, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Tier { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Tier { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Tier { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Burstable => serializer.serialize_unit_variant("Tier", 0u32, "Burstable"), - Self::GeneralPurpose => serializer.serialize_unit_variant("Tier", 1u32, "GeneralPurpose"), - Self::MemoryOptimized => serializer.serialize_unit_variant("Tier", 2u32, "MemoryOptimized"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Storage properties of a server"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Storage { - #[doc = "Max storage allowed for a server."] - #[serde(rename = "storageSizeGB", default, skip_serializing_if = "Option::is_none")] - pub storage_size_gb: Option, -} -impl Storage { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "storage edition capability"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StorageEditionCapability { - #[doc = "storage edition name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "supportedStorageMB", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub supported_storage_mb: Vec, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl StorageEditionCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "storage size in MB capability"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct StorageMbCapability { - #[doc = "storage MB name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "supported IOPS"] - #[serde(rename = "supportedIops", default, skip_serializing_if = "Option::is_none")] - pub supported_iops: Option, - #[doc = "storage size in MB"] - #[serde(rename = "storageSizeMB", default, skip_serializing_if = "Option::is_none")] - pub storage_size_mb: Option, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl StorageMbCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Input to get top query statistics"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TopQueryStatisticsInput { - #[doc = "The properties for input to get top query statistics"] - pub properties: TopQueryStatisticsInputProperties, -} -impl TopQueryStatisticsInput { - pub fn new(properties: TopQueryStatisticsInputProperties) -> Self { - Self { properties } - } -} -#[doc = "The properties for input to get top query statistics"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TopQueryStatisticsInputProperties { - #[doc = "Max number of top queries to return."] - #[serde(rename = "numberOfTopQueries")] - pub number_of_top_queries: i32, - #[doc = "Aggregation function name."] - #[serde(rename = "aggregationFunction")] - pub aggregation_function: String, - #[doc = "Observed metric name."] - #[serde(rename = "observedMetric")] - pub observed_metric: String, - #[doc = "Observation start time."] - #[serde(rename = "observationStartTime", with = "azure_core::date::rfc3339")] - pub observation_start_time: time::OffsetDateTime, - #[doc = "Observation end time."] - #[serde(rename = "observationEndTime", with = "azure_core::date::rfc3339")] - pub observation_end_time: time::OffsetDateTime, - #[doc = "Aggregation interval type in ISO 8601 format."] - #[serde(rename = "aggregationWindow")] - pub aggregation_window: String, -} -impl TopQueryStatisticsInputProperties { - pub fn new( - number_of_top_queries: i32, - aggregation_function: String, - observed_metric: String, - observation_start_time: time::OffsetDateTime, - observation_end_time: time::OffsetDateTime, - aggregation_window: String, - ) -> Self { - Self { - number_of_top_queries, - aggregation_function, - observed_metric, - observation_start_time, - observation_end_time, - aggregation_window, - } - } -} -#[doc = "A list of query statistics."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TopQueryStatisticsResultList { - #[doc = "The list of top query statistics."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for TopQueryStatisticsResultList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl TopQueryStatisticsResultList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Resource tags."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The geo-location where the resource lives"] - pub location: String, -} -impl TrackedResource { - pub fn new(location: String) -> Self { - Self { - resource: Resource::default(), - tags: None, - location, - } - } -} -#[doc = "Vcores capability"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VcoreCapability { - #[doc = "vCore name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "supported vCores"] - #[serde(rename = "vCores", default, skip_serializing_if = "Option::is_none")] - pub v_cores: Option, - #[doc = "supported IOPS"] - #[serde(rename = "supportedIops", default, skip_serializing_if = "Option::is_none")] - pub supported_iops: Option, - #[doc = "supported memory per vCore in MB"] - #[serde(rename = "supportedMemoryPerVcoreMB", default, skip_serializing_if = "Option::is_none")] - pub supported_memory_per_vcore_mb: Option, - #[doc = "The status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, -} -impl VcoreCapability { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Virtual network subnet usage parameter"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualNetworkSubnetUsageParameter { - #[doc = "Virtual network resource id."] - #[serde(rename = "virtualNetworkArmResourceId", default, skip_serializing_if = "Option::is_none")] - pub virtual_network_arm_resource_id: Option, -} -impl VirtualNetworkSubnetUsageParameter { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Virtual network subnet usage data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VirtualNetworkSubnetUsageResult { - #[serde( - rename = "delegatedSubnetsUsage", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub delegated_subnets_usage: Vec, -} -impl VirtualNetworkSubnetUsageResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Represents a Wait Statistic."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WaitStatistic { - #[serde(flatten)] - pub proxy_resource: ProxyResource, - #[doc = "The properties of a wait statistic."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl WaitStatistic { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The properties of a wait statistic."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WaitStatisticProperties { - #[doc = "Observation start time."] - #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] - pub start_time: Option, - #[doc = "Observation end time."] - #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] - pub end_time: Option, - #[doc = "Wait event name."] - #[serde(rename = "eventName", default, skip_serializing_if = "Option::is_none")] - pub event_name: Option, - #[doc = "Wait event type name."] - #[serde(rename = "eventTypeName", default, skip_serializing_if = "Option::is_none")] - pub event_type_name: Option, - #[doc = "Database query identifier."] - #[serde(rename = "queryId", default, skip_serializing_if = "Option::is_none")] - pub query_id: Option, - #[doc = "Database Name."] - #[serde(rename = "databaseName", default, skip_serializing_if = "Option::is_none")] - pub database_name: Option, - #[doc = "Database user identifier."] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, - #[doc = "Wait event count observed in this time interval."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option, - #[doc = "Total time of wait in milliseconds in this time interval."] - #[serde(rename = "totalTimeInMs", default, skip_serializing_if = "Option::is_none")] - pub total_time_in_ms: Option, -} -impl WaitStatisticProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Input to get wait statistics"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WaitStatisticsInput { - #[doc = "The properties for input to get wait statistics"] - pub properties: WaitStatisticsInputProperties, -} -impl WaitStatisticsInput { - pub fn new(properties: WaitStatisticsInputProperties) -> Self { - Self { properties } - } -} -#[doc = "The properties for input to get wait statistics"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct WaitStatisticsInputProperties { - #[doc = "Observation start time."] - #[serde(rename = "observationStartTime", with = "azure_core::date::rfc3339")] - pub observation_start_time: time::OffsetDateTime, - #[doc = "Observation end time."] - #[serde(rename = "observationEndTime", with = "azure_core::date::rfc3339")] - pub observation_end_time: time::OffsetDateTime, - #[doc = "Aggregation interval type in ISO 8601 format."] - #[serde(rename = "aggregationWindow")] - pub aggregation_window: String, -} -impl WaitStatisticsInputProperties { - pub fn new( - observation_start_time: time::OffsetDateTime, - observation_end_time: time::OffsetDateTime, - aggregation_window: String, - ) -> Self { - Self { - observation_start_time, - observation_end_time, - aggregation_window, - } - } -} -#[doc = "A list of wait statistics."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct WaitStatisticsResultList { - #[doc = "The list of wait statistics."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "Link to retrieve next page of results."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for WaitStatisticsResultList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl WaitStatisticsResultList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/postgresql/src/package_flexibleserver_2022_12_01/models.rs b/services/mgmt/postgresql/src/package_flexibleserver_2022_12_01/models.rs index 9a6b459edf..784507f6e9 100644 --- a/services/mgmt/postgresql/src/package_flexibleserver_2022_12_01/models.rs +++ b/services/mgmt/postgresql/src/package_flexibleserver_2022_12_01/models.rs @@ -1135,16 +1135,16 @@ impl NameAvailability { Self::default() } } -#[doc = "Network properties of a server"] +#[doc = "Network properties of a server."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Network { #[doc = "public network access is enabled or not"] #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] pub public_network_access: Option, - #[doc = "delegated subnet arm resource id."] + #[doc = "Delegated subnet arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone."] #[serde(rename = "delegatedSubnetResourceId", default, skip_serializing_if = "Option::is_none")] pub delegated_subnet_resource_id: Option, - #[doc = "private dns zone arm resource id."] + #[doc = "Private dns zone arm resource id. This is required to be passed during create, in case we want the server to be VNET injected, i.e. Private access server. During update, pass this only if we want to update the value for Private DNS zone."] #[serde(rename = "privateDnsZoneArmResourceId", default, skip_serializing_if = "Option::is_none")] pub private_dns_zone_arm_resource_id: Option, } @@ -1657,7 +1657,7 @@ pub struct ServerProperties { #[doc = "Backup properties of a server"] #[serde(default, skip_serializing_if = "Option::is_none")] pub backup: Option, - #[doc = "Network properties of a server"] + #[doc = "Network properties of a server."] #[serde(default, skip_serializing_if = "Option::is_none")] pub network: Option, #[doc = "High availability properties of a server"] @@ -1817,6 +1817,9 @@ pub struct ServerPropertiesForUpdate { #[doc = "Used to indicate role of the server in replication set."] #[serde(rename = "replicationRole", default, skip_serializing_if = "Option::is_none")] pub replication_role: Option, + #[doc = "Network properties of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub network: Option, } impl ServerPropertiesForUpdate { pub fn new() -> Self { diff --git a/services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/mod.rs b/services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/mod.rs new file mode 100644 index 0000000000..583bb2ea54 --- /dev/null +++ b/services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/mod.rs @@ -0,0 +1,5501 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn administrators_client(&self) -> administrators::Client { + administrators::Client(self.clone()) + } + pub fn backups_client(&self) -> backups::Client { + backups::Client(self.clone()) + } + pub fn check_name_availability_client(&self) -> check_name_availability::Client { + check_name_availability::Client(self.clone()) + } + pub fn check_name_availability_with_location_client(&self) -> check_name_availability_with_location::Client { + check_name_availability_with_location::Client(self.clone()) + } + pub fn configurations_client(&self) -> configurations::Client { + configurations::Client(self.clone()) + } + pub fn databases_client(&self) -> databases::Client { + databases::Client(self.clone()) + } + pub fn firewall_rules_client(&self) -> firewall_rules::Client { + firewall_rules::Client(self.clone()) + } + pub fn flexible_server_client(&self) -> flexible_server::Client { + flexible_server::Client(self.clone()) + } + pub fn get_private_dns_zone_suffix_client(&self) -> get_private_dns_zone_suffix::Client { + get_private_dns_zone_suffix::Client(self.clone()) + } + pub fn location_based_capabilities_client(&self) -> location_based_capabilities::Client { + location_based_capabilities::Client(self.clone()) + } + pub fn log_files_client(&self) -> log_files::Client { + log_files::Client(self.clone()) + } + pub fn ltr_backup_operations_client(&self) -> ltr_backup_operations::Client { + ltr_backup_operations::Client(self.clone()) + } + pub fn migrations_client(&self) -> migrations::Client { + migrations::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn replicas_client(&self) -> replicas::Client { + replicas::Client(self.clone()) + } + pub fn server_capabilities_client(&self) -> server_capabilities::Client { + server_capabilities::Client(self.clone()) + } + pub fn servers_client(&self) -> servers::Client { + servers::Client(self.clone()) + } + pub fn virtual_network_subnet_usage_client(&self) -> virtual_network_subnet_usage::Client { + virtual_network_subnet_usage::Client(self.clone()) + } +} +pub mod administrators { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets information about a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `object_id`: Guid of the objectId for the administrator."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + object_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + object_id: object_id.into(), + } + } + #[doc = "Creates a new server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `object_id`: Guid of the objectId for the administrator."] + #[doc = "* `parameters`: The required parameters for adding an active directory administrator for a server."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + object_id: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + object_id: object_id.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes an Active Directory Administrator associated with the server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `object_id`: Guid of the objectId for the administrator."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + object_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + object_id: object_id.into(), + } + } + #[doc = "List all the AAD administrators for a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ActiveDirectoryAdministrator = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) object_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/administrators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . object_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ActiveDirectoryAdministrator = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) object_id: String, + pub(crate) parameters: models::ActiveDirectoryAdministratorAdd, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/administrators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . object_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) object_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/administrators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . object_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdministratorListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/administrators", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod backups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get specific backup for a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `backup_name`: The name of the backup."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + backup_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + backup_name: backup_name.into(), + } + } + #[doc = "List all the backups for a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerBackup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) backup_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/backups/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.backup_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerBackupListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/backups", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod location_based_capabilities { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get capabilities at specified location in a given subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location_name`: The name of the location."] + pub fn execute(&self, subscription_id: impl Into, location_name: impl Into) -> execute::RequestBuilder { + execute::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CapabilitiesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/locations/{}/capabilities", + this.client.endpoint(), + &this.subscription_id, + &this.location_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod server_capabilities { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get capabilities for a flexible server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CapabilitiesListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/capabilities", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod check_name_availability { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Check the availability of name for resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `name_availability_request`: The required parameters for checking if resource name is available."] + pub fn execute( + &self, + subscription_id: impl Into, + name_availability_request: impl Into, + ) -> execute::RequestBuilder { + execute::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + name_availability_request: name_availability_request.into(), + } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NameAvailability = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) name_availability_request: models::CheckNameAvailabilityRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.name_availability_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod check_name_availability_with_location { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Check the availability of name for resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location_name`: The name of the location."] + #[doc = "* `name_availability_request`: The required parameters for checking if resource name is available."] + pub fn execute( + &self, + subscription_id: impl Into, + location_name: impl Into, + name_availability_request: impl Into, + ) -> execute::RequestBuilder { + execute::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + name_availability_request: name_availability_request.into(), + } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::NameAvailability = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + pub(crate) name_availability_request: models::CheckNameAvailabilityRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/locations/{}/checkNameAvailability", + this.client.endpoint(), + &this.subscription_id, + &this.location_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.name_availability_request)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod configurations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the configurations in a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + #[doc = "Gets information about a configuration of server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `configuration_name`: The name of the server configuration."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + configuration_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + configuration_name: configuration_name.into(), + } + } + #[doc = "Updates a configuration of a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `configuration_name`: The name of the server configuration."] + #[doc = "* `parameters`: The required parameters for updating a server configuration."] + pub fn put( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + configuration_name: impl Into, + parameters: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + configuration_name: configuration_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates a configuration of a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `configuration_name`: The name of the server configuration."] + #[doc = "* `parameters`: The required parameters for updating a server configuration."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + configuration_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + configuration_name: configuration_name.into(), + parameters: parameters.into(), + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConfigurationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Configuration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) configuration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . configuration_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod put { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Configuration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) configuration_name: String, + pub(crate) parameters: models::Configuration, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . configuration_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Configuration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) configuration_name: String, + pub(crate) parameters: models::ConfigurationForUpdate, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . configuration_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod databases { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets information about a database."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `database_name`: The name of the database."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + database_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + database_name: database_name.into(), + } + } + #[doc = "Creates a new database or updates an existing database."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `database_name`: The name of the database."] + #[doc = "* `parameters`: The required parameters for creating or updating a database."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + database_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + database_name: database_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a database."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `database_name`: The name of the database."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + database_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + database_name: database_name.into(), + } + } + #[doc = "List all the databases in a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Database = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) database_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.database_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Database = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) database_name: String, + pub(crate) parameters: models::Database, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.database_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) database_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.database_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DatabaseListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod firewall_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the firewall rules in a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `firewall_rule_name`: The name of the server firewall rule."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + firewall_rule_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + firewall_rule_name: firewall_rule_name.into(), + } + } + #[doc = "Creates a new firewall rule or updates an existing firewall rule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `firewall_rule_name`: The name of the server firewall rule."] + #[doc = "* `parameters`: The required parameters for creating or updating a firewall rule."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + firewall_rule_name: impl Into, + parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + firewall_rule_name: firewall_rule_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a PostgreSQL server firewall rule."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `firewall_rule_name`: The name of the server firewall rule."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + firewall_rule_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + firewall_rule_name: firewall_rule_name.into(), + } + } + #[doc = "List all the firewall rules in a given PostgreSQL server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirewallRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) firewall_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.firewall_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirewallRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) firewall_rule_name: String, + pub(crate) parameters: models::FirewallRule, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.firewall_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) firewall_rule_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name, + &this.firewall_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FirewallRuleListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod servers { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets information about a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + #[doc = "Creates a new server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `parameters`: The required parameters for creating or updating a server."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates an existing server. The request body can contain one to many of the properties present in the normal server definition."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `parameters`: The required parameters for updating a server."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + #[doc = "List all the servers in a given resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List all the servers in a given subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Restarts a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn restart( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> restart::RequestBuilder { + restart::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + parameters: None, + } + } + #[doc = "Starts a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn start( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> start::RequestBuilder { + start::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + #[doc = "Stops a server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn stop( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> stop::RequestBuilder { + stop::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Server = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Server = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) parameters: models::Server, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Server = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) parameters: models::ServerForUpdate, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod restart { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) parameters: Option, + } + impl RequestBuilder { + #[doc = "The parameters for restarting a server."] + pub fn parameters(mut self, parameters: impl Into) -> Self { + self.parameters = Some(parameters.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/restart", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = if let Some(parameters) = &this.parameters { + req.insert_header("content-type", "application/json"); + azure_core::to_json(parameters)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod start { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/start", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod stop { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/stop", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod migrations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets details of a migration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription ID of the target database server."] + #[doc = "* `resource_group_name`: The resource group name of the target database server."] + #[doc = "* `target_db_server_name`: The name of the target database server."] + #[doc = "* `migration_name`: The name of the migration."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + target_db_server_name: impl Into, + migration_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + target_db_server_name: target_db_server_name.into(), + migration_name: migration_name.into(), + } + } + #[doc = "Creates a new migration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription ID of the target database server."] + #[doc = "* `resource_group_name`: The resource group name of the target database server."] + #[doc = "* `target_db_server_name`: The name of the target database server."] + #[doc = "* `migration_name`: The name of the migration."] + #[doc = "* `parameters`: The required parameters for creating a migration."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + target_db_server_name: impl Into, + migration_name: impl Into, + parameters: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + target_db_server_name: target_db_server_name.into(), + migration_name: migration_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription ID of the target database server."] + #[doc = "* `resource_group_name`: The resource group name of the target database server."] + #[doc = "* `target_db_server_name`: The name of the target database server."] + #[doc = "* `migration_name`: The name of the migration."] + #[doc = "* `parameters`: The required parameters for updating a migration."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + target_db_server_name: impl Into, + migration_name: impl Into, + parameters: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + target_db_server_name: target_db_server_name.into(), + migration_name: migration_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Deletes a migration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription ID of the target database server."] + #[doc = "* `resource_group_name`: The resource group name of the target database server."] + #[doc = "* `target_db_server_name`: The name of the target database server."] + #[doc = "* `migration_name`: The name of the migration."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + target_db_server_name: impl Into, + migration_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + target_db_server_name: target_db_server_name.into(), + migration_name: migration_name.into(), + } + } + #[doc = "List all the migrations on a given target server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription ID of the target database server."] + #[doc = "* `resource_group_name`: The resource group name of the target database server."] + #[doc = "* `target_db_server_name`: The name of the target database server."] + pub fn list_by_target_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + target_db_server_name: impl Into, + ) -> list_by_target_server::RequestBuilder { + list_by_target_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + target_db_server_name: target_db_server_name.into(), + migration_list_filter: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MigrationResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) target_db_server_name: String, + pub(crate) migration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/migrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.target_db_server_name, + &this.migration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MigrationResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) target_db_server_name: String, + pub(crate) migration_name: String, + pub(crate) parameters: models::MigrationResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/migrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.target_db_server_name, + &this.migration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MigrationResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) target_db_server_name: String, + pub(crate) migration_name: String, + pub(crate) parameters: models::MigrationResourceForPatch, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/migrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.target_db_server_name, + &this.migration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) target_db_server_name: String, + pub(crate) migration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/migrations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.target_db_server_name, + &this.migration_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_target_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MigrationResourceListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) target_db_server_name: String, + pub(crate) migration_list_filter: Option, + } + impl RequestBuilder { + #[doc = "Migration list filter. Retrieves either active migrations or all migrations."] + pub fn migration_list_filter(mut self, migration_list_filter: impl Into) -> Self { + self.migration_list_filter = Some(migration_list_filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/migrations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.target_db_server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + if let Some(migration_list_filter) = &this.migration_list_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("migrationListFilter", migration_list_filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +impl Client { + #[doc = "Check migration name validity and availability"] + #[doc = "This method checks whether a proposed migration name is valid and available."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The subscription ID of the target database server."] + #[doc = "* `resource_group_name`: The resource group name of the target database server."] + #[doc = "* `target_db_server_name`: The name of the target database server."] + #[doc = "* `parameters`: The required parameters for checking if a migration name is available."] + pub fn check_migration_name_availability( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + target_db_server_name: impl Into, + parameters: impl Into, + ) -> check_migration_name_availability::RequestBuilder { + check_migration_name_availability::RequestBuilder { + client: self.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + target_db_server_name: target_db_server_name.into(), + parameters: parameters.into(), + } + } +} +pub mod check_migration_name_availability { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MigrationNameAvailabilityResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) target_db_server_name: String, + pub(crate) parameters: models::MigrationNameAvailabilityResource, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/checkMigrationNameAvailability" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . target_db_server_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available REST API operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.DBforPostgreSQL/operations", + this.client.endpoint(), + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod get_private_dns_zone_suffix { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get private DNS zone suffix in the cloud"] + pub fn execute(&self) -> execute::RequestBuilder { + execute::RequestBuilder { client: self.0.clone() } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateDnsZoneSuffix = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.DBforPostgreSQL/getPrivateDnsZoneSuffix", + this.client.endpoint(), + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod replicas { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the replicas for a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/replicas", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod log_files { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the server log files in a given server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LogFileListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/logFiles", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod virtual_network_subnet_usage { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get virtual network subnet usage for a given vNet resource id."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `location_name`: The name of the location."] + #[doc = "* `parameters`: The required parameters for creating or updating a server."] + pub fn execute( + &self, + subscription_id: impl Into, + location_name: impl Into, + parameters: impl Into, + ) -> execute::RequestBuilder { + execute::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + location_name: location_name.into(), + parameters: parameters.into(), + } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualNetworkSubnetUsageResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) location_name: String, + pub(crate) parameters: models::VirtualNetworkSubnetUsageParameter, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/locations/{}/checkVirtualNetworkSubnetUsage", + this.client.endpoint(), + &this.subscription_id, + &this.location_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod flexible_server { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "PreBackup operation performs all the checks that are needed for the subsequent long term retention backup operation to succeed."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `parameters`: Request body for operation"] + pub fn trigger_ltr_pre_backup( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + parameters: impl Into, + ) -> trigger_ltr_pre_backup::RequestBuilder { + trigger_ltr_pre_backup::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + parameters: parameters.into(), + } + } + #[doc = "Start the Long Term Retention Backup operation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `parameters`: Request body for operation"] + pub fn start_ltr_backup( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + parameters: impl Into, + ) -> start_ltr_backup::RequestBuilder { + start_ltr_backup::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + parameters: parameters.into(), + } + } + } + pub mod trigger_ltr_pre_backup { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LtrPreBackupResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging."] + pub fn x_ms_request_id(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("x-ms-request-id")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) parameters: models::LtrPreBackupRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/ltrPreBackup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod start_ltr_backup { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LtrBackupResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "A unique ID for the current operation, service generated. All the resource providers must return this value in the response headers to facilitate debugging."] + pub fn x_ms_request_id(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("x-ms-request-id")) + } + #[doc = "The number of seconds to wait before checking the status of the asynchronous operation."] + pub fn retry_after(&self) -> azure_core::Result { + self.0.get_as(&azure_core::headers::HeaderName::from_static("retry-after")) + } + #[doc = "URL to retrieve the final result after operation completes."] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + #[doc = "URL for checking the ongoing status of the operation."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) parameters: models::LtrBackupRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/startLtrBackup", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.server_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod ltr_backup_operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the result of the give long term retention backup operation for the flexible server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + #[doc = "* `backup_name`: The name of the backup."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + backup_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + backup_name: backup_name.into(), + } + } + #[doc = "Gets the result of the give long term retention backup operations for the flexible server."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `server_name`: The name of the server."] + pub fn list_by_server( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + server_name: impl Into, + ) -> list_by_server::RequestBuilder { + list_by_server::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + server_name: server_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LtrServerBackupOperation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + pub(crate) backup_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/ltrBackupOperations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . backup_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_server { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::LtrServerBackupOperationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) server_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/ltrBackupOperations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-03-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} diff --git a/services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/models.rs b/services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/models.rs new file mode 100644 index 0000000000..fc91648817 --- /dev/null +++ b/services/mgmt/postgresql/src/package_flexibleserver_2023_03_01_preview/models.rs @@ -0,0 +1,4039 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Represents an Active Directory administrator."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ActiveDirectoryAdministrator { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of an Active Directory administrator."] + pub properties: AdministratorProperties, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl ActiveDirectoryAdministrator { + pub fn new(properties: AdministratorProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + system_data: None, + } + } +} +#[doc = "Represents an Active Directory administrator."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ActiveDirectoryAdministratorAdd { + #[doc = "The properties of an Active Directory administrator."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ActiveDirectoryAdministratorAdd { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Server admin credentials."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdminCredentials { + #[doc = "Password for source server."] + #[serde(rename = "sourceServerPassword")] + pub source_server_password: String, + #[doc = "Password for target server."] + #[serde(rename = "targetServerPassword")] + pub target_server_password: String, +} +impl AdminCredentials { + pub fn new(source_server_password: String, target_server_password: String) -> Self { + Self { + source_server_password, + target_server_password, + } + } +} +#[doc = "A list of active directory administrators."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdministratorListResult { + #[doc = "The list of active directory administrators"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of active directory."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AdministratorListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AdministratorListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of an Active Directory administrator."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdministratorProperties { + #[doc = "The principal type used to represent the type of Active Directory Administrator."] + #[serde(rename = "principalType", default, skip_serializing_if = "Option::is_none")] + pub principal_type: Option, + #[doc = "Active Directory administrator principal name."] + #[serde(rename = "principalName", default, skip_serializing_if = "Option::is_none")] + pub principal_name: Option, + #[doc = "The objectId of the Active Directory administrator."] + #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")] + pub object_id: Option, + #[doc = "The tenantId of the Active Directory administrator."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl AdministratorProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod administrator_properties { + use super::*; + #[doc = "The principal type used to represent the type of Active Directory Administrator."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PrincipalType")] + pub enum PrincipalType { + Unknown, + User, + Group, + ServicePrincipal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PrincipalType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PrincipalType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PrincipalType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("PrincipalType", 0u32, "Unknown"), + Self::User => serializer.serialize_unit_variant("PrincipalType", 1u32, "User"), + Self::Group => serializer.serialize_unit_variant("PrincipalType", 2u32, "Group"), + Self::ServicePrincipal => serializer.serialize_unit_variant("PrincipalType", 3u32, "ServicePrincipal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The properties of an Active Directory administrator."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdministratorPropertiesForAdd { + #[doc = "The principal type used to represent the type of Active Directory Administrator."] + #[serde(rename = "principalType", default, skip_serializing_if = "Option::is_none")] + pub principal_type: Option, + #[doc = "Active Directory administrator principal name."] + #[serde(rename = "principalName", default, skip_serializing_if = "Option::is_none")] + pub principal_name: Option, + #[doc = "The tenantId of the Active Directory administrator."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl AdministratorPropertiesForAdd { + pub fn new() -> Self { + Self::default() + } +} +pub mod administrator_properties_for_add { + use super::*; + #[doc = "The principal type used to represent the type of Active Directory Administrator."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PrincipalType")] + pub enum PrincipalType { + Unknown, + User, + Group, + ServicePrincipal, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PrincipalType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PrincipalType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PrincipalType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("PrincipalType", 0u32, "Unknown"), + Self::User => serializer.serialize_unit_variant("PrincipalType", 1u32, "User"), + Self::Group => serializer.serialize_unit_variant("PrincipalType", 2u32, "Group"), + Self::ServicePrincipal => serializer.serialize_unit_variant("PrincipalType", 3u32, "ServicePrincipal"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Authentication configuration properties of a server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AuthConfig { + #[doc = "If Enabled, Azure Active Directory authentication is enabled."] + #[serde(rename = "activeDirectoryAuth", default, skip_serializing_if = "Option::is_none")] + pub active_directory_auth: Option, + #[doc = "If Enabled, Password authentication is enabled."] + #[serde(rename = "passwordAuth", default, skip_serializing_if = "Option::is_none")] + pub password_auth: Option, + #[doc = "Tenant id of the server."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, +} +impl AuthConfig { + pub fn new() -> Self { + Self::default() + } +} +pub mod auth_config { + use super::*; + #[doc = "If Enabled, Azure Active Directory authentication is enabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActiveDirectoryAuth")] + pub enum ActiveDirectoryAuth { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActiveDirectoryAuth { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActiveDirectoryAuth { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActiveDirectoryAuth { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("ActiveDirectoryAuth", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("ActiveDirectoryAuth", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "If Enabled, Password authentication is enabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PasswordAuth")] + pub enum PasswordAuth { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PasswordAuth { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PasswordAuth { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PasswordAuth { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PasswordAuth", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PasswordAuth", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for PasswordAuth { + fn default() -> Self { + Self::Enabled + } + } +} +#[doc = "Backup properties of a server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Backup { + #[doc = "Backup retention days for the server."] + #[serde(rename = "backupRetentionDays", default, skip_serializing_if = "Option::is_none")] + pub backup_retention_days: Option, + #[doc = "A value indicating whether Geo-Redundant backup is enabled on the server."] + #[serde(rename = "geoRedundantBackup", default, skip_serializing_if = "Option::is_none")] + pub geo_redundant_backup: Option, + #[doc = "The earliest restore point time (ISO8601 format) for server."] + #[serde(rename = "earliestRestoreDate", default, with = "azure_core::date::rfc3339::option")] + pub earliest_restore_date: Option, +} +impl Backup { + pub fn new() -> Self { + Self::default() + } +} +pub mod backup { + use super::*; + #[doc = "A value indicating whether Geo-Redundant backup is enabled on the server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "GeoRedundantBackup")] + pub enum GeoRedundantBackup { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for GeoRedundantBackup { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for GeoRedundantBackup { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for GeoRedundantBackup { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("GeoRedundantBackup", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("GeoRedundantBackup", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for GeoRedundantBackup { + fn default() -> Self { + Self::Disabled + } + } +} +#[doc = "BackupRequestBase is the base for all backup request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BackupRequestBase { + #[doc = "The settings for the long term backup."] + #[serde(rename = "backupSettings")] + pub backup_settings: BackupSettings, +} +impl BackupRequestBase { + pub fn new(backup_settings: BackupSettings) -> Self { + Self { backup_settings } + } +} +#[doc = "The settings for the long term backup."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BackupSettings { + #[doc = "Backup Name for the current backup"] + #[serde(rename = "backupName")] + pub backup_name: String, +} +impl BackupSettings { + pub fn new(backup_name: String) -> Self { + Self { backup_name } + } +} +#[doc = "Details about the target where the backup content will be stored."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BackupStoreDetails { + #[doc = "List of SAS uri of storage containers where backup data is to be streamed/copied."] + #[serde(rename = "sasUriList")] + pub sas_uri_list: Vec, +} +impl BackupStoreDetails { + pub fn new(sas_uri_list: Vec) -> Self { + Self { sas_uri_list } + } +} +#[doc = "Capability for the PostgreSQL server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilitiesListResult { + #[doc = "A list of supported capabilities."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link to retrieve next page of results."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CapabilitiesListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CapabilitiesListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Base object for representing capability"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CapabilityBase { + #[doc = "The status of the capability."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The reason for the capability not being available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} +impl CapabilityBase { + pub fn new() -> Self { + Self::default() + } +} +pub mod capability_base { + use super::*; + #[doc = "The status of the capability."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Status { + Visible, + Available, + Default, + Disabled, + } +} +#[doc = "The check availability request body."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityRequest { + #[doc = "The name of the resource for which availability needs to be checked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The resource type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl CheckNameAvailabilityRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The check availability result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CheckNameAvailabilityResponse { + #[doc = "Indicates if the resource name is available."] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "The reason why the given name is not available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Detailed reason why the given name is available."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl CheckNameAvailabilityResponse { + pub fn new() -> Self { + Self::default() + } +} +pub mod check_name_availability_response { + use super::*; + #[doc = "The reason why the given name is not available."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Reason")] + pub enum Reason { + Invalid, + AlreadyExists, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Reason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Reason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Reason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Invalid => serializer.serialize_unit_variant("Reason", 0u32, "Invalid"), + Self::AlreadyExists => serializer.serialize_unit_variant("Reason", 1u32, "AlreadyExists"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents a Configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Configuration { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of a configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Configuration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a Configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConfigurationForUpdate { + #[doc = "The properties of a configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ConfigurationForUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of server configurations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConfigurationListResult { + #[doc = "The list of server configurations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ConfigurationListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ConfigurationListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConfigurationProperties { + #[doc = "Value of the configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "Description of the configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Default value of the configuration."] + #[serde(rename = "defaultValue", default, skip_serializing_if = "Option::is_none")] + pub default_value: Option, + #[doc = "Data type of the configuration."] + #[serde(rename = "dataType", default, skip_serializing_if = "Option::is_none")] + pub data_type: Option, + #[doc = "Allowed values of the configuration."] + #[serde(rename = "allowedValues", default, skip_serializing_if = "Option::is_none")] + pub allowed_values: Option, + #[doc = "Source of the configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "Configuration dynamic or static."] + #[serde(rename = "isDynamicConfig", default, skip_serializing_if = "Option::is_none")] + pub is_dynamic_config: Option, + #[doc = "Configuration read-only or not."] + #[serde(rename = "isReadOnly", default, skip_serializing_if = "Option::is_none")] + pub is_read_only: Option, + #[doc = "Configuration is pending restart or not."] + #[serde(rename = "isConfigPendingRestart", default, skip_serializing_if = "Option::is_none")] + pub is_config_pending_restart: Option, + #[doc = "Configuration unit."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unit: Option, + #[doc = "Configuration documentation link."] + #[serde(rename = "documentationLink", default, skip_serializing_if = "Option::is_none")] + pub documentation_link: Option, +} +impl ConfigurationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod configuration_properties { + use super::*; + #[doc = "Data type of the configuration."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DataType")] + pub enum DataType { + Boolean, + Numeric, + Integer, + Enumeration, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DataType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DataType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DataType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Boolean => serializer.serialize_unit_variant("DataType", 0u32, "Boolean"), + Self::Numeric => serializer.serialize_unit_variant("DataType", 1u32, "Numeric"), + Self::Integer => serializer.serialize_unit_variant("DataType", 2u32, "Integer"), + Self::Enumeration => serializer.serialize_unit_variant("DataType", 3u32, "Enumeration"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Data encryption properties of a server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DataEncryption { + #[doc = "URI for the key in keyvault for data encryption of the primary server."] + #[serde(rename = "primaryKeyURI", default, skip_serializing_if = "Option::is_none")] + pub primary_key_uri: Option, + #[doc = "Resource Id for the User assigned identity to be used for data encryption of the primary server."] + #[serde(rename = "primaryUserAssignedIdentityId", default, skip_serializing_if = "Option::is_none")] + pub primary_user_assigned_identity_id: Option, + #[doc = "URI for the key in keyvault for data encryption for geo-backup of server."] + #[serde(rename = "geoBackupKeyURI", default, skip_serializing_if = "Option::is_none")] + pub geo_backup_key_uri: Option, + #[doc = "Resource Id for the User assigned identity to be used for data encryption for geo-backup of server."] + #[serde(rename = "geoBackupUserAssignedIdentityId", default, skip_serializing_if = "Option::is_none")] + pub geo_backup_user_assigned_identity_id: Option, + #[doc = "Data encryption type to depict if it is System Managed vs Azure Key vault."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Primary encryption key status for Data encryption enabled server."] + #[serde(rename = "primaryEncryptionKeyStatus", default, skip_serializing_if = "Option::is_none")] + pub primary_encryption_key_status: Option, + #[doc = "Geo-backup encryption key status for Data encryption enabled server."] + #[serde(rename = "geoBackupEncryptionKeyStatus", default, skip_serializing_if = "Option::is_none")] + pub geo_backup_encryption_key_status: Option, +} +impl DataEncryption { + pub fn new() -> Self { + Self::default() + } +} +pub mod data_encryption { + use super::*; + #[doc = "Data encryption type to depict if it is System Managed vs Azure Key vault."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + SystemManaged, + AzureKeyVault, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SystemManaged => serializer.serialize_unit_variant("Type", 0u32, "SystemManaged"), + Self::AzureKeyVault => serializer.serialize_unit_variant("Type", 1u32, "AzureKeyVault"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Primary encryption key status for Data encryption enabled server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PrimaryEncryptionKeyStatus")] + pub enum PrimaryEncryptionKeyStatus { + Valid, + Invalid, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PrimaryEncryptionKeyStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PrimaryEncryptionKeyStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PrimaryEncryptionKeyStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("PrimaryEncryptionKeyStatus", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("PrimaryEncryptionKeyStatus", 1u32, "Invalid"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Geo-backup encryption key status for Data encryption enabled server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "GeoBackupEncryptionKeyStatus")] + pub enum GeoBackupEncryptionKeyStatus { + Valid, + Invalid, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for GeoBackupEncryptionKeyStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for GeoBackupEncryptionKeyStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for GeoBackupEncryptionKeyStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("GeoBackupEncryptionKeyStatus", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("GeoBackupEncryptionKeyStatus", 1u32, "Invalid"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents a Database."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Database { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of a database."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Database { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A List of databases."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DatabaseListResult { + #[doc = "The list of databases housed in a server"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of databases."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DatabaseListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DatabaseListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a database."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DatabaseProperties { + #[doc = "The charset of the database."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub charset: Option, + #[doc = "The collation of the database."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub collation: Option, +} +impl DatabaseProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Database server metadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DbServerMetadata { + #[doc = "Location of database server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Version for database engine"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Storage size in MB for database server"] + #[serde(rename = "storageMb", default, skip_serializing_if = "Option::is_none")] + pub storage_mb: Option, + #[doc = "Sku information related properties of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, +} +impl DbServerMetadata { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Delegated subnet usage data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DelegatedSubnetUsage { + #[doc = "Name of the delegated subnet for which IP addresses are in use"] + #[serde(rename = "subnetName", default, skip_serializing_if = "Option::is_none")] + pub subnet_name: Option, + #[doc = "Number of IP addresses used by the delegated subnet"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub usage: Option, +} +impl DelegatedSubnetUsage { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents capability of a fast provisioning edition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FastProvisioningEditionCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Fast provisioning supported tier name"] + #[serde(rename = "supportedTier", default, skip_serializing_if = "Option::is_none")] + pub supported_tier: Option, + #[doc = "Fast provisioning supported sku name"] + #[serde(rename = "supportedSku", default, skip_serializing_if = "Option::is_none")] + pub supported_sku: Option, + #[doc = "Fast provisioning supported storage in Gb"] + #[serde(rename = "supportedStorageGb", default, skip_serializing_if = "Option::is_none")] + pub supported_storage_gb: Option, + #[doc = "Fast provisioning supported version"] + #[serde(rename = "supportedServerVersions", default, skip_serializing_if = "Option::is_none")] + pub supported_server_versions: Option, + #[doc = "Count of servers in cache matching the spec"] + #[serde(rename = "serverCount", default, skip_serializing_if = "Option::is_none")] + pub server_count: Option, +} +impl FastProvisioningEditionCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a server firewall rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FirewallRule { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of a server firewall rule."] + pub properties: FirewallRuleProperties, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl FirewallRule { + pub fn new(properties: FirewallRuleProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + system_data: None, + } + } +} +#[doc = "A list of firewall rules."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FirewallRuleListResult { + #[doc = "The list of firewall rules in a server."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for FirewallRuleListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl FirewallRuleListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a server firewall rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FirewallRuleProperties { + #[doc = "The start IP address of the server firewall rule. Must be IPv4 format."] + #[serde(rename = "startIpAddress")] + pub start_ip_address: String, + #[doc = "The end IP address of the server firewall rule. Must be IPv4 format."] + #[serde(rename = "endIpAddress")] + pub end_ip_address: String, +} +impl FirewallRuleProperties { + pub fn new(start_ip_address: String, end_ip_address: String) -> Self { + Self { + start_ip_address, + end_ip_address, + } + } +} +#[doc = "Capability for the PostgreSQL server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FlexibleServerCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Name of flexible servers capability"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "List of supported flexible server editions"] + #[serde( + rename = "supportedServerEditions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_server_editions: Vec, + #[doc = "The list of server versions supported for this capability."] + #[serde( + rename = "supportedServerVersions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_server_versions: Vec, + #[doc = "Gets a value indicating whether fast provisioning is supported. \"Enabled\" means fast provisioning is supported. \"Disabled\" stands for fast provisioning is not supported."] + #[serde(rename = "fastProvisioningSupported", default, skip_serializing_if = "Option::is_none")] + pub fast_provisioning_supported: Option, + #[doc = "List of supported server editions for fast provisioning"] + #[serde( + rename = "supportedFastProvisioningEditions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_fast_provisioning_editions: Vec, + #[doc = "Determines if geo-backup is supported in this region. \"Enabled\" means geo-backup is supported. \"Disabled\" stands for geo-back is not supported."] + #[serde(rename = "geoBackupSupported", default, skip_serializing_if = "Option::is_none")] + pub geo_backup_supported: Option, + #[doc = "A value indicating whether Zone Redundant HA is supported in this region. \"Enabled\" means zone redundant HA is supported. \"Disabled\" stands for zone redundant HA is not supported."] + #[serde(rename = "zoneRedundantHaSupported", default, skip_serializing_if = "Option::is_none")] + pub zone_redundant_ha_supported: Option, + #[doc = "A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. \"Enabled\" means zone redundant HA and geo-backup is supported. \"Disabled\" stands for zone redundant HA and geo-backup is not supported."] + #[serde(rename = "zoneRedundantHaAndGeoBackupSupported", default, skip_serializing_if = "Option::is_none")] + pub zone_redundant_ha_and_geo_backup_supported: Option, + #[doc = "A value indicating whether storage auto-grow is supported in this region. \"Enabled\" means storage auto-grow is supported. \"Disabled\" stands for storage auto-grow is not supported."] + #[serde(rename = "storageAutoGrowthSupported", default, skip_serializing_if = "Option::is_none")] + pub storage_auto_growth_supported: Option, + #[doc = "A value indicating whether online resize is supported in this region for the given subscription. \"Enabled\" means storage online resize is supported. \"Disabled\" means storage online resize is not supported."] + #[serde(rename = "onlineResizeSupported", default, skip_serializing_if = "Option::is_none")] + pub online_resize_supported: Option, + #[doc = "A value indicating whether this region is restricted. \"Enabled\" means region is restricted. \"Disabled\" stands for region is not restricted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub restricted: Option, +} +impl FlexibleServerCapability { + pub fn new() -> Self { + Self::default() + } +} +pub mod flexible_server_capability { + use super::*; + #[doc = "Gets a value indicating whether fast provisioning is supported. \"Enabled\" means fast provisioning is supported. \"Disabled\" stands for fast provisioning is not supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "FastProvisioningSupported")] + pub enum FastProvisioningSupported { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for FastProvisioningSupported { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for FastProvisioningSupported { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for FastProvisioningSupported { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("FastProvisioningSupported", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("FastProvisioningSupported", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Determines if geo-backup is supported in this region. \"Enabled\" means geo-backup is supported. \"Disabled\" stands for geo-back is not supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "GeoBackupSupported")] + pub enum GeoBackupSupported { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for GeoBackupSupported { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for GeoBackupSupported { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for GeoBackupSupported { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("GeoBackupSupported", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("GeoBackupSupported", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A value indicating whether Zone Redundant HA is supported in this region. \"Enabled\" means zone redundant HA is supported. \"Disabled\" stands for zone redundant HA is not supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ZoneRedundantHaSupported")] + pub enum ZoneRedundantHaSupported { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ZoneRedundantHaSupported { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ZoneRedundantHaSupported { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ZoneRedundantHaSupported { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("ZoneRedundantHaSupported", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("ZoneRedundantHaSupported", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A value indicating whether Zone Redundant HA and Geo-backup is supported in this region. \"Enabled\" means zone redundant HA and geo-backup is supported. \"Disabled\" stands for zone redundant HA and geo-backup is not supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ZoneRedundantHaAndGeoBackupSupported")] + pub enum ZoneRedundantHaAndGeoBackupSupported { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ZoneRedundantHaAndGeoBackupSupported { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ZoneRedundantHaAndGeoBackupSupported { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ZoneRedundantHaAndGeoBackupSupported { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("ZoneRedundantHaAndGeoBackupSupported", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("ZoneRedundantHaAndGeoBackupSupported", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A value indicating whether storage auto-grow is supported in this region. \"Enabled\" means storage auto-grow is supported. \"Disabled\" stands for storage auto-grow is not supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "StorageAutoGrowthSupported")] + pub enum StorageAutoGrowthSupported { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for StorageAutoGrowthSupported { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for StorageAutoGrowthSupported { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for StorageAutoGrowthSupported { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("StorageAutoGrowthSupported", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("StorageAutoGrowthSupported", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A value indicating whether online resize is supported in this region for the given subscription. \"Enabled\" means storage online resize is supported. \"Disabled\" means storage online resize is not supported."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OnlineResizeSupported")] + pub enum OnlineResizeSupported { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OnlineResizeSupported { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OnlineResizeSupported { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OnlineResizeSupported { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("OnlineResizeSupported", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("OnlineResizeSupported", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A value indicating whether this region is restricted. \"Enabled\" means region is restricted. \"Disabled\" stands for region is not restricted."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Restricted")] + pub enum Restricted { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Restricted { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Restricted { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Restricted { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Restricted", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Restricted", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Flexible server edition capabilities."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct FlexibleServerEditionCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Server edition name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Default sku name for the server edition"] + #[serde(rename = "defaultSkuName", default, skip_serializing_if = "Option::is_none")] + pub default_sku_name: Option, + #[doc = "The list of editions supported by this server edition."] + #[serde( + rename = "supportedStorageEditions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_storage_editions: Vec, + #[doc = "List of supported server SKUs."] + #[serde( + rename = "supportedServerSkus", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_server_skus: Vec, +} +impl FlexibleServerEditionCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "High availability properties of a server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HighAvailability { + #[doc = "The HA mode for the server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[doc = "A state of a HA server that is visible to user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "availability zone information of the standby."] + #[serde(rename = "standbyAvailabilityZone", default, skip_serializing_if = "Option::is_none")] + pub standby_availability_zone: Option, +} +impl HighAvailability { + pub fn new() -> Self { + Self::default() + } +} +pub mod high_availability { + use super::*; + #[doc = "The HA mode for the server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Mode")] + pub enum Mode { + Disabled, + ZoneRedundant, + SameZone, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Mode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Mode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Mode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("Mode", 0u32, "Disabled"), + Self::ZoneRedundant => serializer.serialize_unit_variant("Mode", 1u32, "ZoneRedundant"), + Self::SameZone => serializer.serialize_unit_variant("Mode", 2u32, "SameZone"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Mode { + fn default() -> Self { + Self::Disabled + } + } + #[doc = "A state of a HA server that is visible to user."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + NotEnabled, + CreatingStandby, + ReplicatingData, + FailingOver, + Healthy, + RemovingStandby, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NotEnabled => serializer.serialize_unit_variant("State", 0u32, "NotEnabled"), + Self::CreatingStandby => serializer.serialize_unit_variant("State", 1u32, "CreatingStandby"), + Self::ReplicatingData => serializer.serialize_unit_variant("State", 2u32, "ReplicatingData"), + Self::FailingOver => serializer.serialize_unit_variant("State", 3u32, "FailingOver"), + Self::Healthy => serializer.serialize_unit_variant("State", 4u32, "Healthy"), + Self::RemovingStandby => serializer.serialize_unit_variant("State", 5u32, "RemovingStandby"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents a logFile."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LogFile { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of a logFile."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl LogFile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A List of logFiles."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LogFileListResult { + #[doc = "The list of logFiles in a server"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for LogFileListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl LogFileListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a logFile."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LogFileProperties { + #[doc = "Creation timestamp of the log file."] + #[serde(rename = "createdTime", default, with = "azure_core::date::rfc3339::option")] + pub created_time: Option, + #[doc = "Last modified timestamp of the log file."] + #[serde(rename = "lastModifiedTime", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_time: Option, + #[doc = "The size in kb of the logFile."] + #[serde(rename = "sizeInKb", default, skip_serializing_if = "Option::is_none")] + pub size_in_kb: Option, + #[doc = "Type of the log file."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The url to download the log file from."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, +} +impl LogFileProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Response for the backup request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LtrBackupOperationResponseProperties { + #[doc = "Size of datasource in bytes"] + #[serde(rename = "datasourceSizeInBytes", default, skip_serializing_if = "Option::is_none")] + pub datasource_size_in_bytes: Option, + #[doc = "Data transferred in bytes"] + #[serde(rename = "dataTransferredInBytes", default, skip_serializing_if = "Option::is_none")] + pub data_transferred_in_bytes: Option, + #[doc = "Name of Backup operation"] + #[serde(rename = "backupName", default, skip_serializing_if = "Option::is_none")] + pub backup_name: Option, + #[doc = "Metadata to be stored in RP. Store everything that will be required to perform a successful restore using this Recovery point. e.g. Versions, DataFormat etc"] + #[serde(rename = "backupMetadata", default, skip_serializing_if = "Option::is_none")] + pub backup_metadata: Option, + #[doc = "Service-set extensible enum indicating the status of operation"] + pub status: ltr_backup_operation_response_properties::Status, + #[doc = "Start time of the operation."] + #[serde(rename = "startTime", with = "azure_core::date::rfc3339")] + pub start_time: time::OffsetDateTime, + #[doc = "End time of the operation."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "PercentageCompleted"] + #[serde(rename = "percentComplete", default, skip_serializing_if = "Option::is_none")] + pub percent_complete: Option, + #[doc = "The error code."] + #[serde(rename = "errorCode", default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + #[doc = "The error message."] + #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, +} +impl LtrBackupOperationResponseProperties { + pub fn new(status: ltr_backup_operation_response_properties::Status, start_time: time::OffsetDateTime) -> Self { + Self { + datasource_size_in_bytes: None, + data_transferred_in_bytes: None, + backup_name: None, + backup_metadata: None, + status, + start_time, + end_time: None, + percent_complete: None, + error_code: None, + error_message: None, + } + } +} +pub mod ltr_backup_operation_response_properties { + use super::*; + #[doc = "Service-set extensible enum indicating the status of operation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Running, + Cancelled, + Failed, + Succeeded, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Running => serializer.serialize_unit_variant("Status", 0u32, "Running"), + Self::Cancelled => serializer.serialize_unit_variant("Status", 1u32, "Cancelled"), + Self::Failed => serializer.serialize_unit_variant("Status", 2u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("Status", 3u32, "Succeeded"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The request that is made for a long term retention backup."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LtrBackupRequest { + #[serde(flatten)] + pub backup_request_base: BackupRequestBase, + #[doc = "Details about the target where the backup content will be stored."] + #[serde(rename = "targetDetails")] + pub target_details: BackupStoreDetails, +} +impl LtrBackupRequest { + pub fn new(backup_request_base: BackupRequestBase, target_details: BackupStoreDetails) -> Self { + Self { + backup_request_base, + target_details, + } + } +} +#[doc = "Response for the LTR backup API call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LtrBackupResponse { + #[doc = "Response for the backup request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl LtrBackupResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A request that is made for pre-backup."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LtrPreBackupRequest { + #[serde(flatten)] + pub backup_request_base: BackupRequestBase, +} +impl LtrPreBackupRequest { + pub fn new(backup_request_base: BackupRequestBase) -> Self { + Self { backup_request_base } + } +} +#[doc = "Response for the LTR pre-backup API call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LtrPreBackupResponse { + #[doc = "Response for the pre-backup request."] + pub properties: LtrPreBackupResponseProperties, +} +impl LtrPreBackupResponse { + pub fn new(properties: LtrPreBackupResponseProperties) -> Self { + Self { properties } + } +} +#[doc = "Response for the pre-backup request."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LtrPreBackupResponseProperties { + #[doc = "Number of storage containers the plugin will use during backup. More than one containers may be used for size limitations, parallelism, or redundancy etc."] + #[serde(rename = "numberOfContainers")] + pub number_of_containers: i32, +} +impl LtrPreBackupResponseProperties { + pub fn new(number_of_containers: i32) -> Self { + Self { number_of_containers } + } +} +#[doc = "Response for the LTR backup Operation API call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LtrServerBackupOperation { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Response for the backup request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl LtrServerBackupOperation { + pub fn new() -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties: None, + } + } +} +#[doc = "A list of long term retention backup operations for server."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct LtrServerBackupOperationList { + #[doc = "The list of long term retention server backup operations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for LtrServerBackupOperationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl LtrServerBackupOperationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Maintenance window properties of a server."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MaintenanceWindow { + #[doc = "indicates whether custom window is enabled or disabled"] + #[serde(rename = "customWindow", default, skip_serializing_if = "Option::is_none")] + pub custom_window: Option, + #[doc = "start hour for maintenance window"] + #[serde(rename = "startHour", default, skip_serializing_if = "Option::is_none")] + pub start_hour: Option, + #[doc = "start minute for maintenance window"] + #[serde(rename = "startMinute", default, skip_serializing_if = "Option::is_none")] + pub start_minute: Option, + #[doc = "day of week for maintenance window"] + #[serde(rename = "dayOfWeek", default, skip_serializing_if = "Option::is_none")] + pub day_of_week: Option, +} +impl MaintenanceWindow { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Migration details level."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MigrationDetailsLevel")] +pub enum MigrationDetailsLevel { + Default, + Summary, + Full, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MigrationDetailsLevel { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MigrationDetailsLevel { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MigrationDetailsLevel { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("MigrationDetailsLevel", 0u32, "Default"), + Self::Summary => serializer.serialize_unit_variant("MigrationDetailsLevel", 1u32, "Summary"), + Self::Full => serializer.serialize_unit_variant("MigrationDetailsLevel", 2u32, "Full"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "There are two types of migration modes Online and Offline"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MigrationMode")] +pub enum MigrationMode { + Offline, + Online, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MigrationMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MigrationMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MigrationMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Offline => serializer.serialize_unit_variant("MigrationMode", 0u32, "Offline"), + Self::Online => serializer.serialize_unit_variant("MigrationMode", 1u32, "Online"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Migration name availability reason."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MigrationNameAvailabilityReason")] +pub enum MigrationNameAvailabilityReason { + Invalid, + AlreadyExists, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MigrationNameAvailabilityReason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MigrationNameAvailabilityReason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MigrationNameAvailabilityReason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Invalid => serializer.serialize_unit_variant("MigrationNameAvailabilityReason", 0u32, "Invalid"), + Self::AlreadyExists => serializer.serialize_unit_variant("MigrationNameAvailabilityReason", 1u32, "AlreadyExists"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Represents a migration name's availability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MigrationNameAvailabilityResource { + #[doc = "The resource name to verify."] + pub name: String, + #[doc = "The type of the resource."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Indicates whether the resource name is available."] + #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")] + pub name_available: Option, + #[doc = "Migration name availability reason."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Migration name availability message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl MigrationNameAvailabilityResource { + pub fn new(name: String, type_: String) -> Self { + Self { + name, + type_, + name_available: None, + reason: None, + message: None, + } + } +} +#[doc = "Represents a migration resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MigrationResource { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Migration resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MigrationResource { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + } + } +} +#[doc = "Represents a migration resource for patch."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MigrationResourceForPatch { + #[doc = "Migration resource properties for patch."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Application-specific metadata in the form of key-value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl MigrationResourceForPatch { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of migration resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MigrationResourceListResult { + #[doc = "A list of migration resources."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of migrations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for MigrationResourceListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl MigrationResourceListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Migration resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MigrationResourceProperties { + #[doc = "ID for migration, a GUID."] + #[serde(rename = "migrationId", default, skip_serializing_if = "Option::is_none")] + pub migration_id: Option, + #[doc = "Migration status."] + #[serde(rename = "currentStatus", default, skip_serializing_if = "Option::is_none")] + pub current_status: Option, + #[doc = "There are two types of migration modes Online and Offline"] + #[serde(rename = "migrationMode", default, skip_serializing_if = "Option::is_none")] + pub migration_mode: Option, + #[doc = "Database server metadata."] + #[serde(rename = "sourceDbServerMetadata", default, skip_serializing_if = "Option::is_none")] + pub source_db_server_metadata: Option, + #[doc = "Database server metadata."] + #[serde(rename = "targetDbServerMetadata", default, skip_serializing_if = "Option::is_none")] + pub target_db_server_metadata: Option, + #[doc = "ResourceId of the source database server"] + #[serde(rename = "sourceDbServerResourceId", default, skip_serializing_if = "Option::is_none")] + pub source_db_server_resource_id: Option, + #[doc = "Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection"] + #[serde( + rename = "sourceDbServerFullyQualifiedDomainName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_db_server_fully_qualified_domain_name: Option, + #[doc = "ResourceId of the source database server"] + #[serde(rename = "targetDbServerResourceId", default, skip_serializing_if = "Option::is_none")] + pub target_db_server_resource_id: Option, + #[doc = "Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection"] + #[serde( + rename = "targetDbServerFullyQualifiedDomainName", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_db_server_fully_qualified_domain_name: Option, + #[doc = "Migration secret parameters."] + #[serde(rename = "secretParameters", default, skip_serializing_if = "Option::is_none")] + pub secret_parameters: Option, + #[doc = "Number of databases to migrate"] + #[serde( + rename = "dbsToMigrate", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dbs_to_migrate: Vec, + #[doc = "Indicates whether to setup LogicalReplicationOnSourceDb, if needed"] + #[serde( + rename = "setupLogicalReplicationOnSourceDbIfNeeded", + default, + skip_serializing_if = "Option::is_none" + )] + pub setup_logical_replication_on_source_db_if_needed: Option, + #[doc = "Indicates whether the databases on the target server can be overwritten, if already present. If set to Disabled, the migration workflow will wait for a confirmation, if it detects that the database already exists."] + #[serde(rename = "overwriteDbsInTarget", default, skip_serializing_if = "Option::is_none")] + pub overwrite_dbs_in_target: Option, + #[doc = "Start time in UTC for migration window"] + #[serde(rename = "migrationWindowStartTimeInUtc", default, with = "azure_core::date::rfc3339::option")] + pub migration_window_start_time_in_utc: Option, + #[doc = "End time in UTC for migration window"] + #[serde(rename = "migrationWindowEndTimeInUtc", default, with = "azure_core::date::rfc3339::option")] + pub migration_window_end_time_in_utc: Option, + #[doc = "Indicates whether the data migration should start right away"] + #[serde(rename = "startDataMigration", default, skip_serializing_if = "Option::is_none")] + pub start_data_migration: Option, + #[doc = "To trigger cutover for entire migration we need to send this flag as Enabled"] + #[serde(rename = "triggerCutover", default, skip_serializing_if = "Option::is_none")] + pub trigger_cutover: Option, + #[doc = "When you want to trigger cutover for specific databases send triggerCutover flag as Enabled and database names in this array"] + #[serde( + rename = "dbsToTriggerCutoverOn", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dbs_to_trigger_cutover_on: Vec, + #[doc = "To trigger cancel for entire migration we need to send this flag as Enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cancel: Option, + #[doc = "When you want to trigger cancel for specific databases send cancel flag as Enabled and database names in this array"] + #[serde( + rename = "dbsToCancelMigrationOn", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dbs_to_cancel_migration_on: Vec, +} +impl MigrationResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod migration_resource_properties { + use super::*; + #[doc = "Indicates whether to setup LogicalReplicationOnSourceDb, if needed"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SetupLogicalReplicationOnSourceDbIfNeeded")] + pub enum SetupLogicalReplicationOnSourceDbIfNeeded { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SetupLogicalReplicationOnSourceDbIfNeeded { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SetupLogicalReplicationOnSourceDbIfNeeded { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SetupLogicalReplicationOnSourceDbIfNeeded { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("SetupLogicalReplicationOnSourceDbIfNeeded", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("SetupLogicalReplicationOnSourceDbIfNeeded", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates whether the databases on the target server can be overwritten, if already present. If set to Disabled, the migration workflow will wait for a confirmation, if it detects that the database already exists."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OverwriteDbsInTarget")] + pub enum OverwriteDbsInTarget { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OverwriteDbsInTarget { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OverwriteDbsInTarget { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OverwriteDbsInTarget { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("OverwriteDbsInTarget", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("OverwriteDbsInTarget", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates whether the data migration should start right away"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "StartDataMigration")] + pub enum StartDataMigration { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for StartDataMigration { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for StartDataMigration { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for StartDataMigration { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("StartDataMigration", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("StartDataMigration", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "To trigger cutover for entire migration we need to send this flag as Enabled"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "TriggerCutover")] + pub enum TriggerCutover { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for TriggerCutover { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for TriggerCutover { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for TriggerCutover { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("TriggerCutover", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("TriggerCutover", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "To trigger cancel for entire migration we need to send this flag as Enabled"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Cancel")] + pub enum Cancel { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Cancel { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Cancel { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Cancel { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Cancel", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Cancel", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Migration resource properties for patch."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MigrationResourcePropertiesForPatch { + #[doc = "ResourceId of the source database server"] + #[serde(rename = "sourceDbServerResourceId", default, skip_serializing_if = "Option::is_none")] + pub source_db_server_resource_id: Option, + #[doc = "Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection"] + #[serde( + rename = "sourceDbServerFullyQualifiedDomainName", + default, + skip_serializing_if = "Option::is_none" + )] + pub source_db_server_fully_qualified_domain_name: Option, + #[doc = "Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection"] + #[serde( + rename = "targetDbServerFullyQualifiedDomainName", + default, + skip_serializing_if = "Option::is_none" + )] + pub target_db_server_fully_qualified_domain_name: Option, + #[doc = "Migration secret parameters."] + #[serde(rename = "secretParameters", default, skip_serializing_if = "Option::is_none")] + pub secret_parameters: Option, + #[doc = "Number of databases to migrate"] + #[serde( + rename = "dbsToMigrate", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dbs_to_migrate: Vec, + #[doc = "Indicates whether to setup LogicalReplicationOnSourceDb, if needed"] + #[serde( + rename = "setupLogicalReplicationOnSourceDbIfNeeded", + default, + skip_serializing_if = "Option::is_none" + )] + pub setup_logical_replication_on_source_db_if_needed: + Option, + #[doc = "Indicates whether the databases on the target server can be overwritten, if already present. If set to Disabled, the migration workflow will wait for a confirmation, if it detects that the database already exists."] + #[serde(rename = "overwriteDbsInTarget", default, skip_serializing_if = "Option::is_none")] + pub overwrite_dbs_in_target: Option, + #[doc = "Start time in UTC for migration window"] + #[serde(rename = "migrationWindowStartTimeInUtc", default, with = "azure_core::date::rfc3339::option")] + pub migration_window_start_time_in_utc: Option, + #[doc = "Indicates whether the data migration should start right away"] + #[serde(rename = "startDataMigration", default, skip_serializing_if = "Option::is_none")] + pub start_data_migration: Option, + #[doc = "To trigger cutover for entire migration we need to send this flag as Enabled"] + #[serde(rename = "triggerCutover", default, skip_serializing_if = "Option::is_none")] + pub trigger_cutover: Option, + #[doc = "When you want to trigger cutover for specific databases send triggerCutover flag as Enabled and database names in this array"] + #[serde( + rename = "dbsToTriggerCutoverOn", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dbs_to_trigger_cutover_on: Vec, + #[doc = "To trigger cancel for entire migration we need to send this flag as Enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cancel: Option, + #[doc = "When you want to trigger cancel for specific databases send cancel flag as Enabled and database names in this array"] + #[serde( + rename = "dbsToCancelMigrationOn", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub dbs_to_cancel_migration_on: Vec, + #[doc = "There are two types of migration modes Online and Offline"] + #[serde(rename = "migrationMode", default, skip_serializing_if = "Option::is_none")] + pub migration_mode: Option, +} +impl MigrationResourcePropertiesForPatch { + pub fn new() -> Self { + Self::default() + } +} +pub mod migration_resource_properties_for_patch { + use super::*; + #[doc = "Indicates whether to setup LogicalReplicationOnSourceDb, if needed"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SetupLogicalReplicationOnSourceDbIfNeeded")] + pub enum SetupLogicalReplicationOnSourceDbIfNeeded { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SetupLogicalReplicationOnSourceDbIfNeeded { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SetupLogicalReplicationOnSourceDbIfNeeded { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SetupLogicalReplicationOnSourceDbIfNeeded { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("SetupLogicalReplicationOnSourceDbIfNeeded", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("SetupLogicalReplicationOnSourceDbIfNeeded", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates whether the databases on the target server can be overwritten, if already present. If set to Disabled, the migration workflow will wait for a confirmation, if it detects that the database already exists."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OverwriteDbsInTarget")] + pub enum OverwriteDbsInTarget { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OverwriteDbsInTarget { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OverwriteDbsInTarget { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OverwriteDbsInTarget { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("OverwriteDbsInTarget", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("OverwriteDbsInTarget", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Indicates whether the data migration should start right away"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "StartDataMigration")] + pub enum StartDataMigration { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for StartDataMigration { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for StartDataMigration { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for StartDataMigration { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("StartDataMigration", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("StartDataMigration", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "To trigger cutover for entire migration we need to send this flag as Enabled"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "TriggerCutover")] + pub enum TriggerCutover { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for TriggerCutover { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for TriggerCutover { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for TriggerCutover { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("TriggerCutover", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("TriggerCutover", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "To trigger cancel for entire migration we need to send this flag as Enabled"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Cancel")] + pub enum Cancel { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Cancel { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Cancel { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Cancel { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Cancel", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Cancel", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Migration secret parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MigrationSecretParameters { + #[doc = "Server admin credentials."] + #[serde(rename = "adminCredentials")] + pub admin_credentials: AdminCredentials, +} +impl MigrationSecretParameters { + pub fn new(admin_credentials: AdminCredentials) -> Self { + Self { admin_credentials } + } +} +#[doc = "Migration state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MigrationState")] +pub enum MigrationState { + InProgress, + WaitingForUserAction, + Canceled, + Failed, + Succeeded, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MigrationState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MigrationState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MigrationState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::InProgress => serializer.serialize_unit_variant("MigrationState", 0u32, "InProgress"), + Self::WaitingForUserAction => serializer.serialize_unit_variant("MigrationState", 1u32, "WaitingForUserAction"), + Self::Canceled => serializer.serialize_unit_variant("MigrationState", 2u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("MigrationState", 3u32, "Failed"), + Self::Succeeded => serializer.serialize_unit_variant("MigrationState", 4u32, "Succeeded"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Migration status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MigrationStatus { + #[doc = "Migration state."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Error message, if any, for the migration state"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + #[doc = "Migration sub state details."] + #[serde(rename = "currentSubStateDetails", default, skip_serializing_if = "Option::is_none")] + pub current_sub_state_details: Option, +} +impl MigrationStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Migration sub state."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "MigrationSubState")] +pub enum MigrationSubState { + PerformingPreRequisiteSteps, + #[serde(rename = "WaitingForLogicalReplicationSetupRequestOnSourceDB")] + WaitingForLogicalReplicationSetupRequestOnSourceDb, + WaitingForDBsToMigrateSpecification, + #[serde(rename = "WaitingForTargetDBOverwriteConfirmation")] + WaitingForTargetDbOverwriteConfirmation, + WaitingForDataMigrationScheduling, + WaitingForDataMigrationWindow, + MigratingData, + WaitingForCutoverTrigger, + CompletingMigration, + Completed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for MigrationSubState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for MigrationSubState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for MigrationSubState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PerformingPreRequisiteSteps => { + serializer.serialize_unit_variant("MigrationSubState", 0u32, "PerformingPreRequisiteSteps") + } + Self::WaitingForLogicalReplicationSetupRequestOnSourceDb => { + serializer.serialize_unit_variant("MigrationSubState", 1u32, "WaitingForLogicalReplicationSetupRequestOnSourceDB") + } + Self::WaitingForDBsToMigrateSpecification => { + serializer.serialize_unit_variant("MigrationSubState", 2u32, "WaitingForDBsToMigrateSpecification") + } + Self::WaitingForTargetDbOverwriteConfirmation => { + serializer.serialize_unit_variant("MigrationSubState", 3u32, "WaitingForTargetDBOverwriteConfirmation") + } + Self::WaitingForDataMigrationScheduling => { + serializer.serialize_unit_variant("MigrationSubState", 4u32, "WaitingForDataMigrationScheduling") + } + Self::WaitingForDataMigrationWindow => { + serializer.serialize_unit_variant("MigrationSubState", 5u32, "WaitingForDataMigrationWindow") + } + Self::MigratingData => serializer.serialize_unit_variant("MigrationSubState", 6u32, "MigratingData"), + Self::WaitingForCutoverTrigger => serializer.serialize_unit_variant("MigrationSubState", 7u32, "WaitingForCutoverTrigger"), + Self::CompletingMigration => serializer.serialize_unit_variant("MigrationSubState", 8u32, "CompletingMigration"), + Self::Completed => serializer.serialize_unit_variant("MigrationSubState", 9u32, "Completed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Migration sub state details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MigrationSubStateDetails { + #[doc = "Migration sub state."] + #[serde(rename = "currentSubState", default, skip_serializing_if = "Option::is_none")] + pub current_sub_state: Option, +} +impl MigrationSubStateDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a resource name availability."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NameAvailability { + #[serde(flatten)] + pub check_name_availability_response: CheckNameAvailabilityResponse, + #[doc = "name of the PostgreSQL server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "type of the server"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl NameAvailability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Network properties of a server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Network { + #[doc = "public network access is enabled or not"] + #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")] + pub public_network_access: Option, + #[doc = "delegated subnet arm resource id."] + #[serde(rename = "delegatedSubnetResourceId", default, skip_serializing_if = "Option::is_none")] + pub delegated_subnet_resource_id: Option, + #[doc = "private dns zone arm resource id."] + #[serde(rename = "privateDnsZoneArmResourceId", default, skip_serializing_if = "Option::is_none")] + pub private_dns_zone_arm_resource_id: Option, +} +impl Network { + pub fn new() -> Self { + Self::default() + } +} +pub mod network { + use super::*; + #[doc = "public network access is enabled or not"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PublicNetworkAccess")] + pub enum PublicNetworkAccess { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PublicNetworkAccess { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PublicNetworkAccess { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PublicNetworkAccess { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "REST API operation definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "The name of the operation being performed on this particular object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Display metadata associated with the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, + #[doc = "Indicates whether the operation is a data action"] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "The intended executor of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Additional descriptions for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation { + use super::*; + #[doc = "The intended executor of the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Origin")] + pub enum Origin { + NotSpecified, + #[serde(rename = "user")] + User, + #[serde(rename = "system")] + System, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Origin { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Origin { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Origin { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NotSpecified => serializer.serialize_unit_variant("Origin", 0u32, "NotSpecified"), + Self::User => serializer.serialize_unit_variant("Origin", 1u32, "user"), + Self::System => serializer.serialize_unit_variant("Origin", 2u32, "system"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Display metadata associated with the operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationDisplay { + #[doc = "Operation resource provider name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "Resource on which the operation is performed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "Localized friendly name for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "Operation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl OperationDisplay { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of resource provider operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationListResult { + #[doc = "Collection of available operation details"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "URL client should use to fetch the next page (per server side paging).\r\nIt's null for now, added for future use."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl OperationListResult { + pub fn new() -> Self { + Self::default() + } +} +pub type PrivateDnsZoneSuffix = String; +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Used to indicate role of the server in replication set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ReplicationRole")] +pub enum ReplicationRole { + None, + Primary, + AsyncReplica, + GeoAsyncReplica, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ReplicationRole { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ReplicationRole { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ReplicationRole { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("ReplicationRole", 0u32, "None"), + Self::Primary => serializer.serialize_unit_variant("ReplicationRole", 1u32, "Primary"), + Self::AsyncReplica => serializer.serialize_unit_variant("ReplicationRole", 2u32, "AsyncReplica"), + Self::GeoAsyncReplica => serializer.serialize_unit_variant("ReplicationRole", 3u32, "GeoAsyncReplica"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents server restart parameters."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RestartParameter { + #[doc = "Indicates whether to restart the server with failover."] + #[serde(rename = "restartWithFailover", default, skip_serializing_if = "Option::is_none")] + pub restart_with_failover: Option, + #[doc = "Failover mode."] + #[serde(rename = "failoverMode", default, skip_serializing_if = "Option::is_none")] + pub failover_mode: Option, +} +impl RestartParameter { + pub fn new() -> Self { + Self::default() + } +} +pub mod restart_parameter { + use super::*; + #[doc = "Failover mode."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "FailoverMode")] + pub enum FailoverMode { + PlannedFailover, + ForcedFailover, + PlannedSwitchover, + ForcedSwitchover, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for FailoverMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for FailoverMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for FailoverMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::PlannedFailover => serializer.serialize_unit_variant("FailoverMode", 0u32, "PlannedFailover"), + Self::ForcedFailover => serializer.serialize_unit_variant("FailoverMode", 1u32, "ForcedFailover"), + Self::PlannedSwitchover => serializer.serialize_unit_variant("FailoverMode", 2u32, "PlannedSwitchover"), + Self::ForcedSwitchover => serializer.serialize_unit_variant("FailoverMode", 3u32, "ForcedSwitchover"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents a server."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Server { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Sku information related properties of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Information describing the identities associated with this application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "The properties of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Server { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + sku: None, + identity: None, + properties: None, + system_data: None, + } + } +} +#[doc = "Server backup properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerBackup { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "The properties of a server backup."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl ServerBackup { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of server backups."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerBackupListResult { + #[doc = "The list of backups of a server."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ServerBackupListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ServerBackupListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a server backup."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerBackupProperties { + #[doc = "Backup type."] + #[serde(rename = "backupType", default, skip_serializing_if = "Option::is_none")] + pub backup_type: Option, + #[doc = "Backup completed time (ISO8601 format)."] + #[serde(rename = "completedTime", default, with = "azure_core::date::rfc3339::option")] + pub completed_time: Option, + #[doc = "Backup source"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, +} +impl ServerBackupProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod server_backup_properties { + use super::*; + #[doc = "Backup type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "BackupType")] + pub enum BackupType { + Full, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for BackupType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for BackupType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for BackupType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Full => serializer.serialize_unit_variant("BackupType", 0u32, "Full"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents a server to be updated."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerForUpdate { + #[doc = "Sku information related properties of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sku: Option, + #[doc = "Information describing the identities associated with this application."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Application-specific metadata in the form of key-value pairs."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl ServerForUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of servers."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerListResult { + #[doc = "The list of flexible servers"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ServerListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ServerListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The properties of a server."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerProperties { + #[doc = "The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation)."] + #[serde(rename = "administratorLogin", default, skip_serializing_if = "Option::is_none")] + pub administrator_login: Option, + #[doc = "The administrator login password (required for server creation)."] + #[serde(rename = "administratorLoginPassword", default, skip_serializing_if = "Option::is_none")] + pub administrator_login_password: Option, + #[doc = "The version of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "The minor version of the server."] + #[serde(rename = "minorVersion", default, skip_serializing_if = "Option::is_none")] + pub minor_version: Option, + #[doc = "A state of a server that is visible to user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The fully qualified domain name of a server."] + #[serde(rename = "fullyQualifiedDomainName", default, skip_serializing_if = "Option::is_none")] + pub fully_qualified_domain_name: Option, + #[doc = "Storage properties of a server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub storage: Option, + #[doc = "Authentication configuration properties of a server"] + #[serde(rename = "authConfig", default, skip_serializing_if = "Option::is_none")] + pub auth_config: Option, + #[doc = "Data encryption properties of a server"] + #[serde(rename = "dataEncryption", default, skip_serializing_if = "Option::is_none")] + pub data_encryption: Option, + #[doc = "Backup properties of a server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub backup: Option, + #[doc = "Network properties of a server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub network: Option, + #[doc = "High availability properties of a server"] + #[serde(rename = "highAvailability", default, skip_serializing_if = "Option::is_none")] + pub high_availability: Option, + #[doc = "Maintenance window properties of a server."] + #[serde(rename = "maintenanceWindow", default, skip_serializing_if = "Option::is_none")] + pub maintenance_window: Option, + #[doc = "The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica' or 'ReviveDropped'. This property is returned only for Replica server"] + #[serde(rename = "sourceServerResourceId", default, skip_serializing_if = "Option::is_none")] + pub source_server_resource_id: Option, + #[doc = "Restore point creation time (ISO8601 format), specifying the time to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'ReviveDropped'."] + #[serde(rename = "pointInTimeUTC", default, with = "azure_core::date::rfc3339::option")] + pub point_in_time_utc: Option, + #[doc = "availability zone information of the server."] + #[serde(rename = "availabilityZone", default, skip_serializing_if = "Option::is_none")] + pub availability_zone: Option, + #[doc = "Used to indicate role of the server in replication set."] + #[serde(rename = "replicationRole", default, skip_serializing_if = "Option::is_none")] + pub replication_role: Option, + #[doc = "Replicas allowed for a server."] + #[serde(rename = "replicaCapacity", default, skip_serializing_if = "Option::is_none")] + pub replica_capacity: Option, + #[doc = "The mode to create a new PostgreSQL server."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, +} +impl ServerProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod server_properties { + use super::*; + #[doc = "A state of a server that is visible to user."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Ready, + Dropping, + Disabled, + Starting, + Stopping, + Stopped, + Updating, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Ready => serializer.serialize_unit_variant("State", 0u32, "Ready"), + Self::Dropping => serializer.serialize_unit_variant("State", 1u32, "Dropping"), + Self::Disabled => serializer.serialize_unit_variant("State", 2u32, "Disabled"), + Self::Starting => serializer.serialize_unit_variant("State", 3u32, "Starting"), + Self::Stopping => serializer.serialize_unit_variant("State", 4u32, "Stopping"), + Self::Stopped => serializer.serialize_unit_variant("State", 5u32, "Stopped"), + Self::Updating => serializer.serialize_unit_variant("State", 6u32, "Updating"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The mode to create a new PostgreSQL server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreateMode")] + pub enum CreateMode { + Default, + Create, + Update, + PointInTimeRestore, + GeoRestore, + Replica, + ReviveDropped, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreateMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreateMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreateMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("CreateMode", 0u32, "Default"), + Self::Create => serializer.serialize_unit_variant("CreateMode", 1u32, "Create"), + Self::Update => serializer.serialize_unit_variant("CreateMode", 2u32, "Update"), + Self::PointInTimeRestore => serializer.serialize_unit_variant("CreateMode", 3u32, "PointInTimeRestore"), + Self::GeoRestore => serializer.serialize_unit_variant("CreateMode", 4u32, "GeoRestore"), + Self::Replica => serializer.serialize_unit_variant("CreateMode", 5u32, "Replica"), + Self::ReviveDropped => serializer.serialize_unit_variant("CreateMode", 6u32, "ReviveDropped"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerPropertiesForUpdate { + #[doc = "The password of the administrator login."] + #[serde(rename = "administratorLoginPassword", default, skip_serializing_if = "Option::is_none")] + pub administrator_login_password: Option, + #[doc = "The version of a server."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Storage properties of a server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub storage: Option, + #[doc = "Backup properties of a server"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub backup: Option, + #[doc = "High availability properties of a server"] + #[serde(rename = "highAvailability", default, skip_serializing_if = "Option::is_none")] + pub high_availability: Option, + #[doc = "Maintenance window properties of a server."] + #[serde(rename = "maintenanceWindow", default, skip_serializing_if = "Option::is_none")] + pub maintenance_window: Option, + #[doc = "Authentication configuration properties of a server"] + #[serde(rename = "authConfig", default, skip_serializing_if = "Option::is_none")] + pub auth_config: Option, + #[doc = "Data encryption properties of a server"] + #[serde(rename = "dataEncryption", default, skip_serializing_if = "Option::is_none")] + pub data_encryption: Option, + #[doc = "The mode to update a new PostgreSQL server."] + #[serde(rename = "createMode", default, skip_serializing_if = "Option::is_none")] + pub create_mode: Option, + #[doc = "Used to indicate role of the server in replication set."] + #[serde(rename = "replicationRole", default, skip_serializing_if = "Option::is_none")] + pub replication_role: Option, +} +impl ServerPropertiesForUpdate { + pub fn new() -> Self { + Self::default() + } +} +pub mod server_properties_for_update { + use super::*; + #[doc = "The mode to update a new PostgreSQL server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreateMode")] + pub enum CreateMode { + Default, + Update, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreateMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreateMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreateMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("CreateMode", 0u32, "Default"), + Self::Update => serializer.serialize_unit_variant("CreateMode", 1u32, "Update"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Sku capability"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerSku { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Sku name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Supported vCores"] + #[serde(rename = "vCores", default, skip_serializing_if = "Option::is_none")] + pub v_cores: Option, + #[doc = "Supported IOPS"] + #[serde(rename = "supportedIops", default, skip_serializing_if = "Option::is_none")] + pub supported_iops: Option, + #[doc = "Supported memory per vCore in MB"] + #[serde(rename = "supportedMemoryPerVcoreMb", default, skip_serializing_if = "Option::is_none")] + pub supported_memory_per_vcore_mb: Option, + #[doc = "List of supported Availability Zones. E.g. \"1\", \"2\", \"3\""] + #[serde( + rename = "supportedZones", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_zones: Vec, + #[doc = "Supported high availability mode"] + #[serde( + rename = "supportedHaMode", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_ha_mode: Vec, +} +impl ServerSku { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The version of a server."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ServerVersion")] +pub enum ServerVersion { + #[serde(rename = "15")] + N15, + #[serde(rename = "14")] + N14, + #[serde(rename = "13")] + N13, + #[serde(rename = "12")] + N12, + #[serde(rename = "11")] + N11, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ServerVersion { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ServerVersion { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ServerVersion { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::N15 => serializer.serialize_unit_variant("ServerVersion", 0u32, "15"), + Self::N14 => serializer.serialize_unit_variant("ServerVersion", 1u32, "14"), + Self::N13 => serializer.serialize_unit_variant("ServerVersion", 2u32, "13"), + Self::N12 => serializer.serialize_unit_variant("ServerVersion", 3u32, "12"), + Self::N11 => serializer.serialize_unit_variant("ServerVersion", 4u32, "11"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Server version capabilities."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerVersionCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Server version"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Supported servers versions to upgrade"] + #[serde( + rename = "supportedVersionsToUpgrade", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_versions_to_upgrade: Vec, +} +impl ServerVersionCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Sku information related properties of a server."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Sku { + #[doc = "The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3."] + pub name: String, + #[doc = "The tier of the particular SKU, e.g. Burstable."] + pub tier: sku::Tier, +} +impl Sku { + pub fn new(name: String, tier: sku::Tier) -> Self { + Self { name, tier } + } +} +pub mod sku { + use super::*; + #[doc = "The tier of the particular SKU, e.g. Burstable."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Tier")] + pub enum Tier { + Burstable, + GeneralPurpose, + MemoryOptimized, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Tier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Tier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Tier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Burstable => serializer.serialize_unit_variant("Tier", 0u32, "Burstable"), + Self::GeneralPurpose => serializer.serialize_unit_variant("Tier", 1u32, "GeneralPurpose"), + Self::MemoryOptimized => serializer.serialize_unit_variant("Tier", 2u32, "MemoryOptimized"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Storage properties of a server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Storage { + #[doc = "Max storage allowed for a server."] + #[serde(rename = "storageSizeGB", default, skip_serializing_if = "Option::is_none")] + pub storage_size_gb: Option, + #[doc = "Flag to enable / disable Storage Auto grow for flexible server."] + #[serde(rename = "autoGrow", default, skip_serializing_if = "Option::is_none")] + pub auto_grow: Option, + #[doc = "Name of storage tier for IOPS."] + #[serde(rename = "iopsTier", default, skip_serializing_if = "Option::is_none")] + pub iops_tier: Option, + #[doc = "Storage tier IOPS quantity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iops: Option, +} +impl Storage { + pub fn new() -> Self { + Self::default() + } +} +pub mod storage { + use super::*; + #[doc = "Flag to enable / disable Storage Auto grow for flexible server."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoGrow")] + pub enum AutoGrow { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoGrow { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoGrow { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoGrow { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("AutoGrow", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("AutoGrow", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Name of storage tier for IOPS."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IopsTier")] + pub enum IopsTier { + P1, + P2, + P3, + P4, + P6, + P10, + P15, + P20, + P30, + P40, + P50, + P60, + P70, + P80, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IopsTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IopsTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IopsTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("IopsTier", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("IopsTier", 1u32, "P2"), + Self::P3 => serializer.serialize_unit_variant("IopsTier", 2u32, "P3"), + Self::P4 => serializer.serialize_unit_variant("IopsTier", 3u32, "P4"), + Self::P6 => serializer.serialize_unit_variant("IopsTier", 4u32, "P6"), + Self::P10 => serializer.serialize_unit_variant("IopsTier", 5u32, "P10"), + Self::P15 => serializer.serialize_unit_variant("IopsTier", 6u32, "P15"), + Self::P20 => serializer.serialize_unit_variant("IopsTier", 7u32, "P20"), + Self::P30 => serializer.serialize_unit_variant("IopsTier", 8u32, "P30"), + Self::P40 => serializer.serialize_unit_variant("IopsTier", 9u32, "P40"), + Self::P50 => serializer.serialize_unit_variant("IopsTier", 10u32, "P50"), + Self::P60 => serializer.serialize_unit_variant("IopsTier", 11u32, "P60"), + Self::P70 => serializer.serialize_unit_variant("IopsTier", 12u32, "P70"), + Self::P80 => serializer.serialize_unit_variant("IopsTier", 13u32, "P80"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Storage edition capability"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageEditionCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Storage edition name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Default storage size in MB for storage edition"] + #[serde(rename = "defaultStorageSizeMb", default, skip_serializing_if = "Option::is_none")] + pub default_storage_size_mb: Option, + #[doc = "Flexible server supported storage range in MB"] + #[serde( + rename = "supportedStorageMb", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_storage_mb: Vec, +} +impl StorageEditionCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "storage size in MB capability"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageMbCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Supported IOPS"] + #[serde(rename = "supportedIops", default, skip_serializing_if = "Option::is_none")] + pub supported_iops: Option, + #[doc = "Storage size in MB"] + #[serde(rename = "storageSizeMb", default, skip_serializing_if = "Option::is_none")] + pub storage_size_mb: Option, + #[doc = "Default tier for IOPS"] + #[serde(rename = "defaultIopsTier", default, skip_serializing_if = "Option::is_none")] + pub default_iops_tier: Option, + #[doc = "List of available options to upgrade the storage performance"] + #[serde( + rename = "supportedIopsTiers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub supported_iops_tiers: Vec, +} +impl StorageMbCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents capability of a storage tier"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageTierCapability { + #[serde(flatten)] + pub capability_base: CapabilityBase, + #[doc = "Name to represent Storage tier capability"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Supported IOPS for this storage tier"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iops: Option, +} +impl StorageTierCapability { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "Information describing the identities associated with this application."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserAssignedIdentity { + #[doc = "Defines a map that contains user assigned identities."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, + #[doc = "the types of identities associated with this resource; currently restricted to 'None and UserAssigned'"] + #[serde(rename = "type")] + pub type_: user_assigned_identity::Type, +} +impl UserAssignedIdentity { + pub fn new(type_: user_assigned_identity::Type) -> Self { + Self { + user_assigned_identities: None, + type_, + } + } +} +pub mod user_assigned_identity { + use super::*; + #[doc = "the types of identities associated with this resource; currently restricted to 'None and UserAssigned'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + None, + UserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("Type", 0u32, "None"), + Self::UserAssigned => serializer.serialize_unit_variant("Type", 1u32, "UserAssigned"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Defines a map that contains user assigned identities."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentityMap {} +impl UserAssignedIdentityMap { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes a single user-assigned identity associated with the application."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserIdentity { + #[doc = "the object identifier of the Service Principal which this identity represents."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "the client identifier of the Service Principal which this identity represents."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserIdentity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Virtual network subnet usage parameter"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualNetworkSubnetUsageParameter { + #[doc = "Virtual network resource id."] + #[serde(rename = "virtualNetworkArmResourceId", default, skip_serializing_if = "Option::is_none")] + pub virtual_network_arm_resource_id: Option, +} +impl VirtualNetworkSubnetUsageParameter { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Virtual network subnet usage data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualNetworkSubnetUsageResult { + #[serde( + rename = "delegatedSubnetsUsage", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub delegated_subnets_usage: Vec, + #[doc = "location of the delegated subnet usage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "subscriptionId of the delegated subnet usage"] + #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] + pub subscription_id: Option, +} +impl VirtualNetworkSubnetUsageResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs index 09f3c0ea4c..c37d35066e 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_01/models.rs @@ -2088,13 +2088,13 @@ impl AzureVmWorkloadSapHanaDatabaseWorkloadItem { Self { azure_vm_workload_item } } } -#[doc = "Azure VM workload-specific protectable item representing SAP HANA Dbinstance."] +#[doc = "Azure VM workload-specific protectable item representing HANA HSR."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureVmWorkloadSapHanaHsr { +pub struct AzureVmWorkloadSapHanaHsrProtectableItem { #[serde(flatten)] pub azure_vm_workload_protectable_item: AzureVmWorkloadProtectableItem, } -impl AzureVmWorkloadSapHanaHsr { +impl AzureVmWorkloadSapHanaHsrProtectableItem { pub fn new(azure_vm_workload_protectable_item: AzureVmWorkloadProtectableItem) -> Self { Self { azure_vm_workload_protectable_item, @@ -8735,6 +8735,14 @@ pub struct PrivateEndpointConnection { #[doc = "The Private Endpoint network resource that is linked to the Private Endpoint connection"] #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] pub private_endpoint: Option, + #[doc = "Group Ids for the Private Endpoint"] + #[serde( + rename = "groupIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub group_ids: Vec, #[doc = "Private Link Service Connection State"] #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] pub private_link_service_connection_state: Option, @@ -8812,8 +8820,8 @@ pub struct PrivateLinkServiceConnectionState { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Gets or sets actions required"] - #[serde(rename = "actionRequired", default, skip_serializing_if = "Option::is_none")] - pub action_required: Option, + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, } impl PrivateLinkServiceConnectionState { pub fn new() -> Self { diff --git a/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs b/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs index f2dcc07060..04827f146b 100644 --- a/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs +++ b/services/mgmt/recoveryservicesbackup/src/package_2023_02/models.rs @@ -2088,13 +2088,13 @@ impl AzureVmWorkloadSapHanaDatabaseWorkloadItem { Self { azure_vm_workload_item } } } -#[doc = "Azure VM workload-specific protectable item representing SAP HANA Dbinstance."] +#[doc = "Azure VM workload-specific protectable item representing HANA HSR."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureVmWorkloadSapHanaHsr { +pub struct AzureVmWorkloadSapHanaHsrProtectableItem { #[serde(flatten)] pub azure_vm_workload_protectable_item: AzureVmWorkloadProtectableItem, } -impl AzureVmWorkloadSapHanaHsr { +impl AzureVmWorkloadSapHanaHsrProtectableItem { pub fn new(azure_vm_workload_protectable_item: AzureVmWorkloadProtectableItem) -> Self { Self { azure_vm_workload_protectable_item, @@ -8773,6 +8773,14 @@ pub struct PrivateEndpointConnection { #[doc = "The Private Endpoint network resource that is linked to the Private Endpoint connection"] #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")] pub private_endpoint: Option, + #[doc = "Group Ids for the Private Endpoint"] + #[serde( + rename = "groupIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub group_ids: Vec, #[doc = "Private Link Service Connection State"] #[serde(rename = "privateLinkServiceConnectionState", default, skip_serializing_if = "Option::is_none")] pub private_link_service_connection_state: Option, @@ -8850,8 +8858,8 @@ pub struct PrivateLinkServiceConnectionState { #[serde(default, skip_serializing_if = "Option::is_none")] pub description: Option, #[doc = "Gets or sets actions required"] - #[serde(rename = "actionRequired", default, skip_serializing_if = "Option::is_none")] - pub action_required: Option, + #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")] + pub actions_required: Option, } impl PrivateLinkServiceConnectionState { pub fn new() -> Self { diff --git a/services/mgmt/redis/Cargo.toml b/services/mgmt/redis/Cargo.toml index fa8d93218c..bd12d363be 100644 --- a/services/mgmt/redis/Cargo.toml +++ b/services/mgmt/redis/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2022-06", "enable_reqwest"] +default = ["package-2023-04", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-05" = [] +"package-2023-04" = [] "package-2022-06" = [] "package-2022-05" = [] -"package-2021-06" = [] -"package-2020-12" = [] -"package-2020-06" = [] \ No newline at end of file +"package-2021-06" = [] \ No newline at end of file diff --git a/services/mgmt/redis/README.md b/services/mgmt/redis/README.md index 61eb4ea6e7..b09f3a237d 100644 --- a/services/mgmt/redis/README.md +++ b/services/mgmt/redis/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/redis/reso To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2022-06`. +The default tag is `package-2023-04`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-05` has 40 operations from 1 API versions: `2023-05-01-preview`. Use crate feature `package-preview-2023-05` to enable. The operations will be in the `package_preview_2023_05` module. +- `package-2023-04` has 32 operations from 1 API versions: `2023-04-01`. Use crate feature `package-2023-04` to enable. The operations will be in the `package_2023_04` module. - `package-2022-06` has 32 operations from 1 API versions: `2022-06-01`. Use crate feature `package-2022-06` to enable. The operations will be in the `package_2022_06` module. - `package-2022-05` has 32 operations from 1 API versions: `2022-05-01`. Use crate feature `package-2022-05` to enable. The operations will be in the `package_2022_05` module. -- `package-2021-06` has 32 operations from 1 API versions: `2021-06-01`. Use crate feature `package-2021-06` to enable. The operations will be in the `package_2021_06` module. -- `package-2020-12` has 31 operations from 1 API versions: `2020-12-01`. Use crate feature `package-2020-12` to enable. The operations will be in the `package_2020_12` module. -- `package-2020-06` has 31 operations from 1 API versions: `2020-06-01`. Use crate feature `package-2020-06` to enable. The operations will be in the `package_2020_06` module. \ No newline at end of file +- `package-2021-06` has 32 operations from 1 API versions: `2021-06-01`. Use crate feature `package-2021-06` to enable. The operations will be in the `package_2021_06` module. \ No newline at end of file diff --git a/services/mgmt/redis/src/lib.rs b/services/mgmt/redis/src/lib.rs index 4ed5ef48b9..99959ac988 100644 --- a/services/mgmt/redis/src/lib.rs +++ b/services/mgmt/redis/src/lib.rs @@ -3,6 +3,14 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-05")] +pub mod package_preview_2023_05; +#[cfg(all(feature = "package-preview-2023-05", not(feature = "no-default-tag")))] +pub use package_preview_2023_05::*; +#[cfg(feature = "package-2023-04")] +pub mod package_2023_04; +#[cfg(all(feature = "package-2023-04", not(feature = "no-default-tag")))] +pub use package_2023_04::*; #[cfg(feature = "package-2022-06")] pub mod package_2022_06; #[cfg(all(feature = "package-2022-06", not(feature = "no-default-tag")))] @@ -15,11 +23,3 @@ pub use package_2022_05::*; pub mod package_2021_06; #[cfg(all(feature = "package-2021-06", not(feature = "no-default-tag")))] pub use package_2021_06::*; -#[cfg(feature = "package-2020-12")] -pub mod package_2020_12; -#[cfg(all(feature = "package-2020-12", not(feature = "no-default-tag")))] -pub use package_2020_12::*; -#[cfg(feature = "package-2020-06")] -pub mod package_2020_06; -#[cfg(all(feature = "package-2020-06", not(feature = "no-default-tag")))] -pub use package_2020_06::*; diff --git a/services/mgmt/redis/src/package_2020_12/mod.rs b/services/mgmt/redis/src/package_2023_04/mod.rs similarity index 96% rename from services/mgmt/redis/src/package_2020_12/mod.rs rename to services/mgmt/redis/src/package_2023_04/mod.rs index c48529b117..b31dd0c6e2 100644 --- a/services/mgmt/redis/src/package_2020_12/mod.rs +++ b/services/mgmt/redis/src/package_2023_04/mod.rs @@ -103,6 +103,9 @@ impl Client { pipeline, } } + pub fn async_operation_status_client(&self) -> async_operation_status::Client { + async_operation_status::Client(self.clone()) + } pub fn firewall_rules_client(&self) -> firewall_rules::Client { firewall_rules::Client(self.clone()) } @@ -200,7 +203,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -216,7 +219,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -541,7 +544,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -627,7 +630,7 @@ pub mod redis { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -643,7 +646,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let history = &this.history; req.url_mut().query_pairs_mut().append_pair("history", &history.to_string()); let req_body = azure_core::EMPTY_BODY; @@ -737,7 +740,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -832,7 +835,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -903,6 +906,7 @@ pub mod redis { pub(crate) subscription_id: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -927,7 +931,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -999,7 +1003,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1081,7 +1085,7 @@ pub mod redis { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1097,7 +1101,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1188,7 +1192,7 @@ pub mod redis { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1204,7 +1208,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1296,7 +1300,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -1391,7 +1395,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1486,7 +1490,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1559,7 +1563,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1620,7 +1624,7 @@ pub mod redis { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1799,7 +1803,7 @@ pub mod firewall_rules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1815,7 +1819,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1909,7 +1913,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2005,7 +2009,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2078,7 +2082,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2256,7 +2260,7 @@ pub mod patch_schedules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2272,7 +2276,7 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2366,7 +2370,7 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2462,7 +2466,7 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2535,7 +2539,7 @@ pub mod patch_schedules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2712,7 +2716,7 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2809,7 +2813,7 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2857,6 +2861,7 @@ pub mod linked_server { pub(crate) subscription_id: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2882,7 +2887,7 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2966,7 +2971,7 @@ pub mod linked_server { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2982,7 +2987,7 @@ pub mod linked_server { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -3169,7 +3174,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3252,7 +3257,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3349,7 +3354,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.properties)?; req.set_body(req_body); @@ -3422,7 +3427,7 @@ pub mod private_endpoint_connections { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3529,7 +3534,7 @@ pub mod private_link_resources { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2020-12-01"); + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3539,3 +3544,121 @@ pub mod private_link_resources { } } } +pub mod async_operation_status { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "For checking the ongoing status of an operation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `location`: The location at which operation was triggered"] + #[doc = "* `operation_id`: The ID of asynchronous operation"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + location: impl Into, + operation_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + location: location.into(), + operation_id: operation_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) location: String, + pub(crate) operation_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Cache/locations/{}/asyncOperations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-04-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/redis/src/package_2020_12/models.rs b/services/mgmt/redis/src/package_2023_04/models.rs similarity index 84% rename from services/mgmt/redis/src/package_2020_12/models.rs rename to services/mgmt/redis/src/package_2023_04/models.rs index e5babeeece..524b3f2ab8 100644 --- a/services/mgmt/redis/src/package_2020_12/models.rs +++ b/services/mgmt/redis/src/package_2023_04/models.rs @@ -93,6 +93,12 @@ pub struct ExportRdbParameters { pub prefix: String, #[doc = "Container name to export to."] pub container: String, + #[doc = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS"] + #[serde(rename = "preferred-data-archive-auth-method", default, skip_serializing_if = "Option::is_none")] + pub preferred_data_archive_auth_method: Option, + #[doc = "Subscription id of the storage container for data to be exported using ManagedIdentity."] + #[serde(rename = "storage-subscription-id", default, skip_serializing_if = "Option::is_none")] + pub storage_subscription_id: Option, } impl ExportRdbParameters { pub fn new(prefix: String, container: String) -> Self { @@ -100,6 +106,8 @@ impl ExportRdbParameters { format: None, prefix, container, + preferred_data_archive_auth_method: None, + storage_subscription_id: None, } } } @@ -111,10 +119,91 @@ pub struct ImportRdbParameters { pub format: Option, #[doc = "files to import."] pub files: Vec, + #[doc = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS"] + #[serde(rename = "preferred-data-archive-auth-method", default, skip_serializing_if = "Option::is_none")] + pub preferred_data_archive_auth_method: Option, + #[doc = "Subscription id of the storage container containing files to import using Managed Identity."] + #[serde(rename = "storage-subscription-id", default, skip_serializing_if = "Option::is_none")] + pub storage_subscription_id: Option, } impl ImportRdbParameters { pub fn new(files: Vec) -> Self { - Self { format: None, files } + Self { + format: None, + files, + preferred_data_archive_auth_method: None, + storage_subscription_id: None, + } + } +} +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ManagedServiceIdentity { + #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] + #[serde(rename = "type")] + pub type_: ManagedServiceIdentityType, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl ManagedServiceIdentity { + pub fn new(type_: ManagedServiceIdentityType) -> Self { + Self { + principal_id: None, + tenant_id: None, + type_, + user_assigned_identities: None, + } + } +} +#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ManagedServiceIdentityType")] +pub enum ManagedServiceIdentityType { + None, + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ManagedServiceIdentityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ManagedServiceIdentityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ManagedServiceIdentityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => { + serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned, UserAssigned") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } #[doc = "The response of listUpgradeNotifications."] @@ -206,6 +295,68 @@ impl OperationListResult { Self::default() } } +#[doc = "Asynchronous operation status"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationStatus { + #[serde(flatten)] + pub operation_status_result: OperationStatusResult, + #[doc = "Additional properties from RP, only when operation is successful"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl OperationStatus { + pub fn new(operation_status_result: OperationStatusResult) -> Self { + Self { + operation_status_result, + properties: None, + } + } +} +#[doc = "The current status of an async operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationStatusResult { + #[doc = "Fully qualified ID for the async operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the async operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Operation status."] + pub status: String, + #[doc = "Percent of the operation that is complete."] + #[serde(rename = "percentComplete", default, skip_serializing_if = "Option::is_none")] + pub percent_complete: Option, + #[doc = "The start time of the operation."] + #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] + pub start_time: Option, + #[doc = "The end time of the operation."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "The operations list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub operations: Vec, + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl OperationStatusResult { + pub fn new(status: String) -> Self { + Self { + id: None, + name: None, + status, + percent_complete: None, + start_time: None, + end_time: None, + operations: Vec::new(), + error: None, + } + } +} #[doc = "The Private Endpoint resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PrivateEndpoint { @@ -470,7 +621,7 @@ pub struct RedisCommonProperties { #[doc = "All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc."] #[serde(rename = "redisConfiguration", default, skip_serializing_if = "Option::is_none")] pub redis_configuration: Option, - #[doc = "Redis version. This should be in the form 'major[.minor[.build]]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Only the major and minor version are used in a PUT/PATCH request. Supported versions: 4.0, 6.0."] + #[doc = "Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'."] #[serde(rename = "redisVersion", default, skip_serializing_if = "Option::is_none")] pub redis_version: Option, #[doc = "Specifies whether the non-ssl Redis server port (6379) is enabled."] @@ -508,7 +659,7 @@ pub mod redis_common_properties { #[doc = "Specifies whether the rdb backup is enabled"] #[serde(rename = "rdb-backup-enabled", default, skip_serializing_if = "Option::is_none")] pub rdb_backup_enabled: Option, - #[doc = "Specifies the frequency for creating rdb backup"] + #[doc = "Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440)"] #[serde(rename = "rdb-backup-frequency", default, skip_serializing_if = "Option::is_none")] pub rdb_backup_frequency: Option, #[doc = "Specifies the maximum number of snapshots for rdb backup"] @@ -541,12 +692,25 @@ pub mod redis_common_properties { #[doc = "The max clients config"] #[serde(default, skip_serializing_if = "Option::is_none")] pub maxclients: Option, + #[doc = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS"] + #[serde(rename = "preferred-data-archive-auth-method", default, skip_serializing_if = "Option::is_none")] + pub preferred_data_archive_auth_method: Option, + #[doc = "Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS"] + #[serde( + rename = "preferred-data-persistence-auth-method", + default, + skip_serializing_if = "Option::is_none" + )] + pub preferred_data_persistence_auth_method: Option, #[doc = "Zonal Configuration"] #[serde(rename = "zonal-configuration", default, skip_serializing_if = "Option::is_none")] pub zonal_configuration: Option, #[doc = "Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view."] #[serde(default, skip_serializing_if = "Option::is_none")] pub authnotrequired: Option, + #[doc = "SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity."] + #[serde(rename = "storage-subscription-id", default, skip_serializing_if = "Option::is_none")] + pub storage_subscription_id: Option, } impl RedisConfiguration { pub fn new() -> Self { @@ -655,6 +819,9 @@ pub struct RedisCreateParameters { #[doc = "Resource tags."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, } impl RedisCreateParameters { pub fn new(properties: RedisCreateProperties, location: String) -> Self { @@ -663,6 +830,7 @@ impl RedisCreateParameters { zones: Vec::new(), location, tags: None, + identity: None, } } } @@ -831,6 +999,12 @@ pub struct RedisLinkedServerCreateProperties { #[doc = "Role of the linked server."] #[serde(rename = "serverRole")] pub server_role: redis_linked_server_create_properties::ServerRole, + #[doc = "The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience."] + #[serde(rename = "geoReplicatedPrimaryHostName", default, skip_serializing_if = "Option::is_none")] + pub geo_replicated_primary_host_name: Option, + #[doc = "The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover."] + #[serde(rename = "primaryHostName", default, skip_serializing_if = "Option::is_none")] + pub primary_host_name: Option, } impl RedisLinkedServerCreateProperties { pub fn new( @@ -842,6 +1016,8 @@ impl RedisLinkedServerCreateProperties { linked_redis_cache_id, linked_redis_cache_location, server_role, + geo_replicated_primary_host_name: None, + primary_host_name: None, } } } @@ -1198,6 +1374,9 @@ pub struct RedisResource { skip_serializing_if = "Vec::is_empty" )] pub zones: Vec, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, } impl RedisResource { pub fn new(tracked_resource: TrackedResource, properties: RedisProperties) -> Self { @@ -1205,6 +1384,7 @@ impl RedisResource { tracked_resource, properties, zones: Vec::new(), + identity: None, } } } @@ -1217,6 +1397,9 @@ pub struct RedisUpdateParameters { #[doc = "Resource tags."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, } impl RedisUpdateParameters { pub fn new() -> Self { @@ -1276,7 +1459,7 @@ pub struct ScheduleEntry { #[doc = "Start hour after which cache patching can start."] #[serde(rename = "startHourUtc")] pub start_hour_utc: i32, - #[doc = "ISO8601 timespan specifying how much time cache patching can take."] + #[doc = "ISO8601 timespan specifying how much time cache patching can take. "] #[serde(rename = "maintenanceWindow", default, skip_serializing_if = "Option::is_none")] pub maintenance_window: Option, } @@ -1437,3 +1620,26 @@ impl UpgradeNotification { Self::default() } } +#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User assigned identity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client ID of the assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/mod.rs b/services/mgmt/redis/src/package_preview_2023_05/mod.rs similarity index 72% rename from services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/mod.rs rename to services/mgmt/redis/src/package_preview_2023_05/mod.rs index 71df4ba650..8ae1627efd 100644 --- a/services/mgmt/postgresql/src/package_flexibleserver_2021_06_preview/mod.rs +++ b/services/mgmt/redis/src/package_preview_2023_05/mod.rs @@ -103,249 +103,410 @@ impl Client { pipeline, } } - pub fn advisors_client(&self) -> advisors::Client { - advisors::Client(self.clone()) + pub fn access_policy_client(&self) -> access_policy::Client { + access_policy::Client(self.clone()) } - pub fn check_name_availability_client(&self) -> check_name_availability::Client { - check_name_availability::Client(self.clone()) + pub fn access_policy_assignment_client(&self) -> access_policy_assignment::Client { + access_policy_assignment::Client(self.clone()) } - pub fn configurations_client(&self) -> configurations::Client { - configurations::Client(self.clone()) - } - pub fn databases_client(&self) -> databases::Client { - databases::Client(self.clone()) + pub fn async_operation_status_client(&self) -> async_operation_status::Client { + async_operation_status::Client(self.clone()) } pub fn firewall_rules_client(&self) -> firewall_rules::Client { firewall_rules::Client(self.clone()) } - pub fn get_private_dns_zone_suffix_client(&self) -> get_private_dns_zone_suffix::Client { - get_private_dns_zone_suffix::Client(self.clone()) - } - pub fn location_based_capabilities_client(&self) -> location_based_capabilities::Client { - location_based_capabilities::Client(self.clone()) + pub fn linked_server_client(&self) -> linked_server::Client { + linked_server::Client(self.clone()) } pub fn operations_client(&self) -> operations::Client { operations::Client(self.clone()) } - pub fn query_performance_insight_data_client(&self) -> query_performance_insight_data::Client { - query_performance_insight_data::Client(self.clone()) + pub fn patch_schedules_client(&self) -> patch_schedules::Client { + patch_schedules::Client(self.clone()) } - pub fn query_texts_client(&self) -> query_texts::Client { - query_texts::Client(self.clone()) + pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client { + private_endpoint_connections::Client(self.clone()) } - pub fn recommended_actions_client(&self) -> recommended_actions::Client { - recommended_actions::Client(self.clone()) + pub fn private_link_resources_client(&self) -> private_link_resources::Client { + private_link_resources::Client(self.clone()) } - pub fn servers_client(&self) -> servers::Client { - servers::Client(self.clone()) + pub fn redis_client(&self) -> redis::Client { + redis::Client(self.clone()) } - pub fn top_query_statistics_client(&self) -> top_query_statistics::Client { - top_query_statistics::Client(self.clone()) - } - pub fn virtual_network_subnet_usage_client(&self) -> virtual_network_subnet_usage::Client { - virtual_network_subnet_usage::Client(self.clone()) +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all of the available REST API operations of the Microsoft.Cache provider."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } } - pub fn wait_statistics_client(&self) -> wait_statistics::Client { - wait_statistics::Client(self.clone()) + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!("{}/providers/Microsoft.Cache/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } } } -pub mod servers { +pub mod redis { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets information about a server."] + #[doc = "Checks that the redis cache name is valid and is not already in use."] #[doc = ""] #[doc = "Arguments:"] + #[doc = "* `parameters`: Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'"] #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn check_name_availability( + &self, + parameters: impl Into, + subscription_id: impl Into, + ) -> check_name_availability::RequestBuilder { + check_name_availability::RequestBuilder { + client: self.0.clone(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets any upgrade notifications for a Redis cache."] + #[doc = ""] + #[doc = "Arguments:"] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn get( + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `history`: how many minutes in past to look for upgrade notifications"] + pub fn list_upgrade_notifications( &self, + resource_group_name: impl Into, + name: impl Into, subscription_id: impl Into, + history: f64, + ) -> list_upgrade_notifications::RequestBuilder { + list_upgrade_notifications::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + name: name.into(), + subscription_id: subscription_id.into(), + history, + } + } + #[doc = "Gets a Redis cache (resource description)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, resource_group_name: impl Into, - server_name: impl Into, + name: impl Into, + subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Creates a new server."] + #[doc = "Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `parameters`: The required parameters for creating or updating a server."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `parameters`: Parameters supplied to the Create Redis operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - parameters: impl Into, + name: impl Into, + parameters: impl Into, + subscription_id: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), parameters: parameters.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Updates an existing server. The request body can contain one to many of the properties present in the normal server definition."] + #[doc = "Update an existing Redis cache."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `parameters`: The required parameters for updating a server."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `parameters`: Parameters supplied to the Update Redis operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn update( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - parameters: impl Into, + name: impl Into, + parameters: impl Into, + subscription_id: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), parameters: parameters.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Deletes a server."] + #[doc = "Deletes a Redis cache."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, + name: impl Into, + subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "List all the servers in a given resource group."] + #[doc = "Lists all Redis caches in a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn list_by_resource_group( &self, - subscription_id: impl Into, resource_group_name: impl Into, + subscription_id: impl Into, ) -> list_by_resource_group::RequestBuilder { list_by_resource_group::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "List all the servers in a given subscription."] + #[doc = "Gets all Redis caches in the specified subscription."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), } } - #[doc = "Restarts a server."] + #[doc = "Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn restart( + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_keys( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - ) -> restart::RequestBuilder { - restart::RequestBuilder { + name: impl Into, + subscription_id: impl Into, + ) -> list_keys::RequestBuilder { + list_keys::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - parameters: None, + name: name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Starts a server."] + #[doc = "Regenerate Redis cache's access keys. This operation requires write permission to the cache resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn start( + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `parameters`: Specifies which key to regenerate."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn regenerate_key( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - ) -> start::RequestBuilder { - start::RequestBuilder { + name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> regenerate_key::RequestBuilder { + regenerate_key::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Stops a server."] + #[doc = "Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn stop( + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `parameters`: Specifies which Redis node(s) to reboot."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn force_reboot( &self, + resource_group_name: impl Into, + name: impl Into, + parameters: impl Into, subscription_id: impl Into, + ) -> force_reboot::RequestBuilder { + force_reboot::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + name: name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Import data into Redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `parameters`: Parameters for Redis import operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn import_data( + &self, resource_group_name: impl Into, - server_name: impl Into, - ) -> stop::RequestBuilder { - stop::RequestBuilder { + name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> import_data::RequestBuilder { + import_data::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + name: name.into(), + parameters: parameters.into(), subscription_id: subscription_id.into(), + } + } + #[doc = "Export data from the redis cache to blobs in a container."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `parameters`: Parameters for Redis export operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn export_data( + &self, + resource_group_name: impl Into, + name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> export_data::RequestBuilder { + export_data::RequestBuilder { + client: self.0.clone(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), } } } - pub mod get { + pub mod check_name_availability { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Server = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -363,9 +524,8 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) parameters: models::CheckNameAvailabilityParameters, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) server_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -377,13 +537,11 @@ pub mod servers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + "{}/subscriptions/{}/providers/Microsoft.Cache/CheckNameAvailability", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.server_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -392,34 +550,23 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod create { + pub mod list_upgrade_notifications { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Server = serde_json::from_slice(&bytes)?; + let body: models::NotificationListResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -456,29 +603,236 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) parameters: models::Server, + pub(crate) name: String, + pub(crate) subscription_id: String, + pub(crate) history: f64, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/listUpgradeNotifications", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let history = &this.history; + req.url_mut().query_pairs_mut().append_pair("history", &history.to_string()); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RedisResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RedisResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) name: String, + pub(crate) parameters: models::RedisCreateParameters, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -487,7 +841,7 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -497,8 +851,8 @@ pub mod servers { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -513,9 +867,9 @@ pub mod servers { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Server = serde_json::from_slice(&bytes)?; + let body: models::RedisResource = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -552,10 +906,10 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) parameters: models::ServerForUpdate, + pub(crate) name: String, + pub(crate) parameters: models::RedisUpdateParameters, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -568,11 +922,11 @@ pub mod servers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -583,7 +937,7 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -593,8 +947,8 @@ pub mod servers { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -625,9 +979,9 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -640,11 +994,11 @@ pub mod servers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -655,7 +1009,7 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -668,9 +1022,9 @@ pub mod servers { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ServerListResult = serde_json::from_slice(&bytes)?; + let body: models::RedisListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -707,16 +1061,16 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis", this.client.endpoint(), &this.subscription_id, &this.resource_group_name @@ -737,7 +1091,7 @@ pub mod servers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -753,7 +1107,7 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -773,13 +1127,13 @@ pub mod servers { } } } - pub mod list { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ServerListResult = serde_json::from_slice(&bytes)?; + let body: models::RedisListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -819,12 +1173,12 @@ pub mod servers { pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers", + "{}/subscriptions/{}/providers/Microsoft.Cache/redis", this.client.endpoint(), &this.subscription_id ))?; @@ -844,7 +1198,7 @@ pub mod servers { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -860,7 +1214,7 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -880,9 +1234,32 @@ pub mod servers { } } } - pub mod restart { + pub mod list_keys { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RedisAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -900,18 +1277,11 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) parameters: Option, + pub(crate) name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "The parameters for restarting a server."] - pub fn parameters(mut self, parameters: impl Into) -> Self { - self.parameters = Some(parameters.into()); - self - } - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -921,11 +1291,11 @@ pub mod servers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/restart", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/listKeys", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); @@ -936,83 +1306,54 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = if let Some(parameters) = &this.parameters { - req.insert_header("content-type", "application/json"); - azure_core::to_json(parameters)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod start { + pub mod regenerate_key { use super::models; pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) server_name: String, + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RedisAccessKeys = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } } - impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/start", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.server_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - } - pub mod stop { - use super::models; - pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1030,12 +1371,12 @@ pub mod servers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) name: String, + pub(crate) parameters: models::RedisRegenerateKeyParameters, + pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1045,11 +1386,11 @@ pub mod servers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/stop", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/regenerateKey", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); @@ -1060,117 +1401,35 @@ pub mod servers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - } -} -pub mod firewall_rules { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all the firewall rules in a given server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `firewall_rule_name`: The name of the server firewall rule."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - firewall_rule_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - firewall_rule_name: firewall_rule_name.into(), - } - } - #[doc = "Creates a new firewall rule or updates an existing firewall rule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `firewall_rule_name`: The name of the server firewall rule."] - #[doc = "* `parameters`: The required parameters for creating or updating a firewall rule."] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - firewall_rule_name: impl Into, - parameters: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - firewall_rule_name: firewall_rule_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes a PostgreSQL server firewall rule."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `firewall_rule_name`: The name of the server firewall rule."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - firewall_rule_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - firewall_rule_name: firewall_rule_name.into(), - } - } - #[doc = "List all the firewall rules in a given PostgreSQL server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn list_by_server( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod force_reboot { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FirewallRule = serde_json::from_slice(&bytes)?; + let body: models::RedisForceRebootResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1207,10 +1466,10 @@ pub mod firewall_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) firewall_rule_name: String, + pub(crate) name: String, + pub(crate) parameters: models::RedisRebootParameters, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1222,14 +1481,13 @@ pub mod firewall_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/forceReboot", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.firewall_rule_name + &this.name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1238,8 +1496,9 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1247,8 +1506,8 @@ pub mod firewall_rules { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1259,32 +1518,9 @@ pub mod firewall_rules { } } } - pub mod create_or_update { + pub mod import_data { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FirewallRule = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1302,11 +1538,10 @@ pub mod firewall_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) firewall_rule_name: String, - pub(crate) parameters: models::FirewallRule, + pub(crate) name: String, + pub(crate) parameters: models::ImportRdbParameters, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1319,14 +1554,13 @@ pub mod firewall_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/import", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.firewall_rule_name + &this.name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1335,7 +1569,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1344,20 +1578,8 @@ pub mod firewall_rules { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod delete { + pub mod export_data { use super::models; pub struct Response(azure_core::Response); #[derive(Clone)] @@ -1377,10 +1599,10 @@ pub mod firewall_rules { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) firewall_rule_name: String, + pub(crate) name: String, + pub(crate) parameters: models::ExportRdbParameters, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1393,14 +1615,13 @@ pub mod firewall_rules { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/export", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.firewall_rule_name + &this.name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1409,8 +1630,9 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1418,13 +1640,107 @@ pub mod firewall_rules { } } } - pub mod list_by_server { +} +pub mod firewall_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all firewall rules in the specified redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cache_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + } + } + #[doc = "Gets a single firewall rule in a specified redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `rule_name`: The name of the firewall rule."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + rule_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + rule_name: rule_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Create or update a redis cache firewall rule"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `rule_name`: The name of the firewall rule."] + #[doc = "* `parameters`: Parameters supplied to the create or update redis firewall rule operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + rule_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + rule_name: rule_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes a single firewall rule in a specified redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `rule_name`: The name of the firewall rule."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + rule_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + rule_name: rule_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FirewallRuleListResult = serde_json::from_slice(&bytes)?; + let body: models::RedisFirewallRuleListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1463,19 +1779,19 @@ pub mod firewall_rules { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) cache_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/firewallRules", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.cache_name ))?; let rsp = match continuation { Some(value) => { @@ -1493,7 +1809,7 @@ pub mod firewall_rules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1509,215 +1825,7 @@ pub mod firewall_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } -} -pub mod configurations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List all the configurations in a given server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn list_by_server( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - } - } - #[doc = "Gets information about a configuration of server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `configuration_name`: The name of the server configuration."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - configuration_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - configuration_name: configuration_name.into(), - } - } - #[doc = "Updates a configuration of a server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `configuration_name`: The name of the server configuration."] - #[doc = "* `parameters`: The required parameters for updating a server configuration."] - pub fn put( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - configuration_name: impl Into, - parameters: impl Into, - ) -> put::RequestBuilder { - put::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - configuration_name: configuration_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Updates a configuration of a server."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `configuration_name`: The name of the server configuration."] - #[doc = "* `parameters`: The required parameters for updating a server configuration."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - configuration_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - configuration_name: configuration_name.into(), - parameters: parameters.into(), - } - } - } - pub mod list_by_server { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ConfigurationListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) server_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.server_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1741,9 +1849,9 @@ pub mod configurations { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Configuration = serde_json::from_slice(&bytes)?; + let body: models::RedisFirewallRule = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1780,10 +1888,10 @@ pub mod configurations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) configuration_name: String, + pub(crate) cache_name: String, + pub(crate) rule_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1794,7 +1902,14 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . configuration_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.rule_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1804,7 +1919,7 @@ pub mod configurations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1813,8 +1928,8 @@ pub mod configurations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1825,13 +1940,13 @@ pub mod configurations { } } } - pub mod put { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Configuration = serde_json::from_slice(&bytes)?; + let body: models::RedisFirewallRule = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1868,14 +1983,13 @@ pub mod configurations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) configuration_name: String, - pub(crate) parameters: models::Configuration, + pub(crate) cache_name: String, + pub(crate) rule_name: String, + pub(crate) parameters: models::RedisFirewallRule, + pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1884,7 +1998,14 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . configuration_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.rule_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1894,7 +2015,7 @@ pub mod configurations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -1904,8 +2025,8 @@ pub mod configurations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1916,32 +2037,9 @@ pub mod configurations { } } } - pub mod update { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Configuration = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -1959,14 +2057,12 @@ pub mod configurations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) configuration_name: String, - pub(crate) parameters: models::Configuration, + pub(crate) cache_name: String, + pub(crate) rule_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1975,8 +2071,15 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/configurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . configuration_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/firewallRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1985,166 +2088,116 @@ pub mod configurations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod check_name_availability { +pub mod patch_schedules { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Check the availability of name for resource"] + #[doc = "Gets all patch schedules in the specified redis cache (there is only one)."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `name_availability_request`: The required parameters for checking if resource name is available."] - pub fn execute( + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + pub fn list_by_redis_resource( &self, subscription_id: impl Into, - name_availability_request: impl Into, - ) -> execute::RequestBuilder { - execute::RequestBuilder { + resource_group_name: impl Into, + cache_name: impl Into, + ) -> list_by_redis_resource::RequestBuilder { + list_by_redis_resource::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - name_availability_request: name_availability_request.into(), - } - } - } - pub mod execute { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::NameAvailability = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Gets the patching schedule of a redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `name`: The name of the redis cache."] + #[doc = "* `default`: Default string modeled as parameter for auto generation to work correctly."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + name: impl Into, + default: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + name: name.into(), + default: default.into(), + subscription_id: subscription_id.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) name_availability_request: models::NameAvailabilityRequest, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability", - this.client.endpoint(), - &this.subscription_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.name_availability_request)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + #[doc = "Create or replace the patching schedule for Redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `default`: Default string modeled as parameter for auto generation to work correctly."] + #[doc = "* `parameters`: Parameters to set the patching schedule for Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_or_update( + &self, + resource_group_name: impl Into, + name: impl Into, + default: impl Into, + parameters: impl Into, + subscription_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + name: name.into(), + default: default.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), } } - } -} -pub mod location_based_capabilities { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get capabilities at specified location in a given subscription."] + #[doc = "Deletes the patching schedule of a redis cache."] #[doc = ""] #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `name`: The name of the redis cache."] + #[doc = "* `default`: Default string modeled as parameter for auto generation to work correctly."] #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `location_name`: The name of the location."] - pub fn execute(&self, subscription_id: impl Into, location_name: impl Into) -> execute::RequestBuilder { - execute::RequestBuilder { + pub fn delete( + &self, + resource_group_name: impl Into, + name: impl Into, + default: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + name: name.into(), + default: default.into(), subscription_id: subscription_id.into(), - location_name: location_name.into(), } } } - pub mod execute { + pub mod list_by_redis_resource { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::CapabilitiesListResult = serde_json::from_slice(&bytes)?; + let body: models::RedisPatchScheduleListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2182,18 +2235,20 @@ pub mod location_based_capabilities { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) location_name: String, + pub(crate) resource_group_name: String, + pub(crate) cache_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/locations/{}/capabilities", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules", this.client.endpoint(), &this.subscription_id, - &this.location_name + &this.resource_group_name, + &this.cache_name ))?; let rsp = match continuation { Some(value) => { @@ -2211,7 +2266,7 @@ pub mod location_based_capabilities { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2227,7 +2282,7 @@ pub mod location_based_capabilities { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2247,38 +2302,13 @@ pub mod location_based_capabilities { } } } -} -pub mod virtual_network_subnet_usage { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get virtual network subnet usage for a given vNet resource id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `location_name`: The name of the location."] - #[doc = "* `parameters`: The required parameters for creating or updating a server."] - pub fn execute( - &self, - subscription_id: impl Into, - location_name: impl Into, - parameters: impl Into, - ) -> execute::RequestBuilder { - execute::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - location_name: location_name.into(), - parameters: parameters.into(), - } - } - } - pub mod execute { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::VirtualNetworkSubnetUsageResult = serde_json::from_slice(&bytes)?; + let body: models::RedisPatchSchedule = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2315,9 +2345,10 @@ pub mod virtual_network_subnet_usage { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) name: String, + pub(crate) default: String, pub(crate) subscription_id: String, - pub(crate) location_name: String, - pub(crate) parameters: models::VirtualNetworkSubnetUsageParameter, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2329,12 +2360,14 @@ pub mod virtual_network_subnet_usage { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.DBforPostgreSQL/locations/{}/checkVirtualNetworkSubnetUsage", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules/{}", this.client.endpoint(), &this.subscription_id, - &this.location_name + &this.resource_group_name, + &this.name, + &this.default ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2343,9 +2376,8 @@ pub mod virtual_network_subnet_usage { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2353,8 +2385,8 @@ pub mod virtual_network_subnet_usage { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2365,23 +2397,13 @@ pub mod virtual_network_subnet_usage { } } } -} -pub mod operations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all of the available REST API operations."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } - } - pub mod list { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OperationListResult = serde_json::from_slice(&bytes)?; + let body: models::RedisPatchSchedule = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2418,6 +2440,11 @@ pub mod operations { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) name: String, + pub(crate) default: String, + pub(crate) parameters: models::RedisPatchSchedule, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2429,10 +2456,14 @@ pub mod operations { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/providers/Microsoft.DBforPostgreSQL/operations", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules/{}", this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.name, + &this.default ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2441,8 +2472,9 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2450,8 +2482,8 @@ pub mod operations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2462,97 +2494,157 @@ pub mod operations { } } } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) name: String, + pub(crate) default: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/patchSchedules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.name, + &this.default + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } -pub mod databases { +pub mod linked_server { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets information about a database."] + #[doc = "Gets the detailed information about a linked server of a redis cache (requires Premium SKU)."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `database_name`: The name of the database."] + #[doc = "* `name`: The name of the redis cache."] + #[doc = "* `linked_server_name`: The name of the linked server."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - database_name: impl Into, + name: impl Into, + linked_server_name: impl Into, + subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - database_name: database_name.into(), + name: name.into(), + linked_server_name: linked_server_name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Creates a new database or updates an existing database."] + #[doc = "Adds a linked server to the Redis cache (requires Premium SKU)."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `database_name`: The name of the database."] - #[doc = "* `parameters`: The required parameters for creating or updating a database."] + #[doc = "* `name`: The name of the Redis cache."] + #[doc = "* `linked_server_name`: The name of the linked server that is being added to the Redis cache."] + #[doc = "* `parameters`: Parameters supplied to the Create Linked server operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn create( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - database_name: impl Into, - parameters: impl Into, + name: impl Into, + linked_server_name: impl Into, + parameters: impl Into, + subscription_id: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - database_name: database_name.into(), + name: name.into(), + linked_server_name: linked_server_name.into(), parameters: parameters.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Deletes a database."] + #[doc = "Deletes the linked server from a redis cache (requires Premium SKU)."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `database_name`: The name of the database."] + #[doc = "* `name`: The name of the redis cache."] + #[doc = "* `linked_server_name`: The name of the linked server that is being added to the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn delete( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - database_name: impl Into, + name: impl Into, + linked_server_name: impl Into, + subscription_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - database_name: database_name.into(), + name: name.into(), + linked_server_name: linked_server_name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "List all the databases in a given server."] + #[doc = "Gets the list of linked servers associated with this redis cache (requires Premium SKU)."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn list_by_server( + #[doc = "* `name`: The name of the redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { + name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + name: name.into(), + subscription_id: subscription_id.into(), } } } @@ -2560,9 +2652,9 @@ pub mod databases { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Database = serde_json::from_slice(&bytes)?; + let body: models::RedisLinkedServerWithProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2599,10 +2691,10 @@ pub mod databases { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) database_name: String, + pub(crate) name: String, + pub(crate) linked_server_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2614,12 +2706,12 @@ pub mod databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.database_name + &this.name, + &this.linked_server_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -2630,7 +2722,7 @@ pub mod databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2639,8 +2731,8 @@ pub mod databases { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2655,9 +2747,9 @@ pub mod databases { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Database = serde_json::from_slice(&bytes)?; + let body: models::RedisLinkedServerWithProperties = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2694,11 +2786,11 @@ pub mod databases { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) database_name: String, - pub(crate) parameters: models::Database, + pub(crate) name: String, + pub(crate) linked_server_name: String, + pub(crate) parameters: models::RedisLinkedServerCreateParameters, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -2711,12 +2803,12 @@ pub mod databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.database_name + &this.name, + &this.linked_server_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -2727,7 +2819,7 @@ pub mod databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); @@ -2737,8 +2829,8 @@ pub mod databases { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2769,10 +2861,10 @@ pub mod databases { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) database_name: String, + pub(crate) name: String, + pub(crate) linked_server_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -2785,12 +2877,12 @@ pub mod databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.database_name + &this.name, + &this.linked_server_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -2801,7 +2893,7 @@ pub mod databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2810,13 +2902,13 @@ pub mod databases { } } } - pub mod list_by_server { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DatabaseListResult = serde_json::from_slice(&bytes)?; + let body: models::RedisLinkedServerWithPropertiesList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2853,21 +2945,21 @@ pub mod databases { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/databases", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/linkedServers", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.name ))?; let rsp = match continuation { Some(value) => { @@ -2885,7 +2977,7 @@ pub mod databases { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2901,7 +2993,7 @@ pub mod databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2922,42 +3014,118 @@ pub mod databases { } } } -pub mod get_private_dns_zone_suffix { +pub mod private_endpoint_connections { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get private DNS zone suffix in the cloud"] + #[doc = "List all the private endpoint connections associated with the redis cache."] #[doc = ""] #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `body`: The required parameters for getting private DNS zone suffix based on server type."] - pub fn execute(&self, subscription_id: impl Into, body: impl Into) -> execute::RequestBuilder { - execute::RequestBuilder { + pub fn list( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), subscription_id: subscription_id.into(), - body: body.into(), } } - } - pub mod execute { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PrivateDnsZoneSuffix = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + #[doc = "Gets the specified private endpoint connection associated with the redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the Azure resource"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + private_endpoint_connection_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + subscription_id: subscription_id.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Update the state of specified private endpoint connection associated with the redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the Azure resource"] + #[doc = "* `properties`: The private endpoint connection properties."] + pub fn put( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + subscription_id: impl Into, + private_endpoint_connection_name: impl Into, + properties: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + subscription_id: subscription_id.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + properties: properties.into(), + } + } + #[doc = "Deletes the specified private endpoint connection associated with the redis cache."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection associated with the Azure resource"] + pub fn delete( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + subscription_id: impl Into, + private_endpoint_connection_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + subscription_id: subscription_id.into(), + private_endpoint_connection_name: private_endpoint_connection_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } impl AsRef for Response { @@ -2982,10 +3150,12 @@ pub mod get_private_dns_zone_suffix { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) cache_name: String, pub(crate) subscription_id: String, - pub(crate) body: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2995,11 +3165,13 @@ pub mod get_private_dns_zone_suffix { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.cache_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3008,82 +3180,22 @@ pub mod get_private_dns_zone_suffix { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-03-31-privatepreview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.body)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod advisors { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a recommendation action advisor."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `advisor_name`: The advisor name for recommendation action."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - advisor_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - advisor_name: advisor_name.into(), - } - } - #[doc = "List recommendation action advisors."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn list_by_server( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - } - } } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Advisor = serde_json::from_slice(&bytes)?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3120,10 +3232,10 @@ pub mod advisors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) advisor_name: String, + pub(crate) cache_name: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3135,12 +3247,12 @@ pub mod advisors { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/advisors/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.advisor_name + &this.cache_name, + &this.private_endpoint_connection_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -3151,7 +3263,7 @@ pub mod advisors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3160,8 +3272,8 @@ pub mod advisors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3172,13 +3284,13 @@ pub mod advisors { } } } - pub mod list_by_server { + pub mod put { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::AdvisorsResultList = serde_json::from_slice(&bytes)?; + let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3215,110 +3327,153 @@ pub mod advisors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) cache_name: String, pub(crate) subscription_id: String, + pub(crate) private_endpoint_connection_name: String, + pub(crate) properties: models::PrivateEndpointConnection, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.private_endpoint_connection_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) cache_name: String, + pub(crate) subscription_id: String, + pub(crate) private_endpoint_connection_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/advisors", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateEndpointConnections/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.cache_name, + &this.private_endpoint_connection_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } } -pub mod recommended_actions { +pub mod private_link_resources { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Retrieve recommended actions from the advisor."] + #[doc = "Gets the private link resources that need to be created for a redis cache."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `advisor_name`: The advisor name for recommendation action."] - pub fn list_by_server( + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list_by_redis_cache( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - advisor_name: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { + cache_name: impl Into, + subscription_id: impl Into, + ) -> list_by_redis_cache::RequestBuilder { + list_by_redis_cache::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - advisor_name: advisor_name.into(), - session_id: None, + cache_name: cache_name.into(), + subscription_id: subscription_id.into(), } } } - pub mod list_by_server { + pub mod list_by_redis_cache { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecommendationActionsResultList = serde_json::from_slice(&bytes)?; + let body: models::PrivateLinkResourceListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3355,110 +3510,264 @@ pub mod recommended_actions { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) advisor_name: String, - pub(crate) session_id: Option, + pub(crate) cache_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - #[doc = "The recommendation action session identifier."] - pub fn session_id(mut self, session_id: impl Into) -> Self { - self.session_id = Some(session_id.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "only the first response will be fetched as the continuation token is not part of the response schema"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/advisors/{}/recommendedActions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name , & this . advisor_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - if let Some(session_id) = &this.session_id { - req.url_mut().query_pairs_mut().append_pair("sessionId", session_id); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/privateLinkResources", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + } +} +pub mod async_operation_status { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "For checking the ongoing status of an operation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `location`: The location at which operation was triggered"] + #[doc = "* `operation_id`: The ID of asynchronous operation"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + location: impl Into, + operation_id: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + location: location.into(), + operation_id: operation_id.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) location: String, + pub(crate) operation_id: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Cache/locations/{}/asyncOperations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.location, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } } -pub mod query_performance_insight_data { +pub mod access_policy { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Reset data for Query Performance Insight."] + #[doc = "Gets the detailed information about an access policy of a redis cache"] #[doc = ""] #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `access_policy_name`: The name of the access policy that is being added to the Redis cache."] #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn get( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + access_policy_name: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + access_policy_name: access_policy_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Adds an access policy to the redis cache"] + #[doc = ""] + #[doc = "Arguments:"] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn reset( + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `access_policy_name`: The name of the access policy that is being added to the Redis cache."] + #[doc = "* `parameters`: Parameters supplied to the Create Update Access Policy operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_update( &self, + resource_group_name: impl Into, + cache_name: impl Into, + access_policy_name: impl Into, + parameters: impl Into, subscription_id: impl Into, + ) -> create_update::RequestBuilder { + create_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + access_policy_name: access_policy_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the access policy from a redis cache"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `access_policy_name`: The name of the access policy that is being added to the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, resource_group_name: impl Into, - server_name: impl Into, - ) -> reset::RequestBuilder { - reset::RequestBuilder { + cache_name: impl Into, + access_policy_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + access_policy_name: access_policy_name.into(), subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the list of access policies associated with this redis cache"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + cache_name: cache_name.into(), + subscription_id: subscription_id.into(), } } } - pub mod reset { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QueryPerformanceInsightResetDataResult = serde_json::from_slice(&bytes)?; + let body: models::RedisCacheAccessPolicy = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3495,9 +3804,10 @@ pub mod query_performance_insight_data { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) cache_name: String, + pub(crate) access_policy_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3508,8 +3818,15 @@ pub mod query_performance_insight_data { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/resetQueryPerformanceInsightData" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3518,9 +3835,8 @@ pub mod query_performance_insight_data { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3528,8 +3844,8 @@ pub mod query_performance_insight_data { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3540,53 +3856,367 @@ pub mod query_performance_insight_data { } } } + pub mod create_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RedisCacheAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) cache_name: String, + pub(crate) access_policy_name: String, + pub(crate) parameters: models::RedisCacheAccessPolicy, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) cache_name: String, + pub(crate) access_policy_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RedisCacheAccessPolicyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) cache_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } } -pub mod query_texts { +pub mod access_policy_assignment { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Retrieve the Query-Store query texts for the queryId."] + #[doc = "Gets the list of assignments for an access policy of a redis cache"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `query_id`: The Query-Store query identifier."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `access_policy_assignment_name`: The name of the access policy assignment."] + #[doc = "* `subscription_id`: The ID of the target subscription."] pub fn get( &self, - subscription_id: impl Into, resource_group_name: impl Into, - server_name: impl Into, - query_id: impl Into, + cache_name: impl Into, + access_policy_assignment_name: impl Into, + subscription_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - query_id: query_id.into(), + cache_name: cache_name.into(), + access_policy_assignment_name: access_policy_assignment_name.into(), + subscription_id: subscription_id.into(), } } - #[doc = "Retrieve the Query-Store query texts for specified queryIds."] + #[doc = "Adds the access policy assignment to the specified users"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `query_ids`: The query identifiers"] - pub fn list_by_server( + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `access_policy_assignment_name`: The name of the access policy assignment."] + #[doc = "* `parameters`: Parameters supplied to the Create Update Access Policy Assignment operation."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn create_update( &self, + resource_group_name: impl Into, + cache_name: impl Into, + access_policy_assignment_name: impl Into, + parameters: impl Into, subscription_id: impl Into, + ) -> create_update::RequestBuilder { + create_update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + access_policy_assignment_name: access_policy_assignment_name.into(), + parameters: parameters.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Deletes the access policy assignment from a redis cache"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `access_policy_assignment_name`: The name of the access policy assignment."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn delete( + &self, resource_group_name: impl Into, - server_name: impl Into, - query_ids: Vec, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { + cache_name: impl Into, + access_policy_assignment_name: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), + resource_group_name: resource_group_name.into(), + cache_name: cache_name.into(), + access_policy_assignment_name: access_policy_assignment_name.into(), subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the list of access policy assignments associated with this redis cache"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `cache_name`: The name of the Redis cache."] + #[doc = "* `subscription_id`: The ID of the target subscription."] + pub fn list( + &self, + resource_group_name: impl Into, + cache_name: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - query_ids, + cache_name: cache_name.into(), + subscription_id: subscription_id.into(), } } } @@ -3594,9 +4224,9 @@ pub mod query_texts { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QueryText = serde_json::from_slice(&bytes)?; + let body: models::RedisCacheAccessPolicyAssignment = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3633,10 +4263,10 @@ pub mod query_texts { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) query_id: String, + pub(crate) cache_name: String, + pub(crate) access_policy_assignment_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3648,12 +4278,12 @@ pub mod query_texts { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/queryTexts/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicyAssignments/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name, - &this.query_id + &this.cache_name, + &this.access_policy_assignment_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -3664,7 +4294,7 @@ pub mod query_texts { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3673,8 +4303,8 @@ pub mod query_texts { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3685,13 +4315,13 @@ pub mod query_texts { } } } - pub mod list_by_server { + pub mod create_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::QueryTextsResultList = serde_json::from_slice(&bytes)?; + let body: models::RedisCacheAccessPolicyAssignment = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3728,130 +4358,64 @@ pub mod query_texts { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) query_ids: Vec, + pub(crate) cache_name: String, + pub(crate) access_policy_assignment_name: String, + pub(crate) parameters: models::RedisCacheAccessPolicyAssignment, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/queryTexts", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicyAssignments/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.cache_name, + &this.access_policy_assignment_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let query_ids = &this.query_ids; - for value in &this.query_ids { - req.url_mut().query_pairs_mut().append_pair("queryIds", &value.to_string()); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } - } -} -pub mod top_query_statistics { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve the Query-Store top queries for specified metric and aggregation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - pub fn list_by_server( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_server { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::TopQueryStatisticsResultList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3869,103 +4433,54 @@ pub mod top_query_statistics { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, + pub(crate) cache_name: String, + pub(crate) access_policy_assignment_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/topQueryStatistics" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . server_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicyAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cache_name, + &this.access_policy_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) - } - } - } -} -pub mod wait_statistics { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Retrieve wait statistics for specified aggregation window."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `server_name`: The name of the server."] - #[doc = "* `parameters`: The required parameters for retrieving wait statistics."] - pub fn list_by_server( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - server_name: impl Into, - parameters: impl Into, - ) -> list_by_server::RequestBuilder { - list_by_server::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - server_name: server_name.into(), - parameters: parameters.into(), + }) } } } - pub mod list_by_server { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::WaitStatisticsResultList = serde_json::from_slice(&bytes)?; + let body: models::RedisCacheAccessPolicyAssignmentList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4002,22 +4517,21 @@ pub mod wait_statistics { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) server_name: String, - pub(crate) parameters: models::WaitStatisticsInput, + pub(crate) cache_name: String, + pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{}/waitStatistics", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Cache/redis/{}/accessPolicyAssignments", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.server_name + &this.cache_name ))?; let rsp = match continuation { Some(value) => { @@ -4035,7 +4549,7 @@ pub mod wait_statistics { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4051,9 +4565,8 @@ pub mod wait_statistics { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2021-06-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } diff --git a/services/mgmt/redis/src/package_2020_06/models.rs b/services/mgmt/redis/src/package_preview_2023_05/models.rs similarity index 69% rename from services/mgmt/redis/src/package_2020_06/models.rs rename to services/mgmt/redis/src/package_preview_2023_05/models.rs index 81a5cfda04..ef9f17510a 100644 --- a/services/mgmt/redis/src/package_2020_06/models.rs +++ b/services/mgmt/redis/src/package_preview_2023_05/models.rs @@ -93,6 +93,12 @@ pub struct ExportRdbParameters { pub prefix: String, #[doc = "Container name to export to."] pub container: String, + #[doc = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS"] + #[serde(rename = "preferred-data-archive-auth-method", default, skip_serializing_if = "Option::is_none")] + pub preferred_data_archive_auth_method: Option, + #[doc = "Subscription id of the storage container for data to be exported using ManagedIdentity."] + #[serde(rename = "storage-subscription-id", default, skip_serializing_if = "Option::is_none")] + pub storage_subscription_id: Option, } impl ExportRdbParameters { pub fn new(prefix: String, container: String) -> Self { @@ -100,6 +106,8 @@ impl ExportRdbParameters { format: None, prefix, container, + preferred_data_archive_auth_method: None, + storage_subscription_id: None, } } } @@ -111,10 +119,91 @@ pub struct ImportRdbParameters { pub format: Option, #[doc = "files to import."] pub files: Vec, + #[doc = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS"] + #[serde(rename = "preferred-data-archive-auth-method", default, skip_serializing_if = "Option::is_none")] + pub preferred_data_archive_auth_method: Option, + #[doc = "Subscription id of the storage container containing files to import using Managed Identity."] + #[serde(rename = "storage-subscription-id", default, skip_serializing_if = "Option::is_none")] + pub storage_subscription_id: Option, } impl ImportRdbParameters { pub fn new(files: Vec) -> Self { - Self { format: None, files } + Self { + format: None, + files, + preferred_data_archive_auth_method: None, + storage_subscription_id: None, + } + } +} +#[doc = "Managed service identity (system assigned and/or user assigned identities)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ManagedServiceIdentity { + #[doc = "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] + #[serde(rename = "type")] + pub type_: ManagedServiceIdentityType, + #[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] + #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")] + pub user_assigned_identities: Option, +} +impl ManagedServiceIdentity { + pub fn new(type_: ManagedServiceIdentityType) -> Self { + Self { + principal_id: None, + tenant_id: None, + type_, + user_assigned_identities: None, + } + } +} +#[doc = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ManagedServiceIdentityType")] +pub enum ManagedServiceIdentityType { + None, + SystemAssigned, + UserAssigned, + #[serde(rename = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ManagedServiceIdentityType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ManagedServiceIdentityType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ManagedServiceIdentityType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("ManagedServiceIdentityType", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 1u32, "SystemAssigned"), + Self::UserAssigned => serializer.serialize_unit_variant("ManagedServiceIdentityType", 2u32, "UserAssigned"), + Self::SystemAssignedUserAssigned => { + serializer.serialize_unit_variant("ManagedServiceIdentityType", 3u32, "SystemAssigned, UserAssigned") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } } } #[doc = "The response of listUpgradeNotifications."] @@ -131,6 +220,12 @@ pub struct NotificationListResponse { #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option, } +impl azure_core::Continuable for NotificationListResponse { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} impl NotificationListResponse { pub fn new() -> Self { Self::default() @@ -200,6 +295,68 @@ impl OperationListResult { Self::default() } } +#[doc = "Asynchronous operation status"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationStatus { + #[serde(flatten)] + pub operation_status_result: OperationStatusResult, + #[doc = "Additional properties from RP, only when operation is successful"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl OperationStatus { + pub fn new(operation_status_result: OperationStatusResult) -> Self { + Self { + operation_status_result, + properties: None, + } + } +} +#[doc = "The current status of an async operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperationStatusResult { + #[doc = "Fully qualified ID for the async operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the async operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Operation status."] + pub status: String, + #[doc = "Percent of the operation that is complete."] + #[serde(rename = "percentComplete", default, skip_serializing_if = "Option::is_none")] + pub percent_complete: Option, + #[doc = "The start time of the operation."] + #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] + pub start_time: Option, + #[doc = "The end time of the operation."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "The operations list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub operations: Vec, + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl OperationStatusResult { + pub fn new(status: String) -> Self { + Self { + id: None, + name: None, + status, + percent_complete: None, + start_time: None, + end_time: None, + operations: Vec::new(), + error: None, + } + } +} #[doc = "The Private Endpoint resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct PrivateEndpoint { @@ -432,7 +589,7 @@ impl PrivateLinkServiceConnectionState { Self::default() } } -#[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags"] +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ProxyResource { #[serde(flatten)] @@ -458,18 +615,282 @@ impl RedisAccessKeys { Self::default() } } +#[doc = "Response to get/put access policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RedisCacheAccessPolicy { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "All properties of an access policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RedisCacheAccessPolicy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Response to an operation on access policy assignment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RedisCacheAccessPolicyAssignment { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Properties for an access policy assignment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RedisCacheAccessPolicyAssignment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of access policies assignments (with properties) of a Redis cache."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RedisCacheAccessPolicyAssignmentList { + #[doc = "List of access policies assignments (with properties) of a Redis cache."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link for next set."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RedisCacheAccessPolicyAssignmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RedisCacheAccessPolicyAssignmentList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties for an access policy assignment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedisCacheAccessPolicyAssignmentProperties { + #[doc = "Provisioning state of an access policy assignment set"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Object Id to assign access policy to"] + #[serde(rename = "objectId")] + pub object_id: String, + #[doc = "User friendly name for object id. Also represents username for token based authentication"] + #[serde(rename = "objectIdAlias")] + pub object_id_alias: String, + #[doc = "The name of the access policy that is being assigned"] + #[serde(rename = "accessPolicyName")] + pub access_policy_name: String, +} +impl RedisCacheAccessPolicyAssignmentProperties { + pub fn new(object_id: String, object_id_alias: String, access_policy_name: String) -> Self { + Self { + provisioning_state: None, + object_id, + object_id_alias, + access_policy_name, + } + } +} +pub mod redis_cache_access_policy_assignment_properties { + use super::*; + #[doc = "Provisioning state of an access policy assignment set"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Updating, + Succeeded, + Deleting, + Deleted, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Updating"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Succeeded"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleted"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of access policies (with properties) of a Redis cache."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RedisCacheAccessPolicyList { + #[doc = "List of access policies (with properties) of a Redis cache."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Link for next set."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RedisCacheAccessPolicyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RedisCacheAccessPolicyList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "All properties of an access policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedisCacheAccessPolicyProperties { + #[doc = "Provisioning state of access policy"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "Built-In or Custom access policy"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites"] + pub permissions: String, +} +impl RedisCacheAccessPolicyProperties { + pub fn new(permissions: String) -> Self { + Self { + provisioning_state: None, + type_: None, + permissions, + } + } +} +pub mod redis_cache_access_policy_properties { + use super::*; + #[doc = "Provisioning state of access policy"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Updating, + Succeeded, + Deleting, + Deleted, + Canceled, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Updating"), + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Succeeded"), + Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Deleting"), + Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Deleted"), + Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Canceled"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Built-In or Custom access policy"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Custom, + BuiltIn, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Custom => serializer.serialize_unit_variant("Type", 0u32, "Custom"), + Self::BuiltIn => serializer.serialize_unit_variant("Type", 1u32, "BuiltIn"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} #[doc = "Create/Update/Get common properties of the redis cache."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct RedisCommonProperties { #[doc = "All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc."] #[serde(rename = "redisConfiguration", default, skip_serializing_if = "Option::is_none")] pub redis_configuration: Option, + #[doc = "Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'."] + #[serde(rename = "redisVersion", default, skip_serializing_if = "Option::is_none")] + pub redis_version: Option, #[doc = "Specifies whether the non-ssl Redis server port (6379) is enabled."] #[serde(rename = "enableNonSslPort", default, skip_serializing_if = "Option::is_none")] pub enable_non_ssl_port: Option, - #[doc = "The number of replicas to be created per master."] + #[doc = "The number of replicas to be created per primary."] #[serde(rename = "replicasPerMaster", default, skip_serializing_if = "Option::is_none")] pub replicas_per_master: Option, + #[doc = "The number of replicas to be created per primary."] + #[serde(rename = "replicasPerPrimary", default, skip_serializing_if = "Option::is_none")] + pub replicas_per_primary: Option, #[doc = "A dictionary of tenant settings"] #[serde(rename = "tenantSettings", default, skip_serializing_if = "Option::is_none")] pub tenant_settings: Option, @@ -496,7 +917,7 @@ pub mod redis_common_properties { #[doc = "Specifies whether the rdb backup is enabled"] #[serde(rename = "rdb-backup-enabled", default, skip_serializing_if = "Option::is_none")] pub rdb_backup_enabled: Option, - #[doc = "Specifies the frequency for creating rdb backup"] + #[doc = "Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440)"] #[serde(rename = "rdb-backup-frequency", default, skip_serializing_if = "Option::is_none")] pub rdb_backup_frequency: Option, #[doc = "Specifies the maximum number of snapshots for rdb backup"] @@ -505,6 +926,9 @@ pub mod redis_common_properties { #[doc = "The storage account connection string for storing rdb file"] #[serde(rename = "rdb-storage-connection-string", default, skip_serializing_if = "Option::is_none")] pub rdb_storage_connection_string: Option, + #[doc = "Specifies whether the aof backup is enabled"] + #[serde(rename = "aof-backup-enabled", default, skip_serializing_if = "Option::is_none")] + pub aof_backup_enabled: Option, #[doc = "First storage account connection string"] #[serde(rename = "aof-storage-connection-string-0", default, skip_serializing_if = "Option::is_none")] pub aof_storage_connection_string_0: Option, @@ -526,6 +950,28 @@ pub mod redis_common_properties { #[doc = "The max clients config"] #[serde(default, skip_serializing_if = "Option::is_none")] pub maxclients: Option, + #[doc = "Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS"] + #[serde(rename = "preferred-data-archive-auth-method", default, skip_serializing_if = "Option::is_none")] + pub preferred_data_archive_auth_method: Option, + #[doc = "Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS"] + #[serde( + rename = "preferred-data-persistence-auth-method", + default, + skip_serializing_if = "Option::is_none" + )] + pub preferred_data_persistence_auth_method: Option, + #[doc = "Zonal Configuration"] + #[serde(rename = "zonal-configuration", default, skip_serializing_if = "Option::is_none")] + pub zonal_configuration: Option, + #[doc = "Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authnotrequired: Option, + #[doc = "SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity."] + #[serde(rename = "storage-subscription-id", default, skip_serializing_if = "Option::is_none")] + pub storage_subscription_id: Option, + #[doc = "Specifies whether AAD based authentication has been enabled or disabled for the cache"] + #[serde(rename = "aad-enabled", default, skip_serializing_if = "Option::is_none")] + pub aad_enabled: Option, } impl RedisConfiguration { pub fn new() -> Self { @@ -634,6 +1080,9 @@ pub struct RedisCreateParameters { #[doc = "Resource tags."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, } impl RedisCreateParameters { pub fn new(properties: RedisCreateProperties, location: String) -> Self { @@ -642,6 +1091,7 @@ impl RedisCreateParameters { zones: Vec::new(), location, tags: None, + identity: None, } } } @@ -685,15 +1135,15 @@ impl RedisFirewallRule { } } } -#[doc = "Parameters required for creating a firewall rule on redis cache."] +#[doc = "Parameters required for creating a firewall rule on redis cache. (Note, you can just use the FirewallRule type instead now.)"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RedisFirewallRuleCreateParameters { - #[doc = "Specifies a range of IP addresses permitted to connect to the cache"] - pub properties: RedisFirewallRuleProperties, + #[serde(flatten)] + pub redis_firewall_rule: RedisFirewallRule, } impl RedisFirewallRuleCreateParameters { - pub fn new(properties: RedisFirewallRuleProperties) -> Self { - Self { properties } + pub fn new(redis_firewall_rule: RedisFirewallRule) -> Self { + Self { redis_firewall_rule } } } #[doc = "The response of list firewall rules Redis operation."] @@ -763,9 +1213,12 @@ pub struct RedisInstanceDetails { #[doc = "If clustering is enabled, the Shard ID of Redis Instance"] #[serde(rename = "shardId", default, skip_serializing_if = "Option::is_none")] pub shard_id: Option, - #[doc = "Specifies whether the instance is a master node."] + #[doc = "Specifies whether the instance is a primary node."] #[serde(rename = "isMaster", default, skip_serializing_if = "Option::is_none")] pub is_master: Option, + #[doc = "Specifies whether the instance is a primary node."] + #[serde(rename = "isPrimary", default, skip_serializing_if = "Option::is_none")] + pub is_primary: Option, } impl RedisInstanceDetails { pub fn new() -> Self { @@ -807,6 +1260,12 @@ pub struct RedisLinkedServerCreateProperties { #[doc = "Role of the linked server."] #[serde(rename = "serverRole")] pub server_role: redis_linked_server_create_properties::ServerRole, + #[doc = "The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience."] + #[serde(rename = "geoReplicatedPrimaryHostName", default, skip_serializing_if = "Option::is_none")] + pub geo_replicated_primary_host_name: Option, + #[doc = "The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover."] + #[serde(rename = "primaryHostName", default, skip_serializing_if = "Option::is_none")] + pub primary_host_name: Option, } impl RedisLinkedServerCreateProperties { pub fn new( @@ -818,6 +1277,8 @@ impl RedisLinkedServerCreateProperties { linked_redis_cache_id, linked_redis_cache_location, server_role, + geo_replicated_primary_host_name: None, + primary_host_name: None, } } } @@ -918,12 +1379,16 @@ pub struct RedisPatchSchedule { pub proxy_resource: ProxyResource, #[doc = "List of patch schedules for a Redis cache."] pub properties: ScheduleEntries, + #[doc = "The geo-location where the resource lives"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, } impl RedisPatchSchedule { pub fn new(properties: ScheduleEntries) -> Self { Self { proxy_resource: ProxyResource::default(), properties, + location: None, } } } @@ -957,9 +1422,6 @@ impl RedisPatchScheduleListResult { pub struct RedisProperties { #[serde(flatten)] pub redis_create_properties: RedisCreateProperties, - #[doc = "Redis version."] - #[serde(rename = "redisVersion", default, skip_serializing_if = "Option::is_none")] - pub redis_version: Option, #[doc = "Redis instance provisioning status."] #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] pub provisioning_state: Option, @@ -1003,7 +1465,6 @@ impl RedisProperties { pub fn new(redis_create_properties: RedisCreateProperties) -> Self { Self { redis_create_properties, - redis_version: None, provisioning_state: None, host_name: None, port: None, @@ -1174,6 +1635,9 @@ pub struct RedisResource { skip_serializing_if = "Vec::is_empty" )] pub zones: Vec, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, } impl RedisResource { pub fn new(tracked_resource: TrackedResource, properties: RedisProperties) -> Self { @@ -1181,6 +1645,7 @@ impl RedisResource { tracked_resource, properties, zones: Vec::new(), + identity: None, } } } @@ -1193,6 +1658,9 @@ pub struct RedisUpdateParameters { #[doc = "Resource tags."] #[serde(default, skip_serializing_if = "Option::is_none")] pub tags: Option, + #[doc = "Managed service identity (system assigned and/or user assigned identities)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, } impl RedisUpdateParameters { pub fn new() -> Self { @@ -1213,16 +1681,16 @@ impl RedisUpdateProperties { Self::default() } } -#[doc = "The Resource definition."] +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Resource { - #[doc = "Resource ID."] + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, - #[doc = "Resource name."] + #[doc = "The name of the resource"] #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - #[doc = "Resource type."] + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] pub type_: Option, } @@ -1375,7 +1843,7 @@ pub mod sku { } } } -#[doc = "The resource model definition for a ARM tracked top level resource"] +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TrackedResource { #[serde(flatten)] @@ -1413,3 +1881,26 @@ impl UpgradeNotification { Self::default() } } +#[doc = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentities {} +impl UserAssignedIdentities { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "User assigned identity properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserAssignedIdentity { + #[doc = "The principal ID of the assigned identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The client ID of the assigned identity."] + #[serde(rename = "clientId", default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, +} +impl UserAssignedIdentity { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/riskiq/src/package_preview_2022_04_01/models.rs b/services/mgmt/riskiq/src/package_preview_2022_04_01/models.rs index 561cfa28f3..09df787ad9 100644 --- a/services/mgmt/riskiq/src/package_preview_2022_04_01/models.rs +++ b/services/mgmt/riskiq/src/package_preview_2022_04_01/models.rs @@ -429,9 +429,9 @@ impl WorkspacePatchResource { pub struct WorkspaceResource { #[serde(flatten)] pub tracked_resource: TrackedResource, - #[doc = "Resource base properties."] + #[doc = "Workspace properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkspaceResource { pub fn new(tracked_resource: TrackedResource) -> Self { @@ -466,6 +466,20 @@ impl WorkspaceResourceList { Self::default() } } +#[doc = "Workspace properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceResourceProperties { + #[serde(flatten)] + pub resource_base_properties: ResourceBaseProperties, + #[doc = "Data plane endpoint."] + #[serde(rename = "dataPlaneEndpoint", default, skip_serializing_if = "Option::is_none")] + pub data_plane_endpoint: Option, +} +impl WorkspaceResourceProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Metadata pertaining to creation and last modification of the resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SystemData { diff --git a/services/mgmt/riskiq/src/package_preview_2023_04/models.rs b/services/mgmt/riskiq/src/package_preview_2023_04/models.rs index 60098991ae..3d3f9988e5 100644 --- a/services/mgmt/riskiq/src/package_preview_2023_04/models.rs +++ b/services/mgmt/riskiq/src/package_preview_2023_04/models.rs @@ -475,9 +475,9 @@ impl WorkspacePatchResource { pub struct WorkspaceResource { #[serde(flatten)] pub tracked_resource: TrackedResource, - #[doc = "Resource base properties."] + #[doc = "Workspace properties."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, + pub properties: Option, } impl WorkspaceResource { pub fn new(tracked_resource: TrackedResource) -> Self { @@ -512,6 +512,20 @@ impl WorkspaceResourceList { Self::default() } } +#[doc = "Workspace properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceResourceProperties { + #[serde(flatten)] + pub resource_base_properties: ResourceBaseProperties, + #[doc = "Data plane endpoint."] + #[serde(rename = "dataPlaneEndpoint", default, skip_serializing_if = "Option::is_none")] + pub data_plane_endpoint: Option, +} +impl WorkspaceResourceProperties { + pub fn new() -> Self { + Self::default() + } +} #[doc = "Metadata pertaining to creation and last modification of the resource."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct SystemData { diff --git a/services/mgmt/scvmm/Cargo.toml b/services/mgmt/scvmm/Cargo.toml index 7a5b6cf0f4..45785f750e 100644 --- a/services/mgmt/scvmm/Cargo.toml +++ b/services/mgmt/scvmm/Cargo.toml @@ -32,8 +32,9 @@ env_logger = "0.10" all-features = true [features] -default = ["package-2020-06-05-preview", "enable_reqwest"] +default = ["package-2022-05-21-preview", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-2022-05-21-preview" = [] "package-2020-06-05-preview" = [] \ No newline at end of file diff --git a/services/mgmt/scvmm/README.md b/services/mgmt/scvmm/README.md index 0ca5ccd881..ea6020efc5 100644 --- a/services/mgmt/scvmm/README.md +++ b/services/mgmt/scvmm/README.md @@ -6,8 +6,9 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/scvmm/reso To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-2020-06-05-preview`. +The default tag is `package-2022-05-21-preview`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-2022-05-21-preview` has 60 operations from 1 API versions: `2022-05-21-preview`. Use crate feature `package-2022-05-21-preview` to enable. The operations will be in the `package_2022_05_21_preview` module. - `package-2020-06-05-preview` has 47 operations from 1 API versions: `2020-06-05-preview`. Use crate feature `package-2020-06-05-preview` to enable. The operations will be in the `package_2020_06_05_preview` module. \ No newline at end of file diff --git a/services/mgmt/scvmm/src/lib.rs b/services/mgmt/scvmm/src/lib.rs index 2bd2d2b806..df0d0b9ad9 100644 --- a/services/mgmt/scvmm/src/lib.rs +++ b/services/mgmt/scvmm/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-2022-05-21-preview")] +pub mod package_2022_05_21_preview; +#[cfg(all(feature = "package-2022-05-21-preview", not(feature = "no-default-tag")))] +pub use package_2022_05_21_preview::*; #[cfg(feature = "package-2020-06-05-preview")] pub mod package_2020_06_05_preview; #[cfg(all(feature = "package-2020-06-05-preview", not(feature = "no-default-tag")))] diff --git a/services/mgmt/arcdata/src/package_preview_2023_03/mod.rs b/services/mgmt/scvmm/src/package_2022_05_21_preview/mod.rs similarity index 78% rename from services/mgmt/arcdata/src/package_preview_2023_03/mod.rs rename to services/mgmt/scvmm/src/package_2022_05_21_preview/mod.rs index 3a49a82817..f5b929a02c 100644 --- a/services/mgmt/arcdata/src/package_preview_2023_03/mod.rs +++ b/services/mgmt/scvmm/src/package_2022_05_21_preview/mod.rs @@ -103,277 +103,167 @@ impl Client { pipeline, } } - pub fn active_directory_connectors_client(&self) -> active_directory_connectors::Client { - active_directory_connectors::Client(self.clone()) + pub fn availability_sets_client(&self) -> availability_sets::Client { + availability_sets::Client(self.clone()) } - pub fn data_controllers_client(&self) -> data_controllers::Client { - data_controllers::Client(self.clone()) + pub fn clouds_client(&self) -> clouds::Client { + clouds::Client(self.clone()) } - pub fn failover_groups_client(&self) -> failover_groups::Client { - failover_groups::Client(self.clone()) + pub fn guest_agents_client(&self) -> guest_agents::Client { + guest_agents::Client(self.clone()) } - pub fn operations_client(&self) -> operations::Client { - operations::Client(self.clone()) - } - pub fn postgres_instances_client(&self) -> postgres_instances::Client { - postgres_instances::Client(self.clone()) - } - pub fn sql_availability_group_databases_client(&self) -> sql_availability_group_databases::Client { - sql_availability_group_databases::Client(self.clone()) + pub fn hybrid_identity_metadatas_client(&self) -> hybrid_identity_metadatas::Client { + hybrid_identity_metadatas::Client(self.clone()) } - pub fn sql_availability_group_replicas_client(&self) -> sql_availability_group_replicas::Client { - sql_availability_group_replicas::Client(self.clone()) + pub fn inventory_items_client(&self) -> inventory_items::Client { + inventory_items::Client(self.clone()) } - pub fn sql_availability_groups_client(&self) -> sql_availability_groups::Client { - sql_availability_groups::Client(self.clone()) + pub fn machine_extensions_client(&self) -> machine_extensions::Client { + machine_extensions::Client(self.clone()) } - pub fn sql_managed_instances_client(&self) -> sql_managed_instances::Client { - sql_managed_instances::Client(self.clone()) - } - pub fn sql_server_availability_groups_client(&self) -> sql_server_availability_groups::Client { - sql_server_availability_groups::Client(self.clone()) + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) } - pub fn sql_server_databases_client(&self) -> sql_server_databases::Client { - sql_server_databases::Client(self.clone()) + pub fn virtual_machine_templates_client(&self) -> virtual_machine_templates::Client { + virtual_machine_templates::Client(self.clone()) } - pub fn sql_server_instances_client(&self) -> sql_server_instances::Client { - sql_server_instances::Client(self.clone()) + pub fn virtual_machines_client(&self) -> virtual_machines::Client { + virtual_machines::Client(self.clone()) } -} -pub mod operations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Lists all of the available Azure Data Services on Azure Arc API operations."] - pub fn list(&self) -> list::RequestBuilder { - list::RequestBuilder { client: self.0.clone() } - } + pub fn virtual_networks_client(&self) -> virtual_networks::Client { + virtual_networks::Client(self.clone()) } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::OperationListResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = - azure_core::Url::parse(&format!("{}/providers/Microsoft.AzureArcData/operations", this.client.endpoint(),))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } + pub fn vmm_servers_client(&self) -> vmm_servers::Client { + vmm_servers::Client(self.clone()) } } -pub mod sql_managed_instances { +pub mod vmm_servers { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List sqlManagedInstance resources in the subscription"] + #[doc = "Gets a VMMServer."] + #[doc = "Implements VMMServer GET method."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + vmm_server_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + vmm_server_name: vmm_server_name.into(), } } - #[doc = "List sqlManagedInstance resources in the resource group"] - #[doc = "Gets all sqlManagedInstances in a resource group."] + #[doc = "Implements VmmServers PUT method."] + #[doc = "Onboards the SCVMM fabric as an Azure VmmServer resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - pub fn list_by_resource_group( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + #[doc = "* `body`: Request payload."] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { + vmm_server_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), + vmm_server_name: vmm_server_name.into(), + body: body.into(), } } - #[doc = "Retrieves a SQL Managed Instance resource"] + #[doc = "Implements VmmServers PATCH method."] + #[doc = "Updates the VmmServers resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - pub fn get( + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + #[doc = "* `body`: VmmServers patch payload."] + pub fn update( &self, - subscription_id: impl Into, resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + subscription_id: impl Into, + vmm_server_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), + subscription_id: subscription_id.into(), + vmm_server_name: vmm_server_name.into(), + body: body.into(), } } - #[doc = "Creates or replaces a SQL Managed Instance resource"] + #[doc = "Implements VmmServers DELETE method."] + #[doc = "Deboards the SCVMM fabric from Azure."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - #[doc = "* `sql_managed_instance`: The SQL Managed Instance to be created or updated."] - pub fn create( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - sql_managed_instance: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + vmm_server_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), - sql_managed_instance: sql_managed_instance.into(), + vmm_server_name: vmm_server_name.into(), + force: None, } } - #[doc = "Updates a SQL Managed Instance resource"] + #[doc = "Implements GET VmmServers in a resource group."] + #[doc = "List of VmmServers in a resource group."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - #[doc = "* `parameters`: The SQL Managed Instance."] - pub fn update( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), - parameters: parameters.into(), } } - #[doc = "Deletes a SQL Managed Instance resource"] + #[doc = "Implements GET VmmServers in a subscription."] + #[doc = "List of VmmServers in a subscription."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlManagedInstanceListResult = serde_json::from_slice(&bytes)?; + let body: models::VmmServer = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -411,76 +301,62 @@ pub mod sql_managed_instances { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) vmm_server_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.AzureArcData/sqlManagedInstances", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.vmm_server_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list_by_resource_group { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlManagedInstanceListResult = serde_json::from_slice(&bytes)?; + let body: models::VmmServer = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -519,77 +395,64 @@ pub mod sql_managed_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, + pub(crate) vmm_server_name: String, + pub(crate) body: models::VmmServer, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name + &this.resource_group_name, + &this.vmm_server_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlManagedInstance = serde_json::from_slice(&bytes)?; + let body: models::VmmServer = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -626,11 +489,13 @@ pub mod sql_managed_instances { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, + pub(crate) subscription_id: String, + pub(crate) vmm_server_name: String, + pub(crate) body: models::ResourcePatch, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -640,13 +505,13 @@ pub mod sql_managed_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_managed_instance_name + &this.vmm_server_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -655,8 +520,9 @@ pub mod sql_managed_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -664,8 +530,8 @@ pub mod sql_managed_instances { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -676,32 +542,9 @@ pub mod sql_managed_instances { } } } - pub mod create { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SqlManagedInstance = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -721,10 +564,15 @@ pub mod sql_managed_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, - pub(crate) sql_managed_instance: models::SqlManagedInstance, + pub(crate) vmm_server_name: String, + pub(crate) force: Option, } impl RequestBuilder { + #[doc = "Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -735,13 +583,13 @@ pub mod sql_managed_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_managed_instance_name + &this.vmm_server_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -750,35 +598,25 @@ pub mod sql_managed_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_managed_instance)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod update { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlManagedInstance = serde_json::from_slice(&bytes)?; + let body: models::VmmServerListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -817,59 +655,96 @@ pub mod sql_managed_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, - pub(crate) parameters: models::SqlManagedInstanceUpdate, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.sql_managed_instance_name + &this.resource_group_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod delete { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VmmServerListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -888,145 +763,86 @@ pub mod sql_managed_instances { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ScVmm/vmmServers", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.sql_managed_instance_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod failover_groups { +pub mod operations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List the failover groups associated with the given sql managed instance."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), - } - } - #[doc = "Retrieves a failover group resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - #[doc = "* `failover_group_name`: The name of the Failover Group"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - failover_group_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), - failover_group_name: failover_group_name.into(), - } - } - #[doc = "Creates or replaces a failover group resource."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `failover_group_resource`: desc"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - #[doc = "* `failover_group_name`: The name of the Failover Group"] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - failover_group_resource: impl Into, - sql_managed_instance_name: impl Into, - failover_group_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - failover_group_resource: failover_group_resource.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), - failover_group_name: failover_group_name.into(), - } - } - #[doc = "Deletes a failover group resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_managed_instance_name`: Name of SQL Managed Instance"] - #[doc = "* `failover_group_name`: The name of the Failover Group"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_managed_instance_name: impl Into, - failover_group_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_managed_instance_name: sql_managed_instance_name.into(), - failover_group_name: failover_group_name.into(), - } + #[doc = "Returns list of all operations."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } } } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FailoverGroupListResult = serde_json::from_slice(&bytes)?; + let body: models::ResourceProviderOperationList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1063,22 +879,13 @@ pub mod failover_groups { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}/failoverGroups", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.sql_managed_instance_name - ))?; + let mut url = azure_core::Url::parse(&format!("{}/providers/Microsoft.ScVmm/operations", this.client.endpoint(),))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -1095,7 +902,7 @@ pub mod failover_groups { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1111,7 +918,7 @@ pub mod failover_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1126,18 +933,232 @@ pub mod failover_groups { }; rsp?.into_body().await } - }; - azure_core::Pageable::new(make_request) + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod clouds { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a Cloud."] + #[doc = "Implements Cloud GET method."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cloud_name`: Name of the Cloud."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cloud_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cloud_name: cloud_name.into(), + } + } + #[doc = "Implements Clouds PUT method."] + #[doc = "Onboards the ScVmm fabric cloud as an Azure cloud resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cloud_name`: Name of the Cloud."] + #[doc = "* `body`: Request payload."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cloud_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cloud_name: cloud_name.into(), + body: body.into(), + } + } + #[doc = "Implements the Clouds PATCH method."] + #[doc = "Updates the Clouds resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `cloud_name`: Name of the Cloud."] + #[doc = "* `body`: Clouds patch payload."] + pub fn update( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + cloud_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + cloud_name: cloud_name.into(), + body: body.into(), + } + } + #[doc = "Implements Cloud resource DELETE method."] + #[doc = "Deregisters the ScVmm fabric cloud from Azure."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `cloud_name`: Name of the Cloud."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + cloud_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + cloud_name: cloud_name.into(), + force: None, + } + } + #[doc = "Implements GET Clouds in a resource group."] + #[doc = "List of Clouds in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Implements GET Clouds in a subscription."] + #[doc = "List of Clouds in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Cloud = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) cloud_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/clouds/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cloud_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FailoverGroupResource = serde_json::from_slice(&bytes)?; + let body: models::Cloud = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1176,10 +1197,11 @@ pub mod failover_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, - pub(crate) failover_group_name: String, + pub(crate) cloud_name: String, + pub(crate) body: models::Cloud, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1188,8 +1210,14 @@ pub mod failover_groups { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}/failoverGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_managed_instance_name , & this . failover_group_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/clouds/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cloud_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1198,8 +1226,9 @@ pub mod failover_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1207,8 +1236,8 @@ pub mod failover_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1219,13 +1248,13 @@ pub mod failover_groups { } } } - pub mod create { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FailoverGroupResource = serde_json::from_slice(&bytes)?; + let body: models::Cloud = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1262,11 +1291,10 @@ pub mod failover_groups { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) failover_group_resource: models::FailoverGroupResource, - pub(crate) sql_managed_instance_name: String, - pub(crate) failover_group_name: String, + pub(crate) subscription_id: String, + pub(crate) cloud_name: String, + pub(crate) body: models::ResourcePatch, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1278,8 +1306,14 @@ pub mod failover_groups { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}/failoverGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_managed_instance_name , & this . failover_group_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/clouds/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cloud_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -1288,9 +1322,9 @@ pub mod failover_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.failover_group_resource)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1298,8 +1332,8 @@ pub mod failover_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1332,10 +1366,15 @@ pub mod failover_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_managed_instance_name: String, - pub(crate) failover_group_name: String, + pub(crate) cloud_name: String, + pub(crate) force: Option, } impl RequestBuilder { + #[doc = "Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1345,7 +1384,13 @@ pub mod failover_groups { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlManagedInstances/{}/failoverGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_managed_instance_name , & this . failover_group_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/clouds/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.cloud_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -1355,7 +1400,10 @@ pub mod failover_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1364,128 +1412,13 @@ pub mod failover_groups { } } } -} -pub mod sql_server_instances { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List sqlServerInstance resources in the subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "List sqlServerInstance resources in the resource group"] - #[doc = "Gets all sqlServerInstances in a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - pub fn list_by_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - } - } - #[doc = "Retrieves a SQL Server Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_server_instance_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - } - } - #[doc = "Creates or replaces a SQL Server Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_server_instance`: The SQL Server Instance to be created or updated."] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_server_instance: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_server_instance: sql_server_instance.into(), - } - } - #[doc = "Updates a SQL Server Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `parameters`: The SQL Server Instance."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_server_instance_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes a SQL Server Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_server_instance_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - } - } - } - pub mod list { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerInstanceListResult = serde_json::from_slice(&bytes)?; + let body: models::CloudListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1523,16 +1456,18 @@ pub mod sql_server_instances { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.AzureArcData/sqlServerInstances", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/clouds", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name ))?; let rsp = match continuation { Some(value) => { @@ -1550,7 +1485,7 @@ pub mod sql_server_instances { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1566,7 +1501,7 @@ pub mod sql_server_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1586,13 +1521,13 @@ pub mod sql_server_instances { } } } - pub mod list_by_resource_group { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerInstanceListResult = serde_json::from_slice(&bytes)?; + let body: models::CloudListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1630,68 +1565,187 @@ pub mod sql_server_instances { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ScVmm/clouds", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod virtual_networks { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a VirtualNetwork."] + #[doc = "Implements VirtualNetwork GET method."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_network_name`: Name of the VirtualNetwork."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + virtual_network_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + virtual_network_name: virtual_network_name.into(), + } + } + #[doc = "Implements VirtualNetworks PUT method."] + #[doc = "Onboards the ScVmm virtual network as an Azure virtual network resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_network_name`: Name of the VirtualNetwork."] + #[doc = "* `body`: Request payload."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + virtual_network_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + virtual_network_name: virtual_network_name.into(), + body: body.into(), + } + } + #[doc = "Implements the VirtualNetworks PATCH method."] + #[doc = "Updates the VirtualNetworks resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_network_name`: Name of the VirtualNetwork."] + #[doc = "* `body`: VirtualNetworks patch payload."] + pub fn update( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_network_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_network_name: virtual_network_name.into(), + body: body.into(), + } + } + #[doc = "Implements VirtualNetwork DELETE method."] + #[doc = "Deregisters the ScVmm virtual network from Azure."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_network_name`: Name of the VirtualNetwork."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + virtual_network_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + virtual_network_name: virtual_network_name.into(), + force: None, + } + } + #[doc = "Implements GET VirtualNetworks in a resource group."] + #[doc = "List of VirtualNetworks in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Implements GET VirtualNetworks in a subscription."] + #[doc = "List of VirtualNetworks in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), } } } @@ -1699,9 +1753,9 @@ pub mod sql_server_instances { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerInstance = serde_json::from_slice(&bytes)?; + let body: models::VirtualNetwork = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1740,7 +1794,7 @@ pub mod sql_server_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, + pub(crate) virtual_network_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -1752,11 +1806,11 @@ pub mod sql_server_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualNetworks/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name + &this.virtual_network_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -1767,7 +1821,7 @@ pub mod sql_server_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1776,8 +1830,8 @@ pub mod sql_server_instances { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1788,13 +1842,13 @@ pub mod sql_server_instances { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerInstance = serde_json::from_slice(&bytes)?; + let body: models::VirtualNetwork = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1833,8 +1887,8 @@ pub mod sql_server_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_server_instance: models::SqlServerInstance, + pub(crate) virtual_network_name: String, + pub(crate) body: models::VirtualNetwork, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -1847,11 +1901,11 @@ pub mod sql_server_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualNetworks/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name + &this.virtual_network_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -1862,9 +1916,9 @@ pub mod sql_server_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_server_instance)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1872,8 +1926,8 @@ pub mod sql_server_instances { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -1888,9 +1942,9 @@ pub mod sql_server_instances { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerInstance = serde_json::from_slice(&bytes)?; + let body: models::VirtualNetwork = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -1927,12 +1981,13 @@ pub mod sql_server_instances { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) parameters: models::SqlServerInstanceUpdate, + pub(crate) subscription_id: String, + pub(crate) virtual_network_name: String, + pub(crate) body: models::ResourcePatch, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1942,11 +1997,11 @@ pub mod sql_server_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualNetworks/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name + &this.virtual_network_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -1957,9 +2012,9 @@ pub mod sql_server_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -1967,8 +2022,8 @@ pub mod sql_server_instances { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2001,9 +2056,15 @@ pub mod sql_server_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, + pub(crate) virtual_network_name: String, + pub(crate) force: Option, } impl RequestBuilder { + #[doc = "Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2014,11 +2075,11 @@ pub mod sql_server_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualNetworks/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name + &this.virtual_network_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -2029,7 +2090,10 @@ pub mod sql_server_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2038,128 +2102,13 @@ pub mod sql_server_instances { } } } -} -pub mod sql_availability_groups { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List sqlAvailabilityGroups resources in the subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "List sqlAvailabilityGroups resources in the resource group"] - #[doc = "Gets all sqlAvailabilityGroups in a resource group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - pub fn list_by_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - } - } - #[doc = "Retrieves a SQL Availability Group resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_availability_group_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - } - } - #[doc = "Creates or replaces a SQL Availability Group resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - #[doc = "* `sql_availability_group`: The SQL Availability Group to be created or updated."] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_availability_group_name: impl Into, - sql_availability_group: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - sql_availability_group: sql_availability_group.into(), - } - } - #[doc = "Updates a SQL Availability Group resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - #[doc = "* `parameters`: The SQL Availability Group."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_availability_group_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - parameters: parameters.into(), - } - } - #[doc = "Deletes a SQL Availability Group resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_availability_group_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - } - } - } - pub mod list { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupListResult = serde_json::from_slice(&bytes)?; + let body: models::VirtualNetworkListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2197,16 +2146,18 @@ pub mod sql_availability_groups { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualNetworks", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name ))?; let rsp = match continuation { Some(value) => { @@ -2224,7 +2175,7 @@ pub mod sql_availability_groups { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2240,7 +2191,7 @@ pub mod sql_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2260,13 +2211,13 @@ pub mod sql_availability_groups { } } } - pub mod list_by_resource_group { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupListResult = serde_json::from_slice(&bytes)?; + let body: models::VirtualNetworkListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2304,18 +2255,16 @@ pub mod sql_availability_groups { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups", + "{}/subscriptions/{}/providers/Microsoft.ScVmm/virtualNetworks", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name + &this.subscription_id ))?; let rsp = match continuation { Some(value) => { @@ -2333,7 +2282,7 @@ pub mod sql_availability_groups { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2349,7 +2298,7 @@ pub mod sql_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2369,13 +2318,260 @@ pub mod sql_availability_groups { } } } +} +pub mod virtual_machines { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a VirtualMachine."] + #[doc = "Implements VirtualMachine GET method."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + virtual_machine_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + } + } + #[doc = "Implements VirtualMachines PUT method."] + #[doc = "Creates Or Updates virtual machines deployed on scvmm fabric."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + #[doc = "* `body`: Request payload."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + virtual_machine_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + body: body.into(), + } + } + #[doc = "Implements the VirtualMachines PATCH method."] + #[doc = "Updates the VirtualMachines resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + #[doc = "* `body`: VirtualMachines patch payload."] + pub fn update( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + body: body.into(), + } + } + #[doc = "Implements VirtualMachine DELETE method."] + #[doc = "Deletes a VirtualMachine deployed on ScVmm fabric."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + virtual_machine_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + retain: None, + force: None, + delete_from_host: None, + } + } + #[doc = "Implements the operation to stop a virtual machine."] + #[doc = "Stop virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn stop( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + ) -> stop::RequestBuilder { + stop::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + body: None, + } + } + #[doc = "Implements the operation to start a virtual machine."] + #[doc = "Start virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn start( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + ) -> start::RequestBuilder { + start::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + } + } + #[doc = "Implements the operation to restart a virtual machine."] + #[doc = "Restart virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn restart( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + ) -> restart::RequestBuilder { + restart::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + } + } + #[doc = "Implements the operation to creates a checkpoint in a virtual machine."] + #[doc = "Creates a checkpoint in virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn create_checkpoint( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + ) -> create_checkpoint::RequestBuilder { + create_checkpoint::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + body: None, + } + } + #[doc = "Implements the operation to delete a checkpoint in a virtual machine."] + #[doc = "Deletes a checkpoint in virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn delete_checkpoint( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + ) -> delete_checkpoint::RequestBuilder { + delete_checkpoint::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + body: None, + } + } + #[doc = "Implements the operation to restores to a checkpoint in a virtual machine."] + #[doc = "Restores to a checkpoint in virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_name`: Name of the VirtualMachine."] + pub fn restore_checkpoint( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + virtual_machine_name: impl Into, + ) -> restore_checkpoint::RequestBuilder { + restore_checkpoint::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_name: virtual_machine_name.into(), + body: None, + } + } + #[doc = "Implements GET VirtualMachines in a resource group."] + #[doc = "List of VirtualMachines in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Implements GET VirtualMachines in a subscription."] + #[doc = "List of VirtualMachines in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroup = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachine = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2414,7 +2610,7 @@ pub mod sql_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2426,11 +2622,11 @@ pub mod sql_availability_groups { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name + &this.virtual_machine_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -2441,7 +2637,7 @@ pub mod sql_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2450,8 +2646,8 @@ pub mod sql_availability_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2462,13 +2658,13 @@ pub mod sql_availability_groups { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroup = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachine = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2507,8 +2703,8 @@ pub mod sql_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_name: String, - pub(crate) sql_availability_group: models::SqlAvailabilityGroup, + pub(crate) virtual_machine_name: String, + pub(crate) body: models::VirtualMachine, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -2521,11 +2717,11 @@ pub mod sql_availability_groups { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name + &this.virtual_machine_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); @@ -2536,9 +2732,9 @@ pub mod sql_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_availability_group)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2546,8 +2742,8 @@ pub mod sql_availability_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2562,9 +2758,9 @@ pub mod sql_availability_groups { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroup = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachine = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2601,12 +2797,13 @@ pub mod sql_availability_groups { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_name: String, - pub(crate) parameters: models::SqlAvailabilityGroupUpdate, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, + pub(crate) body: models::VirtualMachineUpdate, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2616,11 +2813,11 @@ pub mod sql_availability_groups { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name + &this.virtual_machine_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); @@ -2631,9 +2828,9 @@ pub mod sql_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2641,8 +2838,8 @@ pub mod sql_availability_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2675,9 +2872,27 @@ pub mod sql_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) retain: Option, + pub(crate) force: Option, + pub(crate) delete_from_host: Option, } impl RequestBuilder { + #[doc = "Whether to just disable the VM from azure and retain the VM in the VMM."] + pub fn retain(mut self, retain: bool) -> Self { + self.retain = Some(retain); + self + } + #[doc = "Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } + #[doc = "Whether to disable the VM from azure and also delete it from VMM."] + pub fn delete_from_host(mut self, delete_from_host: bool) -> Self { + self.delete_from_host = Some(delete_from_host); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2688,11 +2903,11 @@ pub mod sql_availability_groups { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name + &this.virtual_machine_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -2703,7 +2918,18 @@ pub mod sql_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(retain) = &this.retain { + req.url_mut().query_pairs_mut().append_pair("retain", &retain.to_string()); + } + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } + if let Some(delete_from_host) = &this.delete_from_host { + req.url_mut() + .query_pairs_mut() + .append_pair("deleteFromHost", &delete_from_host.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2712,146 +2938,79 @@ pub mod sql_availability_groups { } } } -} -pub mod data_controllers { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List dataController resources in the subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - pub fn list_in_subscription(&self, subscription_id: impl Into) -> list_in_subscription::RequestBuilder { - list_in_subscription::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - } - } - #[doc = "List dataController resources in the resource group"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - pub fn list_in_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> list_in_group::RequestBuilder { - list_in_group::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - } - } - #[doc = "Retrieves a dataController resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_name`: The name of the data controller"] - pub fn get_data_controller( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - data_controller_name: impl Into, - ) -> get_data_controller::RequestBuilder { - get_data_controller::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - data_controller_name: data_controller_name.into(), - } - } - #[doc = "Creates or replaces a dataController resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_resource`: desc"] - #[doc = "* `data_controller_name`: The name of the data controller"] - pub fn put_data_controller( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - data_controller_resource: impl Into, - data_controller_name: impl Into, - ) -> put_data_controller::RequestBuilder { - put_data_controller::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - data_controller_resource: data_controller_resource.into(), - data_controller_name: data_controller_name.into(), - } + pub mod stop { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, + pub(crate) body: Option, } - #[doc = "Updates a dataController resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_name`: The name of the data controller"] - #[doc = "* `data_controller_resource`: The update data controller resource"] - pub fn patch_data_controller( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - data_controller_name: impl Into, - data_controller_resource: impl Into, - ) -> patch_data_controller::RequestBuilder { - patch_data_controller::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - data_controller_name: data_controller_name.into(), - data_controller_resource: data_controller_resource.into(), + impl RequestBuilder { + #[doc = "Virtualmachine stop action payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self } - } - #[doc = "Deletes a dataController resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_name`: The name of the data controller"] - pub fn delete_data_controller( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - data_controller_name: impl Into, - ) -> delete_data_controller::RequestBuilder { - delete_data_controller::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - data_controller_name: data_controller_name.into(), + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/stop", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } } - pub mod list_in_subscription { + pub mod start { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PageOfDataControllerResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -2869,96 +3028,109 @@ pub mod data_controllers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.AzureArcData/dataControllers", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/start", this.client.endpoint(), - &this.subscription_id + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod restart { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/restart", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } - pub mod list_in_group { + pub mod create_checkpoint { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::PageOfDataControllerResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -2976,98 +3148,59 @@ pub mod data_controllers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, + pub(crate) body: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Virtualmachine create checkpoint action payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/createCheckpoint", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name + &this.resource_group_name, + &this.virtual_machine_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY }; - rsp?.into_body().await + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } } - pub mod get_data_controller { + pub mod delete_checkpoint { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataControllerResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3085,11 +3218,18 @@ pub mod data_controllers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) data_controller_name: String, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "Virtualmachine delete checkpoint action payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3099,13 +3239,13 @@ pub mod data_controllers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/deleteCheckpoint", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.data_controller_name + &this.virtual_machine_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3114,53 +3254,23 @@ pub mod data_controllers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod put_data_controller { + pub mod restore_checkpoint { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::DataControllerResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3178,12 +3288,17 @@ pub mod data_controllers { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) data_controller_resource: models::DataControllerResource, - pub(crate) data_controller_name: String, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_name: String, + pub(crate) body: Option, } impl RequestBuilder { + #[doc = "Virtualmachine restore checkpoint action payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3194,13 +3309,13 @@ pub mod data_controllers { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/restoreCheckpoint", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.data_controller_name + &this.virtual_machine_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3209,35 +3324,27 @@ pub mod data_controllers { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.data_controller_resource)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } - pub mod patch_data_controller { + pub mod list_by_resource_group { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::DataControllerResource = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachineListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3276,60 +3383,96 @@ pub mod data_controllers { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) data_controller_name: String, - pub(crate) data_controller_resource: models::DataControllerUpdate, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name, - &this.data_controller_name + &this.resource_group_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.data_controller_resource)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod delete_data_controller { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualMachineListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -3348,145 +3491,197 @@ pub mod data_controllers { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) data_controller_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ScVmm/virtualMachines", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.data_controller_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod active_directory_connectors { +pub mod virtual_machine_templates { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List the active directory connectors associated with the given data controller."] + #[doc = "Gets a VirtualMachineTemplate."] + #[doc = "Implements VirtualMachineTemplate GET method."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_name`: The name of the data controller"] - pub fn list( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_template_name`: Name of the VirtualMachineTemplate."] + pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - data_controller_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + virtual_machine_template_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - data_controller_name: data_controller_name.into(), + virtual_machine_template_name: virtual_machine_template_name.into(), } } - #[doc = "Retrieves an Active Directory connector resource"] + #[doc = "Implements VirtualMachineTemplates PUT method."] + #[doc = "Onboards the ScVmm VM Template as an Azure VM Template resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_name`: The name of the data controller"] - #[doc = "* `active_directory_connector_name`: The name of the Active Directory connector instance"] - pub fn get( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_template_name`: Name of the VirtualMachineTemplate."] + #[doc = "* `body`: Request payload."] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - data_controller_name: impl Into, - active_directory_connector_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + virtual_machine_template_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - data_controller_name: data_controller_name.into(), - active_directory_connector_name: active_directory_connector_name.into(), + virtual_machine_template_name: virtual_machine_template_name.into(), + body: body.into(), } } - #[doc = "Creates or replaces an Active Directory connector resource."] + #[doc = "Implements the VirtualMachineTemplate PATCH method."] + #[doc = "Updates the VirtualMachineTemplate resource."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `active_directory_connector_resource`: desc"] - #[doc = "* `data_controller_name`: The name of the data controller"] - #[doc = "* `active_directory_connector_name`: The name of the Active Directory connector instance"] - pub fn create( + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `virtual_machine_template_name`: Name of the VirtualMachineTemplate."] + #[doc = "* `body`: VirtualMachineTemplates patch details."] + pub fn update( &self, - subscription_id: impl Into, resource_group_name: impl Into, - active_directory_connector_resource: impl Into, - data_controller_name: impl Into, - active_directory_connector_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + subscription_id: impl Into, + virtual_machine_template_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), - subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - active_directory_connector_resource: active_directory_connector_resource.into(), - data_controller_name: data_controller_name.into(), - active_directory_connector_name: active_directory_connector_name.into(), + subscription_id: subscription_id.into(), + virtual_machine_template_name: virtual_machine_template_name.into(), + body: body.into(), } } - #[doc = "Deletes an Active Directory connector resource"] + #[doc = "Implements VirtualMachineTemplate DELETE method."] + #[doc = "Deregisters the ScVmm VM Template from Azure."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `data_controller_name`: The name of the data controller"] - #[doc = "* `active_directory_connector_name`: The name of the Active Directory connector instance"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_template_name`: Name of the VirtualMachineTemplate."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - data_controller_name: impl Into, - active_directory_connector_name: impl Into, + virtual_machine_template_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - data_controller_name: data_controller_name.into(), - active_directory_connector_name: active_directory_connector_name.into(), + virtual_machine_template_name: virtual_machine_template_name.into(), + force: None, + } + } + #[doc = "Implements GET VirtualMachineTemplates in a resource group."] + #[doc = "List of VirtualMachineTemplates in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Implements GET VirtualMachineTemplates in a subscription."] + #[doc = "List of VirtualMachineTemplates in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ActiveDirectoryConnectorListResult = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachineTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3525,73 +3720,61 @@ pub mod active_directory_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) data_controller_name: String, + pub(crate) virtual_machine_template_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}/activeDirectoryConnectors" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . data_controller_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachineTemplates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_template_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ActiveDirectoryConnectorResource = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachineTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3630,10 +3813,11 @@ pub mod active_directory_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) data_controller_name: String, - pub(crate) active_directory_connector_name: String, + pub(crate) virtual_machine_template_name: String, + pub(crate) body: models::VirtualMachineTemplate, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3642,8 +3826,14 @@ pub mod active_directory_connectors { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}/activeDirectoryConnectors/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . data_controller_name , & this . active_directory_connector_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachineTemplates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_template_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3652,8 +3842,9 @@ pub mod active_directory_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3661,8 +3852,8 @@ pub mod active_directory_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3673,13 +3864,13 @@ pub mod active_directory_connectors { } } } - pub mod create { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ActiveDirectoryConnectorResource = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachineTemplate = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3716,11 +3907,10 @@ pub mod active_directory_connectors { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) active_directory_connector_resource: models::ActiveDirectoryConnectorResource, - pub(crate) data_controller_name: String, - pub(crate) active_directory_connector_name: String, + pub(crate) subscription_id: String, + pub(crate) virtual_machine_template_name: String, + pub(crate) body: models::ResourcePatch, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -3732,8 +3922,14 @@ pub mod active_directory_connectors { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}/activeDirectoryConnectors/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . data_controller_name , & this . active_directory_connector_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachineTemplates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_template_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3742,9 +3938,9 @@ pub mod active_directory_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.active_directory_connector_resource)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3752,8 +3948,8 @@ pub mod active_directory_connectors { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3786,10 +3982,15 @@ pub mod active_directory_connectors { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) data_controller_name: String, - pub(crate) active_directory_connector_name: String, + pub(crate) virtual_machine_template_name: String, + pub(crate) force: Option, } impl RequestBuilder { + #[doc = "Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3799,7 +4000,13 @@ pub mod active_directory_connectors { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/dataControllers/{}/activeDirectoryConnectors/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . data_controller_name , & this . active_directory_connector_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachineTemplates/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_template_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -3809,7 +4016,10 @@ pub mod active_directory_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3818,128 +4028,122 @@ pub mod active_directory_connectors { } } } -} -pub mod postgres_instances { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List postgres Instance resources in the subscription"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::VirtualMachineTemplateListResult = serde_json::from_slice(&bytes)?; + Ok(body) } - } - #[doc = "List postgres Instance resources in the resource group"] - #[doc = "Get a postgres Instances list by Resource group name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - pub fn list_by_resource_group( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - ) -> list_by_resource_group::RequestBuilder { - list_by_resource_group::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), + pub fn into_raw_response(self) -> azure_core::Response { + self.0 } - } - #[doc = "Retrieves a postgres Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - postgres_instance_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - postgres_instance_name: postgres_instance_name.into(), + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "Creates or replaces a postgres Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] - #[doc = "* `resource`: The postgres instance"] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - postgres_instance_name: impl Into, - resource: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - postgres_instance_name: postgres_instance_name.into(), - resource: resource.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Updates a postgres Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] - #[doc = "* `parameters`: The Postgres Instance."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - postgres_instance_name: impl Into, - parameters: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - postgres_instance_name: postgres_instance_name.into(), - parameters: parameters.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } - #[doc = "Deletes a postgres Instance resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `postgres_instance_name`: Name of Postgres Instance"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - postgres_instance_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - postgres_instance_name: postgres_instance_name.into(), + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachineTemplates", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } - pub mod list { + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PostgresInstanceListResult = serde_json::from_slice(&bytes)?; + let body: models::VirtualMachineTemplateListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3979,12 +4183,12 @@ pub mod postgres_instances { pub(crate) subscription_id: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/providers/Microsoft.AzureArcData/postgresInstances", + "{}/subscriptions/{}/providers/Microsoft.ScVmm/virtualMachineTemplates", this.client.endpoint(), &this.subscription_id ))?; @@ -4004,7 +4208,7 @@ pub mod postgres_instances { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4020,7 +4224,7 @@ pub mod postgres_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -4040,13 +4244,134 @@ pub mod postgres_instances { } } } - pub mod list_by_resource_group { +} +pub mod availability_sets { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets an AvailabilitySet."] + #[doc = "Implements AvailabilitySet GET method."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `availability_set_name`: Name of the AvailabilitySet."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + availability_set_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + availability_set_name: availability_set_name.into(), + } + } + #[doc = "Implements AvailabilitySets PUT method."] + #[doc = "Onboards the ScVmm availability set as an Azure resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `availability_set_name`: Name of the AvailabilitySet."] + #[doc = "* `body`: Request payload."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + availability_set_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + availability_set_name: availability_set_name.into(), + body: body.into(), + } + } + #[doc = "Implements the AvailabilitySets PATCH method."] + #[doc = "Updates the AvailabilitySets resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `availability_set_name`: Name of the AvailabilitySet."] + #[doc = "* `body`: AvailabilitySets patch payload."] + pub fn update( + &self, + resource_group_name: impl Into, + subscription_id: impl Into, + availability_set_name: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + resource_group_name: resource_group_name.into(), + subscription_id: subscription_id.into(), + availability_set_name: availability_set_name.into(), + body: body.into(), + } + } + #[doc = "Implements AvailabilitySet DELETE method."] + #[doc = "Deregisters the ScVmm availability set from Azure."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `availability_set_name`: Name of the AvailabilitySet."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + availability_set_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + availability_set_name: availability_set_name.into(), + force: None, + } + } + #[doc = "Implements GET AvailabilitySets in a resource group."] + #[doc = "List of AvailabilitySets in a resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Implements GET AvailabilitySets in a subscription."] + #[doc = "List of AvailabilitySets in a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PostgresInstanceListResult = serde_json::from_slice(&bytes)?; + let body: models::AvailabilitySet = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4085,77 +4410,61 @@ pub mod postgres_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, + pub(crate) availability_set_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances", + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/availabilitySets/{}", this.client.endpoint(), &this.subscription_id, - &this.resource_group_name + &this.resource_group_name, + &this.availability_set_name ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PostgresInstance = serde_json::from_slice(&bytes)?; + let body: models::AvailabilitySet = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4164,6 +4473,9 @@ pub mod postgres_instances { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -4175,6 +4487,14 @@ pub mod postgres_instances { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Tracking URL for long running operation."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -4194,9 +4514,11 @@ pub mod postgres_instances { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) postgres_instance_name: String, + pub(crate) availability_set_name: String, + pub(crate) body: models::AvailabilitySet, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4206,13 +4528,13 @@ pub mod postgres_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/availabilitySets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.postgres_instance_name + &this.availability_set_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -4221,8 +4543,9 @@ pub mod postgres_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -4230,8 +4553,8 @@ pub mod postgres_instances { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4242,13 +4565,13 @@ pub mod postgres_instances { } } } - pub mod create { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PostgresInstance = serde_json::from_slice(&bytes)?; + let body: models::AvailabilitySet = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4285,10 +4608,10 @@ pub mod postgres_instances { #[doc = r" [`Response`] value."] pub struct RequestBuilder { pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) postgres_instance_name: String, - pub(crate) resource: models::PostgresInstance, + pub(crate) subscription_id: String, + pub(crate) availability_set_name: String, + pub(crate) body: models::ResourcePatch, } impl RequestBuilder { #[doc = "only the first response will be fetched as long running operations are not supported yet"] @@ -4301,13 +4624,13 @@ pub mod postgres_instances { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/availabilitySets/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.postgres_instance_name + &this.availability_set_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -4316,9 +4639,9 @@ pub mod postgres_instances { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.resource)?; + let req_body = azure_core::to_json(&this.body)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -4326,8 +4649,8 @@ pub mod postgres_instances { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4338,13 +4661,190 @@ pub mod postgres_instances { } } } - pub mod update { + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) availability_set_name: String, + pub(crate) force: Option, + } + impl RequestBuilder { + #[doc = "Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too."] + pub fn force(mut self, force: bool) -> Self { + self.force = Some(force); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/availabilitySets/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.availability_set_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(force) = &this.force { + req.url_mut().query_pairs_mut().append_pair("force", &force.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AvailabilitySetListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/availabilitySets", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::PostgresInstance = serde_json::from_slice(&bytes)?; + let body: models::AvailabilitySetListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4382,232 +4882,162 @@ pub mod postgres_instances { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) postgres_instance_name: String, - pub(crate) parameters: models::PostgresInstanceUpdate, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.postgres_instance_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) postgres_instance_name: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/postgresInstances/{}", + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.ScVmm/availabilitySets", this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.postgres_instance_name + &this.subscription_id ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod sql_server_databases { +pub mod inventory_items { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Retrieves an Arc Sql Server database."] + #[doc = "Implements GET InventoryItem method."] + #[doc = "Shows an inventory item."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `database_name`: Name of the database"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + #[doc = "* `inventory_item_name`: Name of the inventoryItem."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - database_name: impl Into, + vmm_server_name: impl Into, + inventory_item_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - database_name: database_name.into(), + vmm_server_name: vmm_server_name.into(), + inventory_item_name: inventory_item_name.into(), } } - #[doc = "Creates or replaces an Arc Sql Server Database."] + #[doc = "Implements InventoryItem PUT method."] + #[doc = "Create Or Update InventoryItem."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_database_resource`: The request body for database resource."] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `database_name`: Name of the database"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + #[doc = "* `inventory_item_name`: Name of the inventoryItem."] pub fn create( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_database_resource: impl Into, - sql_server_instance_name: impl Into, - database_name: impl Into, + vmm_server_name: impl Into, + inventory_item_name: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_database_resource: sql_server_database_resource.into(), - sql_server_instance_name: sql_server_instance_name.into(), - database_name: database_name.into(), - } - } - #[doc = "Updates an existing database."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `database_name`: Name of the database"] - #[doc = "* `sql_server_database_update`: The requested database resource state."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_server_instance_name: impl Into, - database_name: impl Into, - sql_server_database_update: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - database_name: database_name.into(), - sql_server_database_update: sql_server_database_update.into(), + vmm_server_name: vmm_server_name.into(), + inventory_item_name: inventory_item_name.into(), + body: None, } } - #[doc = "Deletes an Arc Sql Server database resource."] + #[doc = "Implements inventoryItem DELETE method."] + #[doc = "Deletes an inventoryItem."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `database_name`: Name of the database"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + #[doc = "* `inventory_item_name`: Name of the inventoryItem."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - database_name: impl Into, + vmm_server_name: impl Into, + inventory_item_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - database_name: database_name.into(), + vmm_server_name: vmm_server_name.into(), + inventory_item_name: inventory_item_name.into(), } } - #[doc = "List the databases associated with the given Arc Sql Server."] + #[doc = "Implements GET for the list of Inventory Items in the VMMServer."] + #[doc = "Returns the list of inventoryItems in the given VMMServer."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - pub fn list( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `vmm_server_name`: Name of the VMMServer."] + pub fn list_by_vmm_server( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + vmm_server_name: impl Into, + ) -> list_by_vmm_server::RequestBuilder { + list_by_vmm_server::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), + vmm_server_name: vmm_server_name.into(), } } } @@ -4615,9 +5045,9 @@ pub mod sql_server_databases { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerDatabaseResource = serde_json::from_slice(&bytes)?; + let body: models::InventoryItem = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4656,8 +5086,8 @@ pub mod sql_server_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) database_name: String, + pub(crate) vmm_server_name: String, + pub(crate) inventory_item_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -4669,12 +5099,12 @@ pub mod sql_server_databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}/inventoryItems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name, - &this.database_name + &this.vmm_server_name, + &this.inventory_item_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -4685,7 +5115,7 @@ pub mod sql_server_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4694,8 +5124,8 @@ pub mod sql_server_databases { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4710,9 +5140,9 @@ pub mod sql_server_databases { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerDatabaseResource = serde_json::from_slice(&bytes)?; + let body: models::InventoryItem = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4751,108 +5181,16 @@ pub mod sql_server_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_database_resource: models::SqlServerDatabaseResource, - pub(crate) sql_server_instance_name: String, - pub(crate) database_name: String, + pub(crate) vmm_server_name: String, + pub(crate) inventory_item_name: String, + pub(crate) body: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/databases/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.sql_server_instance_name, - &this.database_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_server_database_resource)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerDatabaseResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Request payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) database_name: String, - pub(crate) sql_server_database_update: models::SqlServerDatabaseUpdate, - } - impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4862,14 +5200,14 @@ pub mod sql_server_databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}/inventoryItems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name, - &this.database_name + &this.vmm_server_name, + &this.inventory_item_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -4878,9 +5216,13 @@ pub mod sql_server_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_server_database_update)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -4888,8 +5230,8 @@ pub mod sql_server_databases { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4922,8 +5264,8 @@ pub mod sql_server_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) database_name: String, + pub(crate) vmm_server_name: String, + pub(crate) inventory_item_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -4935,12 +5277,12 @@ pub mod sql_server_databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}/inventoryItems/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name, - &this.database_name + &this.vmm_server_name, + &this.inventory_item_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -4951,7 +5293,7 @@ pub mod sql_server_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4960,13 +5302,13 @@ pub mod sql_server_databases { } } } - pub mod list { + pub mod list_by_vmm_server { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ArcSqlServerDatabaseListResult = serde_json::from_slice(&bytes)?; + let body: models::InventoryItemsList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5005,19 +5347,19 @@ pub mod sql_server_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, + pub(crate) vmm_server_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/databases", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/vmmServers/{}/inventoryItems", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_server_instance_name + &this.vmm_server_name ))?; let rsp = match continuation { Some(value) => { @@ -5035,7 +5377,7 @@ pub mod sql_server_databases { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5051,7 +5393,7 @@ pub mod sql_server_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -5072,121 +5414,98 @@ pub mod sql_server_databases { } } } -pub mod sql_server_availability_groups { +pub mod hybrid_identity_metadatas { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Retrieves an Arc Sql Server availability group."] + #[doc = "Gets HybridIdentityMetadata."] + #[doc = "Implements HybridIdentityMetadata GET method."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + #[doc = "* `metadata_name`: Name of the HybridIdentityMetadata."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + metadata_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + metadata_name: metadata_name.into(), } } - #[doc = "Creates or replaces an Arc Sql Server Availability Group."] + #[doc = "Implements HybridIdentityMetadata PUT method."] + #[doc = "Create Or Update HybridIdentityMetadata."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_availability_group_resource`: The request body for availability group resource."] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + #[doc = "* `metadata_name`: Name of the hybridIdentityMetadata."] pub fn create( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_availability_group_resource: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_server_availability_group_resource: sql_server_availability_group_resource.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - } - } - #[doc = "Updates an existing Availability Group."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - #[doc = "* `sql_server_availability_group_update`: The requested server availability group resource state."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, - sql_server_availability_group_update: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + virtual_machine_name: impl Into, + metadata_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - sql_server_availability_group_update: sql_server_availability_group_update.into(), + virtual_machine_name: virtual_machine_name.into(), + metadata_name: metadata_name.into(), + body: None, } } - #[doc = "Deletes an Arc Sql Server availability group resource."] + #[doc = "Deletes an HybridIdentityMetadata."] + #[doc = "Implements HybridIdentityMetadata DELETE method."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + #[doc = "* `metadata_name`: Name of the HybridIdentityMetadata."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + metadata_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + metadata_name: metadata_name.into(), } } - #[doc = "List the availability group associated with the given Arc Sql Server."] + #[doc = "Implements GET HybridIdentityMetadata in a vm."] + #[doc = "Returns the list of HybridIdentityMetadata of the given vm."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - pub fn list( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + pub fn list_by_vm( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + virtual_machine_name: impl Into, + ) -> list_by_vm::RequestBuilder { + list_by_vm::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), + virtual_machine_name: virtual_machine_name.into(), } } } @@ -5194,9 +5513,9 @@ pub mod sql_server_availability_groups { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerAvailabilityGroupResource = serde_json::from_slice(&bytes)?; + let body: models::HybridIdentityMetadata = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5235,8 +5554,8 @@ pub mod sql_server_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) metadata_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5247,7 +5566,14 @@ pub mod sql_server_availability_groups { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/sqlAvailabilityGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_server_instance_name , & this . sql_availability_group_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/hybridIdentityMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.metadata_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5257,7 +5583,7 @@ pub mod sql_server_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5266,8 +5592,8 @@ pub mod sql_server_availability_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5282,9 +5608,9 @@ pub mod sql_server_availability_groups { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerAvailabilityGroupResource = serde_json::from_slice(&bytes)?; + let body: models::HybridIdentityMetadata = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5323,101 +5649,16 @@ pub mod sql_server_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_availability_group_resource: models::SqlServerAvailabilityGroupResource, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) metadata_name: String, + pub(crate) body: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/sqlAvailabilityGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_server_instance_name , & this . sql_availability_group_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_server_availability_group_resource)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SqlServerAvailabilityGroupResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Request payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, - pub(crate) sql_server_availability_group_update: models::SqlServerAvailabilityGroupUpdate, - } - impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5426,8 +5667,15 @@ pub mod sql_server_availability_groups { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/sqlAvailabilityGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_server_instance_name , & this . sql_availability_group_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/hybridIdentityMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.metadata_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -5436,9 +5684,13 @@ pub mod sql_server_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_server_availability_group_update)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -5446,8 +5698,8 @@ pub mod sql_server_availability_groups { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5480,8 +5732,8 @@ pub mod sql_server_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) metadata_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5492,7 +5744,14 @@ pub mod sql_server_availability_groups { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/sqlAvailabilityGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_server_instance_name , & this . sql_availability_group_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/hybridIdentityMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.metadata_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5502,7 +5761,7 @@ pub mod sql_server_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5511,13 +5770,13 @@ pub mod sql_server_availability_groups { } } } - pub mod list { + pub mod list_by_vm { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ArcSqlServerAvailabilityGroupListResult = serde_json::from_slice(&bytes)?; + let body: models::HybridIdentityMetadataList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5556,14 +5815,20 @@ pub mod sql_server_availability_groups { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, + pub(crate) virtual_machine_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlServerInstances/{}/sqlAvailabilityGroups" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_server_instance_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/hybridIdentityMetadata", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -5580,7 +5845,7 @@ pub mod sql_server_availability_groups { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5596,7 +5861,7 @@ pub mod sql_server_availability_groups { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -5617,121 +5882,122 @@ pub mod sql_server_availability_groups { } } } -pub mod sql_availability_group_replicas { +pub mod machine_extensions { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Retrieves an Arc Sql availability group replica."] + #[doc = "The operation to get the extension."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: The name of the machine where the extension should be created or updated."] + #[doc = "* `extension_name`: The name of the machine extension."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + extension_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + extension_name: extension_name.into(), } } - #[doc = "Creates or replaces an Arc Sql Availability Group Replica."] + #[doc = "The operation to create or update the extension."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_replica_resource`: The request body for availability group replica resource."] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - pub fn create( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: The name of the machine where the extension should be created or updated."] + #[doc = "* `extension_name`: The name of the machine extension."] + #[doc = "* `extension_parameters`: Parameters supplied to the Create Machine Extension operation."] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_availability_group_replica_resource: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + virtual_machine_name: impl Into, + extension_name: impl Into, + extension_parameters: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_availability_group_replica_resource: sql_availability_group_replica_resource.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + extension_name: extension_name.into(), + extension_parameters: extension_parameters.into(), } } - #[doc = "Updates an existing Availability Group Replica."] + #[doc = "The operation to update the extension."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - #[doc = "* `sql_availability_group_replica_update`: The requested availability group replica resource state."] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: The name of the machine where the extension should be created or updated."] + #[doc = "* `extension_name`: The name of the machine extension."] + #[doc = "* `extension_parameters`: Parameters supplied to the Create Machine Extension operation."] pub fn update( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, - sql_availability_group_replica_update: impl Into, + virtual_machine_name: impl Into, + extension_name: impl Into, + extension_parameters: impl Into, ) -> update::RequestBuilder { update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - sql_availability_group_replica_update: sql_availability_group_replica_update.into(), + virtual_machine_name: virtual_machine_name.into(), + extension_name: extension_name.into(), + extension_parameters: extension_parameters.into(), } } - #[doc = "Deletes an Arc Sql availability group replica resource."] + #[doc = "The operation to delete the extension."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_server_instance_name`: Name of SQL Server Instance"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: The name of the machine where the extension should be created or updated."] + #[doc = "* `extension_name`: The name of the machine extension."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_server_instance_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + extension_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_server_instance_name: sql_server_instance_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + extension_name: extension_name.into(), } } - #[doc = "List the Availability Group Replica associated with the given Arc Sql AG."] + #[doc = "The operation to get all extensions of a non-Azure machine"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: The name of the machine where the extension should be created or updated."] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + expand: None, } } } @@ -5739,9 +6005,9 @@ pub mod sql_availability_group_replicas { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupReplicaResource = serde_json::from_slice(&bytes)?; + let body: models::MachineExtension = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5780,8 +6046,8 @@ pub mod sql_availability_group_replicas { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) extension_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5792,7 +6058,14 @@ pub mod sql_availability_group_replicas { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/sqlServerInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_availability_group_name , & this . sql_server_instance_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.extension_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5802,7 +6075,7 @@ pub mod sql_availability_group_replicas { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5811,8 +6084,8 @@ pub mod sql_availability_group_replicas { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5823,13 +6096,13 @@ pub mod sql_availability_group_replicas { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupReplicaResource = serde_json::from_slice(&bytes)?; + let body: models::MachineExtension = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5868,11 +6141,12 @@ pub mod sql_availability_group_replicas { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_replica_resource: models::SqlAvailabilityGroupReplicaResource, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) extension_name: String, + pub(crate) extension_parameters: models::MachineExtension, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5881,7 +6155,14 @@ pub mod sql_availability_group_replicas { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/sqlServerInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_availability_group_name , & this . sql_server_instance_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.extension_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5891,9 +6172,9 @@ pub mod sql_availability_group_replicas { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_availability_group_replica_resource)?; + let req_body = azure_core::to_json(&this.extension_parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -5901,8 +6182,8 @@ pub mod sql_availability_group_replicas { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5917,9 +6198,9 @@ pub mod sql_availability_group_replicas { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupReplicaResource = serde_json::from_slice(&bytes)?; + let body: models::MachineExtension = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5928,6 +6209,9 @@ pub mod sql_availability_group_replicas { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -5939,6 +6223,14 @@ pub mod sql_availability_group_replicas { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Tracking URL for long running operation."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -5958,11 +6250,12 @@ pub mod sql_availability_group_replicas { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, - pub(crate) sql_availability_group_replica_update: models::SqlAvailabilityGroupReplicaUpdate, + pub(crate) virtual_machine_name: String, + pub(crate) extension_name: String, + pub(crate) extension_parameters: models::MachineExtensionUpdate, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5971,7 +6264,14 @@ pub mod sql_availability_group_replicas { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/sqlServerInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_availability_group_name , & this . sql_server_instance_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.extension_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5981,9 +6281,9 @@ pub mod sql_availability_group_replicas { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_availability_group_replica_update)?; + let req_body = azure_core::to_json(&this.extension_parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -5991,8 +6291,8 @@ pub mod sql_availability_group_replicas { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6025,10 +6325,11 @@ pub mod sql_availability_group_replicas { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_server_instance_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) extension_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6037,7 +6338,14 @@ pub mod sql_availability_group_replicas { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/sqlServerInstances/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_availability_group_name , & this . sql_server_instance_name)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/extensions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name, + &this.extension_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -6047,7 +6355,7 @@ pub mod sql_availability_group_replicas { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6060,9 +6368,9 @@ pub mod sql_availability_group_replicas { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ArcSqlAvailabilityGroupReplicaListResult = serde_json::from_slice(&bytes)?; + let body: models::MachineExtensionsListResult = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6101,14 +6409,26 @@ pub mod sql_availability_group_replicas { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) expand: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "The expand expression to apply on the operation."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/sqlServerInstances" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . sql_availability_group_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/extensions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.virtual_machine_name + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -6125,7 +6445,7 @@ pub mod sql_availability_group_replicas { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6141,7 +6461,10 @@ pub mod sql_availability_group_replicas { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -6162,121 +6485,98 @@ pub mod sql_availability_group_replicas { } } } -pub mod sql_availability_group_databases { +pub mod guest_agents { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Retrieves an Arc Sql availability group database resource."] + #[doc = "Gets GuestAgent."] + #[doc = "Implements GuestAgent GET method."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_database_name`: Name of SQL Availability Group Database"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + #[doc = "* `guest_agent_name`: Name of the GuestAgent."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_availability_group_database_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + guest_agent_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_availability_group_database_name: sql_availability_group_database_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + guest_agent_name: guest_agent_name.into(), } } - #[doc = "Creates or update database in an Arc Sql Availability Group."] + #[doc = "Implements GuestAgent PUT method."] + #[doc = "Create Or Update GuestAgent."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_database_resource`: The request body for availability group databases resource."] - #[doc = "* `sql_availability_group_database_name`: Name of SQL Availability Group Database"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + #[doc = "* `guest_agent_name`: Name of the guestAgents."] pub fn create( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_availability_group_database_resource: impl Into, - sql_availability_group_database_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + guest_agent_name: impl Into, ) -> create::RequestBuilder { create::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_availability_group_database_resource: sql_availability_group_database_resource.into(), - sql_availability_group_database_name: sql_availability_group_database_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - } - } - #[doc = "Updates an existing Availability Group Database."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_database_name`: Name of SQL Availability Group Database"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - #[doc = "* `sql_availability_group_database_update`: The update availability group database resource."] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - sql_availability_group_database_name: impl Into, - sql_availability_group_name: impl Into, - sql_availability_group_database_update: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - sql_availability_group_database_name: sql_availability_group_database_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), - sql_availability_group_database_update: sql_availability_group_database_update.into(), + virtual_machine_name: virtual_machine_name.into(), + guest_agent_name: guest_agent_name.into(), + body: None, } } - #[doc = "Deletes an Arc Sql availability group database resource."] + #[doc = "Deletes an GuestAgent."] + #[doc = "Implements GuestAgent DELETE method."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_database_name`: Name of SQL Availability Group Database"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + #[doc = "* `guest_agent_name`: Name of the GuestAgent."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_availability_group_database_name: impl Into, - sql_availability_group_name: impl Into, + virtual_machine_name: impl Into, + guest_agent_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_availability_group_database_name: sql_availability_group_database_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), + guest_agent_name: guest_agent_name.into(), } } - #[doc = "List the Availability Group Databases associated with the given Arc Sql AG."] + #[doc = "Implements GET GuestAgent in a vm."] + #[doc = "Returns the list of GuestAgent of the given vm."] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the Azure subscription"] - #[doc = "* `resource_group_name`: The name of the Azure resource group"] - #[doc = "* `sql_availability_group_name`: Name of SQL Availability Group"] - pub fn list( + #[doc = "* `subscription_id`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)."] + #[doc = "* `resource_group_name`: The name of the resource group."] + #[doc = "* `virtual_machine_name`: Name of the vm."] + pub fn list_by_vm( &self, subscription_id: impl Into, resource_group_name: impl Into, - sql_availability_group_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + virtual_machine_name: impl Into, + ) -> list_by_vm::RequestBuilder { + list_by_vm::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - sql_availability_group_name: sql_availability_group_name.into(), + virtual_machine_name: virtual_machine_name.into(), } } } @@ -6284,9 +6584,9 @@ pub mod sql_availability_group_databases { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupDatabaseResource = serde_json::from_slice(&bytes)?; + let body: models::GuestAgent = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6325,8 +6625,8 @@ pub mod sql_availability_group_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_database_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) guest_agent_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6338,12 +6638,12 @@ pub mod sql_availability_group_databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/guestAgents/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name, - &this.sql_availability_group_database_name + &this.virtual_machine_name, + &this.guest_agent_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); @@ -6354,7 +6654,7 @@ pub mod sql_availability_group_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6363,8 +6663,8 @@ pub mod sql_availability_group_databases { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6379,9 +6679,9 @@ pub mod sql_availability_group_databases { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupDatabaseResource = serde_json::from_slice(&bytes)?; + let body: models::GuestAgent = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6420,108 +6720,17 @@ pub mod sql_availability_group_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_database_resource: models::SqlAvailabilityGroupDatabaseResource, - pub(crate) sql_availability_group_database_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) guest_agent_name: String, + pub(crate) body: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/databases/{}", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name, - &this.sql_availability_group_name, - &this.sql_availability_group_database_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_availability_group_database_resource)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + #[doc = "Request payload."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SqlAvailabilityGroupDatabaseResource = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_database_name: String, - pub(crate) sql_availability_group_name: String, - pub(crate) sql_availability_group_database_update: models::SqlAvailabilityGroupDatabaseUpdate, - } - impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6531,14 +6740,14 @@ pub mod sql_availability_group_databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/guestAgents/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name, - &this.sql_availability_group_database_name + &this.virtual_machine_name, + &this.guest_agent_name ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -6547,9 +6756,13 @@ pub mod sql_availability_group_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.sql_availability_group_database_update)?; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -6557,8 +6770,8 @@ pub mod sql_availability_group_databases { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6591,10 +6804,11 @@ pub mod sql_availability_group_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_database_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, + pub(crate) guest_agent_name: String, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6604,12 +6818,12 @@ pub mod sql_availability_group_databases { let this = self.clone(); async move { let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/databases/{}", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/guestAgents/{}", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name, - &this.sql_availability_group_database_name + &this.virtual_machine_name, + &this.guest_agent_name ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); @@ -6620,7 +6834,7 @@ pub mod sql_availability_group_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6629,13 +6843,13 @@ pub mod sql_availability_group_databases { } } } - pub mod list { + pub mod list_by_vm { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ArcSqlAvailabilityGroupDatabasesListResult = serde_json::from_slice(&bytes)?; + let body: models::GuestAgentList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6674,19 +6888,19 @@ pub mod sql_availability_group_databases { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) sql_availability_group_name: String, + pub(crate) virtual_machine_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { let mut url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.AzureArcData/sqlAvailabilityGroups/{}/databases", + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ScVmm/virtualMachines/{}/guestAgents", this.client.endpoint(), &this.subscription_id, &this.resource_group_name, - &this.sql_availability_group_name + &this.virtual_machine_name ))?; let rsp = match continuation { Some(value) => { @@ -6704,7 +6918,7 @@ pub mod sql_availability_group_databases { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6720,7 +6934,7 @@ pub mod sql_availability_group_databases { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-03-15-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-21-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? diff --git a/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs b/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs new file mode 100644 index 0000000000..1c97a7cf83 --- /dev/null +++ b/services/mgmt/scvmm/src/package_2022_05_21_preview/models.rs @@ -0,0 +1,2659 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Allocation method."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "AllocationMethod")] +pub enum AllocationMethod { + Dynamic, + Static, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for AllocationMethod { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for AllocationMethod { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for AllocationMethod { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Dynamic => serializer.serialize_unit_variant("AllocationMethod", 0u32, "Dynamic"), + Self::Static => serializer.serialize_unit_variant("AllocationMethod", 1u32, "Static"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The AvailabilitySets resource definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AvailabilitySet { + #[doc = "Defines the resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Gets or sets the location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The extended location."] + #[serde(rename = "extendedLocation", default, skip_serializing_if = "Option::is_none")] + pub extended_location: Option, +} +impl AvailabilitySet { + pub fn new() -> Self { + Self::default() + } +} +pub type AvailabilitySetList = Vec; +#[doc = "List of AvailabilitySets."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AvailabilitySetListResult { + #[doc = "List of AvailabilitySets."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AvailabilitySetListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AvailabilitySetListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AvailabilitySetProperties { + #[doc = "Name of the availability set."] + #[serde(rename = "availabilitySetName", default, skip_serializing_if = "Option::is_none")] + pub availability_set_name: Option, + #[doc = "ARM Id of the vmmServer resource in which this resource resides."] + #[serde(rename = "vmmServerId", default, skip_serializing_if = "Option::is_none")] + pub vmm_server_id: Option, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl AvailabilitySetProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Checkpoint { + #[doc = "Gets ID of parent of the checkpoint."] + #[serde(rename = "parentCheckpointID", default, skip_serializing_if = "Option::is_none")] + pub parent_checkpoint_id: Option, + #[doc = "Gets ID of the checkpoint."] + #[serde(rename = "checkpointID", default, skip_serializing_if = "Option::is_none")] + pub checkpoint_id: Option, + #[doc = "Gets name of the checkpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Gets description of the checkpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl Checkpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Clouds resource definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Cloud { + #[doc = "Defines the resource properties."] + pub properties: CloudProperties, + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Gets or sets the location."] + pub location: String, + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The extended location."] + #[serde(rename = "extendedLocation")] + pub extended_location: ExtendedLocation, +} +impl Cloud { + pub fn new(properties: CloudProperties, location: String, extended_location: ExtendedLocation) -> Self { + Self { + properties, + id: None, + name: None, + type_: None, + location, + tags: None, + system_data: None, + extended_location, + } + } +} +#[doc = "Cloud Capacity model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudCapacity { + #[doc = "CPUCount specifies the maximum number of CPUs that can be allocated in the cloud."] + #[serde(rename = "cpuCount", default, skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[doc = "MemoryMB specifies a memory usage limit in megabytes."] + #[serde(rename = "memoryMB", default, skip_serializing_if = "Option::is_none")] + pub memory_mb: Option, + #[doc = "VMCount gives the max number of VMs that can be deployed in the cloud."] + #[serde(rename = "vmCount", default, skip_serializing_if = "Option::is_none")] + pub vm_count: Option, +} +impl CloudCapacity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Cloud inventory item."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudInventoryItem { + #[serde(flatten)] + pub inventory_item_properties: InventoryItemProperties, +} +impl CloudInventoryItem { + pub fn new(inventory_item_properties: InventoryItemProperties) -> Self { + Self { inventory_item_properties } + } +} +#[doc = "List of Clouds."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudListResult { + #[doc = "List of Clouds."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CloudListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CloudListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudProperties { + #[doc = "Gets or sets the inventory Item ID for the resource."] + #[serde(rename = "inventoryItemId", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_id: Option, + #[doc = "Unique ID of the cloud."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "ARM Id of the vmmServer resource in which this resource resides."] + #[serde(rename = "vmmServerId", default, skip_serializing_if = "Option::is_none")] + pub vmm_server_id: Option, + #[doc = "Name of the cloud in VMMServer."] + #[serde(rename = "cloudName", default, skip_serializing_if = "Option::is_none")] + pub cloud_name: Option, + #[doc = "Cloud Capacity model"] + #[serde(rename = "cloudCapacity", default, skip_serializing_if = "Option::is_none")] + pub cloud_capacity: Option, + #[doc = "List of QoS policies available for the cloud."] + #[serde( + rename = "storageQoSPolicies", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub storage_qo_s_policies: Vec, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl CloudProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDefinition { + #[doc = "Service specific error code which serves as the substatus for the HTTP error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Description of the error."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "Internal error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, +} +impl ErrorDefinition { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Error response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "Error definition."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The extended location."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExtendedLocation { + #[doc = "The extended location type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The extended location name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl ExtendedLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the GuestAgent."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GuestAgent { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Defines the resource properties."] + pub properties: GuestAgentProperties, +} +impl GuestAgent { + pub fn new(properties: GuestAgentProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + } + } +} +#[doc = "List of GuestAgent."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GuestAgentList { + #[doc = "Url to follow for getting next page of GuestAgent."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of GuestAgent"] + pub value: Vec, +} +impl azure_core::Continuable for GuestAgentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl GuestAgentList { + pub fn new(value: Vec) -> Self { + Self { next_link: None, value } + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GuestAgentProfile { + #[doc = "Specifies the VM's unique SMBIOS ID."] + #[serde(rename = "vmUuid", default, skip_serializing_if = "Option::is_none")] + pub vm_uuid: Option, + #[doc = "The status of the hybrid machine agent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The time of the last status change."] + #[serde(rename = "lastStatusChange", default, with = "azure_core::date::rfc3339::option")] + pub last_status_change: Option, + #[doc = "Gets or sets the Public Key provided by the client for enabling guest management."] + #[serde(rename = "clientPublicKey", default, skip_serializing_if = "Option::is_none")] + pub client_public_key: Option, + #[doc = "The hybrid machine agent full version."] + #[serde(rename = "agentVersion", default, skip_serializing_if = "Option::is_none")] + pub agent_version: Option, + #[doc = "Details about the error state."] + #[serde( + rename = "errorDetails", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub error_details: Vec, +} +impl GuestAgentProfile { + pub fn new() -> Self { + Self::default() + } +} +pub mod guest_agent_profile { + use super::*; + #[doc = "The status of the hybrid machine agent."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Connected, + Disconnected, + Error, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Connected => serializer.serialize_unit_variant("Status", 0u32, "Connected"), + Self::Disconnected => serializer.serialize_unit_variant("Status", 1u32, "Disconnected"), + Self::Error => serializer.serialize_unit_variant("Status", 2u32, "Error"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GuestAgentProperties { + #[doc = "Gets or sets a unique identifier for this resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "Username / Password Credentials to connect to guest."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credentials: Option, + #[doc = "HTTP Proxy configuration for the VM."] + #[serde(rename = "httpProxyConfig", default, skip_serializing_if = "Option::is_none")] + pub http_proxy_config: Option, + #[doc = "Defines the different types of operations for guest agent."] + #[serde(rename = "provisioningAction", default, skip_serializing_if = "Option::is_none")] + pub provisioning_action: Option, + #[doc = "Gets or sets the guest agent status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Gets the name of the corresponding resource in Kubernetes."] + #[serde(rename = "customResourceName", default, skip_serializing_if = "Option::is_none")] + pub custom_resource_name: Option, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl GuestAgentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Username / Password Credentials to connect to guest."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GuestCredential { + #[doc = "Gets or sets username to connect with the guest."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "Gets or sets the password to connect with the guest."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, +} +impl GuestCredential { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HardwareProfile { + #[doc = "MemoryMB is the size of a virtual machine's memory, in MB."] + #[serde(rename = "memoryMB", default, skip_serializing_if = "Option::is_none")] + pub memory_mb: Option, + #[doc = "Gets or sets the number of vCPUs for the vm."] + #[serde(rename = "cpuCount", default, skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[doc = "Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs."] + #[serde(rename = "limitCpuForMigration", default, skip_serializing_if = "Option::is_none")] + pub limit_cpu_for_migration: Option, + #[doc = "Gets or sets a value indicating whether to enable dynamic memory or not."] + #[serde(rename = "dynamicMemoryEnabled", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_enabled: Option, + #[doc = "Gets or sets the max dynamic memory for the vm."] + #[serde(rename = "dynamicMemoryMaxMB", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_max_mb: Option, + #[doc = "Gets or sets the min dynamic memory for the vm."] + #[serde(rename = "dynamicMemoryMinMB", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_min_mb: Option, + #[doc = "Gets highly available property."] + #[serde(rename = "isHighlyAvailable", default, skip_serializing_if = "Option::is_none")] + pub is_highly_available: Option, +} +impl HardwareProfile { + pub fn new() -> Self { + Self::default() + } +} +pub mod hardware_profile { + use super::*; + #[doc = "Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LimitCpuForMigration")] + pub enum LimitCpuForMigration { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LimitCpuForMigration { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LimitCpuForMigration { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LimitCpuForMigration { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("LimitCpuForMigration", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("LimitCpuForMigration", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Gets or sets a value indicating whether to enable dynamic memory or not."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DynamicMemoryEnabled")] + pub enum DynamicMemoryEnabled { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DynamicMemoryEnabled { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DynamicMemoryEnabled { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DynamicMemoryEnabled { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("DynamicMemoryEnabled", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("DynamicMemoryEnabled", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HardwareProfileUpdate { + #[doc = "MemoryMB is the size of a virtual machine's memory, in MB."] + #[serde(rename = "memoryMB", default, skip_serializing_if = "Option::is_none")] + pub memory_mb: Option, + #[doc = "Gets or sets the number of vCPUs for the vm."] + #[serde(rename = "cpuCount", default, skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[doc = "Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs."] + #[serde(rename = "limitCpuForMigration", default, skip_serializing_if = "Option::is_none")] + pub limit_cpu_for_migration: Option, + #[doc = "Gets or sets a value indicating whether to enable dynamic memory or not."] + #[serde(rename = "dynamicMemoryEnabled", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_enabled: Option, + #[doc = "Gets or sets the max dynamic memory for the vm."] + #[serde(rename = "dynamicMemoryMaxMB", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_max_mb: Option, + #[doc = "Gets or sets the min dynamic memory for the vm."] + #[serde(rename = "dynamicMemoryMinMB", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_min_mb: Option, +} +impl HardwareProfileUpdate { + pub fn new() -> Self { + Self::default() + } +} +pub mod hardware_profile_update { + use super::*; + #[doc = "Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LimitCpuForMigration")] + pub enum LimitCpuForMigration { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LimitCpuForMigration { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LimitCpuForMigration { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LimitCpuForMigration { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("LimitCpuForMigration", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("LimitCpuForMigration", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Gets or sets a value indicating whether to enable dynamic memory or not."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DynamicMemoryEnabled")] + pub enum DynamicMemoryEnabled { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DynamicMemoryEnabled { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DynamicMemoryEnabled { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DynamicMemoryEnabled { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("DynamicMemoryEnabled", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("DynamicMemoryEnabled", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "HTTP Proxy configuration for the VM."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HttpProxyConfiguration { + #[doc = "Gets or sets httpsProxy url."] + #[serde(rename = "httpsProxy", default, skip_serializing_if = "Option::is_none")] + pub https_proxy: Option, +} +impl HttpProxyConfiguration { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the HybridIdentityMetadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridIdentityMetadata { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Defines the resource properties."] + pub properties: HybridIdentityMetadataProperties, +} +impl HybridIdentityMetadata { + pub fn new(properties: HybridIdentityMetadataProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + } + } +} +#[doc = "List of HybridIdentityMetadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridIdentityMetadataList { + #[doc = "Url to follow for getting next page of HybridIdentityMetadata."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of HybridIdentityMetadata"] + pub value: Vec, +} +impl azure_core::Continuable for HybridIdentityMetadataList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl HybridIdentityMetadataList { + pub fn new(value: Vec) -> Self { + Self { next_link: None, value } + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct HybridIdentityMetadataProperties { + #[doc = "Gets or sets the Vm Id."] + #[serde(rename = "resourceUid", default, skip_serializing_if = "Option::is_none")] + pub resource_uid: Option, + #[doc = "Gets or sets the Public Key."] + #[serde(rename = "publicKey", default, skip_serializing_if = "Option::is_none")] + pub public_key: Option, + #[doc = "Managed service identity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl HybridIdentityMetadataProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Managed service identity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Identity { + #[doc = "The principal id of managed service identity."] + #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] + pub principal_id: Option, + #[doc = "The tenant of managed service identity."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The type of managed service identity."] + #[serde(rename = "type")] + pub type_: identity::Type, +} +impl Identity { + pub fn new(type_: identity::Type) -> Self { + Self { + principal_id: None, + tenant_id: None, + type_, + } + } +} +pub mod identity { + use super::*; + #[doc = "The type of managed service identity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + None, + SystemAssigned, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("Type", 0u32, "None"), + Self::SystemAssigned => serializer.serialize_unit_variant("Type", 1u32, "SystemAssigned"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Defines the inventory item."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InventoryItem { + #[serde(flatten)] + pub proxy_resource: ProxyResource, + #[doc = "Defines the resource properties."] + pub properties: InventoryItemProperties, + #[doc = "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl InventoryItem { + pub fn new(properties: InventoryItemProperties) -> Self { + Self { + proxy_resource: ProxyResource::default(), + properties, + kind: None, + } + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InventoryItemDetails { + #[doc = "Gets or sets the inventory Item ID for the resource."] + #[serde(rename = "inventoryItemId", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_id: Option, + #[doc = "Gets or sets the Managed Object name in VMM for the resource."] + #[serde(rename = "inventoryItemName", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_name: Option, +} +impl InventoryItemDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InventoryItemProperties { + #[doc = "The inventory type."] + #[serde(rename = "inventoryType")] + pub inventory_type: InventoryType, + #[doc = "Gets the tracked resource id corresponding to the inventory resource."] + #[serde(rename = "managedResourceId", default, skip_serializing_if = "Option::is_none")] + pub managed_resource_id: Option, + #[doc = "Gets the UUID (which is assigned by VMM) for the inventory item."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "Gets the Managed Object name in VMM for the inventory item."] + #[serde(rename = "inventoryItemName", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_name: Option, + #[doc = "Gets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl InventoryItemProperties { + pub fn new(inventory_type: InventoryType) -> Self { + Self { + inventory_type, + managed_resource_id: None, + uuid: None, + inventory_item_name: None, + provisioning_state: None, + } + } +} +#[doc = "List of InventoryItems."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InventoryItemsList { + #[doc = "Url to follow for getting next page of InventoryItems."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of InventoryItems"] + pub value: Vec, +} +impl azure_core::Continuable for InventoryItemsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl InventoryItemsList { + pub fn new(value: Vec) -> Self { + Self { next_link: None, value } + } +} +#[doc = "The inventory type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "InventoryType")] +pub enum InventoryType { + Cloud, + VirtualNetwork, + VirtualMachineTemplate, + VirtualMachine, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for InventoryType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for InventoryType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for InventoryType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Cloud => serializer.serialize_unit_variant("InventoryType", 0u32, "Cloud"), + Self::VirtualNetwork => serializer.serialize_unit_variant("InventoryType", 1u32, "VirtualNetwork"), + Self::VirtualMachineTemplate => serializer.serialize_unit_variant("InventoryType", 2u32, "VirtualMachineTemplate"), + Self::VirtualMachine => serializer.serialize_unit_variant("InventoryType", 3u32, "VirtualMachine"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Describes a Machine Extension."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MachineExtension { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Describes the properties of a Machine Extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MachineExtension { + pub fn new(tracked_resource: TrackedResource) -> Self { + Self { + tracked_resource, + properties: None, + } + } +} +#[doc = "Describes the Machine Extension Instance View."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MachineExtensionInstanceView { + #[doc = "The machine extension name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Specifies the type of the extension; an example is \"CustomScriptExtension\"."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Specifies the version of the script handler."] + #[serde(rename = "typeHandlerVersion", default, skip_serializing_if = "Option::is_none")] + pub type_handler_version: Option, + #[doc = "Instance view status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl MachineExtensionInstanceView { + pub fn new() -> Self { + Self::default() + } +} +pub mod machine_extension_instance_view { + use super::*; + #[doc = "Instance view status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Status { + #[doc = "The status code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The level code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option, + #[doc = "The short localizable label for the status."] + #[serde(rename = "displayStatus", default, skip_serializing_if = "Option::is_none")] + pub display_status: Option, + #[doc = "The detailed status message, including for alerts and error messages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The time of the status."] + #[serde(default, with = "azure_core::date::rfc3339::option")] + pub time: Option, + } + impl Status { + pub fn new() -> Self { + Self::default() + } + } + pub mod status { + use super::*; + #[doc = "The level code."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Level")] + pub enum Level { + Info, + Warning, + Error, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Level { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Level { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Level { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Info => serializer.serialize_unit_variant("Level", 0u32, "Info"), + Self::Warning => serializer.serialize_unit_variant("Level", 1u32, "Warning"), + Self::Error => serializer.serialize_unit_variant("Level", 2u32, "Error"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "Describes the properties of a Machine Extension."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MachineExtensionProperties { + #[doc = "How the extension handler should be forced to update even if the extension configuration has not changed."] + #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] + pub force_update_tag: Option, + #[doc = "The name of the extension handler publisher."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "Specifies the type of the extension; an example is \"CustomScriptExtension\"."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Specifies the version of the script handler."] + #[serde(rename = "typeHandlerVersion", default, skip_serializing_if = "Option::is_none")] + pub type_handler_version: Option, + #[doc = "Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available."] + #[serde(rename = "enableAutomaticUpgrade", default, skip_serializing_if = "Option::is_none")] + pub enable_automatic_upgrade: Option, + #[doc = "Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true."] + #[serde(rename = "autoUpgradeMinorVersion", default, skip_serializing_if = "Option::is_none")] + pub auto_upgrade_minor_version: Option, + #[doc = "Json formatted public settings for the extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option, + #[doc = "The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all."] + #[serde(rename = "protectedSettings", default, skip_serializing_if = "Option::is_none")] + pub protected_settings: Option, + #[doc = "The provisioning state, which only appears in the response."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, + #[doc = "The machine extension instance view."] + #[serde(rename = "instanceView", default, skip_serializing_if = "Option::is_none")] + pub instance_view: Option, +} +impl MachineExtensionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes a Machine Extension Update."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MachineExtensionUpdate { + #[serde(flatten)] + pub resource_patch: ResourcePatch, + #[doc = "Describes the properties of a Machine Extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MachineExtensionUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the properties of a Machine Extension."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MachineExtensionUpdateProperties { + #[doc = "How the extension handler should be forced to update even if the extension configuration has not changed."] + #[serde(rename = "forceUpdateTag", default, skip_serializing_if = "Option::is_none")] + pub force_update_tag: Option, + #[doc = "The name of the extension handler publisher."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub publisher: Option, + #[doc = "Specifies the type of the extension; an example is \"CustomScriptExtension\"."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Specifies the version of the script handler."] + #[serde(rename = "typeHandlerVersion", default, skip_serializing_if = "Option::is_none")] + pub type_handler_version: Option, + #[doc = "Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available."] + #[serde(rename = "enableAutomaticUpgrade", default, skip_serializing_if = "Option::is_none")] + pub enable_automatic_upgrade: Option, + #[doc = "Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true."] + #[serde(rename = "autoUpgradeMinorVersion", default, skip_serializing_if = "Option::is_none")] + pub auto_upgrade_minor_version: Option, + #[doc = "Json formatted public settings for the extension."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub settings: Option, + #[doc = "The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all."] + #[serde(rename = "protectedSettings", default, skip_serializing_if = "Option::is_none")] + pub protected_settings: Option, +} +impl MachineExtensionUpdateProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the Machine Extensions List Result."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MachineExtensionsListResult { + #[doc = "The list of extensions"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The uri to fetch the next page of machine extensions. Call ListNext() with this to fetch the next page of extensions."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for MachineExtensionsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl MachineExtensionsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Network Interface model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkInterfaces { + #[doc = "Gets or sets the name of the network interface."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Gets the display name of the network interface as shown in the vmmServer. This is the fallback label for a NIC when the name is not set."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Gets or sets the nic ipv4 addresses."] + #[serde( + rename = "ipv4Addresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ipv4_addresses: Vec, + #[doc = "Gets or sets the nic ipv6 addresses."] + #[serde( + rename = "ipv6Addresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ipv6_addresses: Vec, + #[doc = "Gets or sets the nic MAC address."] + #[serde(rename = "macAddress", default, skip_serializing_if = "Option::is_none")] + pub mac_address: Option, + #[doc = "Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic."] + #[serde(rename = "virtualNetworkId", default, skip_serializing_if = "Option::is_none")] + pub virtual_network_id: Option, + #[doc = "Gets or sets the name of the virtual network in vmmServer that the nic is connected to."] + #[serde(rename = "networkName", default, skip_serializing_if = "Option::is_none")] + pub network_name: Option, + #[doc = "Allocation method."] + #[serde(rename = "ipv4AddressType", default, skip_serializing_if = "Option::is_none")] + pub ipv4_address_type: Option, + #[doc = "Allocation method."] + #[serde(rename = "ipv6AddressType", default, skip_serializing_if = "Option::is_none")] + pub ipv6_address_type: Option, + #[doc = "Allocation method."] + #[serde(rename = "macAddressType", default, skip_serializing_if = "Option::is_none")] + pub mac_address_type: Option, + #[doc = "Gets or sets the nic id."] + #[serde(rename = "nicId", default, skip_serializing_if = "Option::is_none")] + pub nic_id: Option, +} +impl NetworkInterfaces { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Network Interface model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkInterfacesUpdate { + #[doc = "Gets or sets the name of the network interface."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Gets or sets the nic MAC address."] + #[serde(rename = "macAddress", default, skip_serializing_if = "Option::is_none")] + pub mac_address: Option, + #[doc = "Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic."] + #[serde(rename = "virtualNetworkId", default, skip_serializing_if = "Option::is_none")] + pub virtual_network_id: Option, + #[doc = "Allocation method."] + #[serde(rename = "ipv4AddressType", default, skip_serializing_if = "Option::is_none")] + pub ipv4_address_type: Option, + #[doc = "Allocation method."] + #[serde(rename = "ipv6AddressType", default, skip_serializing_if = "Option::is_none")] + pub ipv6_address_type: Option, + #[doc = "Allocation method."] + #[serde(rename = "macAddressType", default, skip_serializing_if = "Option::is_none")] + pub mac_address_type: Option, + #[doc = "Gets or sets the nic id."] + #[serde(rename = "nicId", default, skip_serializing_if = "Option::is_none")] + pub nic_id: Option, +} +impl NetworkInterfacesUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkProfile { + #[doc = "Gets or sets the list of network interfaces associated with the virtual machine."] + #[serde( + rename = "networkInterfaces", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_interfaces: Vec, +} +impl NetworkProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct NetworkProfileUpdate { + #[doc = "Gets or sets the list of network interfaces associated with the virtual machine."] + #[serde( + rename = "networkInterfaces", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_interfaces: Vec, +} +impl NetworkProfileUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OsProfile { + #[doc = "Admin password of the virtual machine."] + #[serde(rename = "adminPassword", default, skip_serializing_if = "Option::is_none")] + pub admin_password: Option, + #[doc = "Gets or sets computer name."] + #[serde(rename = "computerName", default, skip_serializing_if = "Option::is_none")] + pub computer_name: Option, + #[doc = "Defines the different types of VM guest operating systems."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Gets or sets os name."] + #[serde(rename = "osName", default, skip_serializing_if = "Option::is_none")] + pub os_name: Option, +} +impl OsProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the different types of VM guest operating systems."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "OsType")] +pub enum OsType { + Windows, + Linux, + Other, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for OsType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for OsType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for OsType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Windows => serializer.serialize_unit_variant("OsType", 0u32, "Windows"), + Self::Linux => serializer.serialize_unit_variant("OsType", 1u32, "Linux"), + Self::Other => serializer.serialize_unit_variant("OsType", 2u32, "Other"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Defines the different types of operations for guest agent."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ProvisioningAction")] +pub enum ProvisioningAction { + #[serde(rename = "install")] + Install, + #[serde(rename = "uninstall")] + Uninstall, + #[serde(rename = "repair")] + Repair, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ProvisioningAction { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ProvisioningAction { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ProvisioningAction { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Install => serializer.serialize_unit_variant("ProvisioningAction", 0u32, "install"), + Self::Uninstall => serializer.serialize_unit_variant("ProvisioningAction", 1u32, "uninstall"), + Self::Repair => serializer.serialize_unit_variant("ProvisioningAction", 2u32, "repair"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyResource { + #[serde(flatten)] + pub resource: Resource, +} +impl ProxyResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Object containing tags updates for patch operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourcePatch { + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl ResourcePatch { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Results of the request to list operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceProviderOperation { + #[doc = "Indicates whether the operation applies to data-plane."] + #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")] + pub is_data_action: Option, + #[doc = "Operation name, in format of {provider}/{resource}/{operation}."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Display metadata associated with the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl ResourceProviderOperation { + pub fn new() -> Self { + Self::default() + } +} +pub mod resource_provider_operation { + use super::*; + #[doc = "Display metadata associated with the operation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Display { + #[doc = "The resource provider."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "Resource on which the operation is performed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "Type of operation: read, write, delete, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "Description of this operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + } + impl Display { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Results of the request to list operations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ResourceProviderOperationList { + #[doc = "List of Operations."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ResourceProviderOperationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ResourceProviderOperationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the stop action properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StopVirtualMachineOptions { + #[doc = "Gets or sets a value indicating whether to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Defaults to false."] + #[serde(rename = "skipShutdown", default, skip_serializing_if = "Option::is_none")] + pub skip_shutdown: Option, +} +impl StopVirtualMachineOptions { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageProfile { + #[doc = "Gets or sets the list of virtual disks associated with the virtual machine."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub disks: Vec, +} +impl StorageProfile { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageProfileUpdate { + #[doc = "Gets or sets the list of virtual disks associated with the virtual machine."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub disks: Vec, +} +impl StorageProfileUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The StorageQoSPolicy definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageQoSPolicy { + #[doc = "The name of the policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The ID of the QoS policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The maximum IO operations per second."] + #[serde(rename = "iopsMaximum", default, skip_serializing_if = "Option::is_none")] + pub iops_maximum: Option, + #[doc = "The minimum IO operations per second."] + #[serde(rename = "iopsMinimum", default, skip_serializing_if = "Option::is_none")] + pub iops_minimum: Option, + #[doc = "The Bandwidth Limit for internet traffic."] + #[serde(rename = "bandwidthLimit", default, skip_serializing_if = "Option::is_none")] + pub bandwidth_limit: Option, + #[doc = "The underlying policy."] + #[serde(rename = "policyId", default, skip_serializing_if = "Option::is_none")] + pub policy_id: Option, +} +impl StorageQoSPolicy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The StorageQoSPolicyDetails definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct StorageQoSPolicyDetails { + #[doc = "The name of the policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The ID of the QoS policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl StorageQoSPolicyDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The geo-location where the resource lives"] + pub location: String, +} +impl TrackedResource { + pub fn new(location: String) -> Self { + Self { + resource: Resource::default(), + tags: None, + location, + } + } +} +#[doc = "The VmmServers resource definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VmmServer { + #[doc = "Defines the resource properties."] + pub properties: VmmServerProperties, + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Gets or sets the location."] + pub location: String, + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The extended location."] + #[serde(rename = "extendedLocation")] + pub extended_location: ExtendedLocation, +} +impl VmmServer { + pub fn new(properties: VmmServerProperties, location: String, extended_location: ExtendedLocation) -> Self { + Self { + properties, + id: None, + name: None, + type_: None, + location, + tags: None, + system_data: None, + extended_location, + } + } +} +#[doc = "List of VmmServers."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VmmServerListResult { + #[doc = "List of VmmServers."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for VmmServerListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl VmmServerListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VmmServerProperties { + #[doc = "Credentials to connect to VMMServer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub credentials: Option, + #[doc = "Fqdn is the hostname/ip of the vmmServer."] + pub fqdn: String, + #[doc = "Port is the port on which the vmmServer is listening."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + #[doc = "Gets or sets the connection status to the vmmServer."] + #[serde(rename = "connectionStatus", default, skip_serializing_if = "Option::is_none")] + pub connection_status: Option, + #[doc = "Gets or sets any error message if connection to vmmServer is having any issue."] + #[serde(rename = "errorMessage", default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[doc = "Unique ID of vmmServer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "Version is the version of the vmmSever."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl VmmServerProperties { + pub fn new(fqdn: String) -> Self { + Self { + credentials: None, + fqdn, + port: None, + connection_status: None, + error_message: None, + uuid: None, + version: None, + provisioning_state: None, + } + } +} +pub mod vmm_server_properties { + use super::*; + #[doc = "Credentials to connect to VMMServer."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Credentials { + #[doc = "Username to use to connect to VMMServer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "Credentials to use to connect to VMMServer."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password: Option, + } + impl Credentials { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Virtual disk model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualDisk { + #[doc = "Gets or sets the name of the disk."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Gets the display name of the virtual disk as shown in the vmmServer. This is the fallback label for a disk when the name is not set."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Gets or sets the disk id."] + #[serde(rename = "diskId", default, skip_serializing_if = "Option::is_none")] + pub disk_id: Option, + #[doc = "Gets or sets the disk total size."] + #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] + pub disk_size_gb: Option, + #[doc = "Gets or sets the max disk size."] + #[serde(rename = "maxDiskSizeGB", default, skip_serializing_if = "Option::is_none")] + pub max_disk_size_gb: Option, + #[doc = "Gets or sets the disk bus."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bus: Option, + #[doc = "Gets or sets the disk lun."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lun: Option, + #[doc = "Gets or sets the disk bus type."] + #[serde(rename = "busType", default, skip_serializing_if = "Option::is_none")] + pub bus_type: Option, + #[doc = "Gets or sets the disk vhd type."] + #[serde(rename = "vhdType", default, skip_serializing_if = "Option::is_none")] + pub vhd_type: Option, + #[doc = "Gets or sets the disk volume type."] + #[serde(rename = "volumeType", default, skip_serializing_if = "Option::is_none")] + pub volume_type: Option, + #[doc = "Gets the disk vhd format type."] + #[serde(rename = "vhdFormatType", default, skip_serializing_if = "Option::is_none")] + pub vhd_format_type: Option, + #[doc = "Gets or sets the disk id in the template."] + #[serde(rename = "templateDiskId", default, skip_serializing_if = "Option::is_none")] + pub template_disk_id: Option, + #[doc = "The StorageQoSPolicyDetails definition."] + #[serde(rename = "storageQoSPolicy", default, skip_serializing_if = "Option::is_none")] + pub storage_qo_s_policy: Option, + #[doc = "Gets or sets a value indicating diff disk."] + #[serde(rename = "createDiffDisk", default, skip_serializing_if = "Option::is_none")] + pub create_diff_disk: Option, +} +impl VirtualDisk { + pub fn new() -> Self { + Self::default() + } +} +pub mod virtual_disk { + use super::*; + #[doc = "Gets or sets a value indicating diff disk."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreateDiffDisk")] + pub enum CreateDiffDisk { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreateDiffDisk { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreateDiffDisk { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreateDiffDisk { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("CreateDiffDisk", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("CreateDiffDisk", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Virtual disk model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualDiskUpdate { + #[doc = "Gets or sets the name of the disk."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Gets or sets the disk id."] + #[serde(rename = "diskId", default, skip_serializing_if = "Option::is_none")] + pub disk_id: Option, + #[doc = "Gets or sets the disk total size."] + #[serde(rename = "diskSizeGB", default, skip_serializing_if = "Option::is_none")] + pub disk_size_gb: Option, + #[doc = "Gets or sets the disk bus."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bus: Option, + #[doc = "Gets or sets the disk lun."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lun: Option, + #[doc = "Gets or sets the disk bus type."] + #[serde(rename = "busType", default, skip_serializing_if = "Option::is_none")] + pub bus_type: Option, + #[doc = "Gets or sets the disk vhd type."] + #[serde(rename = "vhdType", default, skip_serializing_if = "Option::is_none")] + pub vhd_type: Option, + #[doc = "The StorageQoSPolicyDetails definition."] + #[serde(rename = "storageQoSPolicy", default, skip_serializing_if = "Option::is_none")] + pub storage_qo_s_policy: Option, +} +impl VirtualDiskUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The VirtualMachines resource definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachine { + #[doc = "Defines the resource properties."] + pub properties: VirtualMachineProperties, + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Gets or sets the location."] + pub location: String, + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The extended location."] + #[serde(rename = "extendedLocation")] + pub extended_location: ExtendedLocation, + #[doc = "Managed service identity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl VirtualMachine { + pub fn new(properties: VirtualMachineProperties, location: String, extended_location: ExtendedLocation) -> Self { + Self { + properties, + id: None, + name: None, + type_: None, + location, + tags: None, + system_data: None, + extended_location, + identity: None, + } + } +} +#[doc = "Defines the create checkpoint action properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineCreateCheckpoint { + #[doc = "Name of the checkpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Description of the checkpoint."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl VirtualMachineCreateCheckpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the delete checkpoint action properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineDeleteCheckpoint { + #[doc = "ID of the checkpoint to be deleted."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl VirtualMachineDeleteCheckpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Virtual machine inventory item."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineInventoryItem { + #[serde(flatten)] + pub inventory_item_properties: InventoryItemProperties, + #[doc = "Defines the different types of VM guest operating systems."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Gets or sets os name."] + #[serde(rename = "osName", default, skip_serializing_if = "Option::is_none")] + pub os_name: Option, + #[doc = "Gets the power state of the virtual machine."] + #[serde(rename = "powerState", default, skip_serializing_if = "Option::is_none")] + pub power_state: Option, + #[doc = "Gets or sets the nic ip addresses."] + #[serde( + rename = "ipAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ip_addresses: Vec, + #[doc = "Defines the resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cloud: Option, +} +impl VirtualMachineInventoryItem { + pub fn new(inventory_item_properties: InventoryItemProperties) -> Self { + Self { + inventory_item_properties, + os_type: None, + os_name: None, + power_state: None, + ip_addresses: Vec::new(), + cloud: None, + } + } +} +#[doc = "List of VirtualMachines."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineListResult { + #[doc = "List of VirtualMachines."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for VirtualMachineListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl VirtualMachineListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineProperties { + #[doc = "Gets or sets the inventory Item ID for the resource."] + #[serde(rename = "inventoryItemId", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_id: Option, + #[doc = "ARM Id of the vmmServer resource in which this resource resides."] + #[serde(rename = "vmmServerId", default, skip_serializing_if = "Option::is_none")] + pub vmm_server_id: Option, + #[doc = "ARM Id of the cloud resource to use for deploying the vm."] + #[serde(rename = "cloudId", default, skip_serializing_if = "Option::is_none")] + pub cloud_id: Option, + #[doc = "ARM Id of the template resource to use for deploying the vm."] + #[serde(rename = "templateId", default, skip_serializing_if = "Option::is_none")] + pub template_id: Option, + #[doc = "Type of checkpoint supported for the vm."] + #[serde(rename = "checkpointType", default, skip_serializing_if = "Option::is_none")] + pub checkpoint_type: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "lastRestoredVMCheckpoint", default, skip_serializing_if = "Option::is_none")] + pub last_restored_vm_checkpoint: Option, + #[doc = "Checkpoints in the vm."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub checkpoints: Vec, + #[doc = "Availability Sets in vm."] + #[serde(rename = "availabilitySets", default, skip_serializing_if = "Option::is_none")] + pub availability_sets: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "osProfile", default, skip_serializing_if = "Option::is_none")] + pub os_profile: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "hardwareProfile", default, skip_serializing_if = "Option::is_none")] + pub hardware_profile: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "networkProfile", default, skip_serializing_if = "Option::is_none")] + pub network_profile: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "storageProfile", default, skip_serializing_if = "Option::is_none")] + pub storage_profile: Option, + #[doc = "VMName is the name of VM on the SCVMM server."] + #[serde(rename = "vmName", default, skip_serializing_if = "Option::is_none")] + pub vm_name: Option, + #[doc = "Unique ID of the virtual machine."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "Gets or sets the generation for the vm."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub generation: Option, + #[doc = "Gets the power state of the virtual machine."] + #[serde(rename = "powerState", default, skip_serializing_if = "Option::is_none")] + pub power_state: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "guestAgentProfile", default, skip_serializing_if = "Option::is_none")] + pub guest_agent_profile: Option, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl VirtualMachineProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the restore checkpoint action properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineRestoreCheckpoint { + #[doc = "ID of the checkpoint to be restored to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl VirtualMachineRestoreCheckpoint { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The VirtualMachineTemplates resource definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineTemplate { + #[doc = "Defines the resource properties."] + pub properties: VirtualMachineTemplateProperties, + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Gets or sets the location."] + pub location: String, + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The extended location."] + #[serde(rename = "extendedLocation")] + pub extended_location: ExtendedLocation, +} +impl VirtualMachineTemplate { + pub fn new(properties: VirtualMachineTemplateProperties, location: String, extended_location: ExtendedLocation) -> Self { + Self { + properties, + id: None, + name: None, + type_: None, + location, + tags: None, + system_data: None, + extended_location, + } + } +} +#[doc = "The Virtual machine template inventory item."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualMachineTemplateInventoryItem { + #[serde(flatten)] + pub inventory_item_properties: InventoryItemProperties, + #[doc = "Gets or sets the desired number of vCPUs for the vm."] + #[serde(rename = "cpuCount", default, skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[doc = "MemoryMB is the desired size of a virtual machine's memory, in MB."] + #[serde(rename = "memoryMB", default, skip_serializing_if = "Option::is_none")] + pub memory_mb: Option, + #[doc = "Defines the different types of VM guest operating systems."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Gets or sets os name."] + #[serde(rename = "osName", default, skip_serializing_if = "Option::is_none")] + pub os_name: Option, +} +impl VirtualMachineTemplateInventoryItem { + pub fn new(inventory_item_properties: InventoryItemProperties) -> Self { + Self { + inventory_item_properties, + cpu_count: None, + memory_mb: None, + os_type: None, + os_name: None, + } + } +} +#[doc = "List of VirtualMachineTemplates."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineTemplateListResult { + #[doc = "List of VirtualMachineTemplates."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for VirtualMachineTemplateListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl VirtualMachineTemplateListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineTemplateProperties { + #[doc = "Gets or sets the inventory Item ID for the resource."] + #[serde(rename = "inventoryItemId", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_id: Option, + #[doc = "Unique ID of the virtual machine template."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "ARM Id of the vmmServer resource in which this resource resides."] + #[serde(rename = "vmmServerId", default, skip_serializing_if = "Option::is_none")] + pub vmm_server_id: Option, + #[doc = "Defines the different types of VM guest operating systems."] + #[serde(rename = "osType", default, skip_serializing_if = "Option::is_none")] + pub os_type: Option, + #[doc = "Gets or sets os name."] + #[serde(rename = "osName", default, skip_serializing_if = "Option::is_none")] + pub os_name: Option, + #[doc = "Gets or sets computer name."] + #[serde(rename = "computerName", default, skip_serializing_if = "Option::is_none")] + pub computer_name: Option, + #[doc = "MemoryMB is the desired size of a virtual machine's memory, in MB."] + #[serde(rename = "memoryMB", default, skip_serializing_if = "Option::is_none")] + pub memory_mb: Option, + #[doc = "Gets or sets the desired number of vCPUs for the vm."] + #[serde(rename = "cpuCount", default, skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[doc = "Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs."] + #[serde(rename = "limitCpuForMigration", default, skip_serializing_if = "Option::is_none")] + pub limit_cpu_for_migration: Option, + #[doc = "Gets or sets a value indicating whether to enable dynamic memory or not."] + #[serde(rename = "dynamicMemoryEnabled", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_enabled: Option, + #[doc = "Gets or sets a value indicating whether the vm template is customizable or not."] + #[serde(rename = "isCustomizable", default, skip_serializing_if = "Option::is_none")] + pub is_customizable: Option, + #[doc = "Gets or sets the max dynamic memory for the vm."] + #[serde(rename = "dynamicMemoryMaxMB", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_max_mb: Option, + #[doc = "Gets or sets the min dynamic memory for the vm."] + #[serde(rename = "dynamicMemoryMinMB", default, skip_serializing_if = "Option::is_none")] + pub dynamic_memory_min_mb: Option, + #[doc = "Gets highly available property."] + #[serde(rename = "isHighlyAvailable", default, skip_serializing_if = "Option::is_none")] + pub is_highly_available: Option, + #[doc = "Gets or sets the generation for the vm."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub generation: Option, + #[doc = "Gets or sets the network interfaces of the template."] + #[serde( + rename = "networkInterfaces", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_interfaces: Vec, + #[doc = "Gets or sets the disks of the template."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub disks: Vec, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl VirtualMachineTemplateProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod virtual_machine_template_properties { + use super::*; + #[doc = "Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LimitCpuForMigration")] + pub enum LimitCpuForMigration { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LimitCpuForMigration { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LimitCpuForMigration { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LimitCpuForMigration { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("LimitCpuForMigration", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("LimitCpuForMigration", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Gets or sets a value indicating whether to enable dynamic memory or not."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "DynamicMemoryEnabled")] + pub enum DynamicMemoryEnabled { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for DynamicMemoryEnabled { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for DynamicMemoryEnabled { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for DynamicMemoryEnabled { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("DynamicMemoryEnabled", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("DynamicMemoryEnabled", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Gets or sets a value indicating whether the vm template is customizable or not."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsCustomizable")] + pub enum IsCustomizable { + #[serde(rename = "false")] + False, + #[serde(rename = "true")] + True, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsCustomizable { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsCustomizable { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsCustomizable { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::False => serializer.serialize_unit_variant("IsCustomizable", 0u32, "false"), + Self::True => serializer.serialize_unit_variant("IsCustomizable", 1u32, "true"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Defines the virtualMachineUpdate."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineUpdate { + #[doc = "Defines the resource properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Gets or sets the Resource tags."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Managed service identity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, +} +impl VirtualMachineUpdate { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualMachineUpdateProperties { + #[doc = "Defines the resource properties."] + #[serde(rename = "hardwareProfile", default, skip_serializing_if = "Option::is_none")] + pub hardware_profile: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "storageProfile", default, skip_serializing_if = "Option::is_none")] + pub storage_profile: Option, + #[doc = "Defines the resource properties."] + #[serde(rename = "networkProfile", default, skip_serializing_if = "Option::is_none")] + pub network_profile: Option, + #[doc = "Availability Sets in vm."] + #[serde(rename = "availabilitySets", default, skip_serializing_if = "Option::is_none")] + pub availability_sets: Option, + #[doc = "Type of checkpoint supported for the vm."] + #[serde(rename = "checkpointType", default, skip_serializing_if = "Option::is_none")] + pub checkpoint_type: Option, +} +impl VirtualMachineUpdateProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The VirtualNetworks resource definition."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualNetwork { + #[doc = "Defines the resource properties."] + pub properties: VirtualNetworkProperties, + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource Name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource Type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Gets or sets the location."] + pub location: String, + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "The extended location."] + #[serde(rename = "extendedLocation")] + pub extended_location: ExtendedLocation, +} +impl VirtualNetwork { + pub fn new(properties: VirtualNetworkProperties, location: String, extended_location: ExtendedLocation) -> Self { + Self { + properties, + id: None, + name: None, + type_: None, + location, + tags: None, + system_data: None, + extended_location, + } + } +} +#[doc = "The Virtual network inventory item."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VirtualNetworkInventoryItem { + #[serde(flatten)] + pub inventory_item_properties: InventoryItemProperties, +} +impl VirtualNetworkInventoryItem { + pub fn new(inventory_item_properties: InventoryItemProperties) -> Self { + Self { inventory_item_properties } + } +} +#[doc = "List of VirtualNetworks."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualNetworkListResult { + #[doc = "List of VirtualNetworks."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "Url to follow for getting next page of resources."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for VirtualNetworkListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl VirtualNetworkListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Defines the resource properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VirtualNetworkProperties { + #[doc = "Gets or sets the inventory Item ID for the resource."] + #[serde(rename = "inventoryItemId", default, skip_serializing_if = "Option::is_none")] + pub inventory_item_id: Option, + #[doc = "Unique ID of the virtual network."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uuid: Option, + #[doc = "ARM Id of the vmmServer resource in which this resource resides."] + #[serde(rename = "vmmServerId", default, skip_serializing_if = "Option::is_none")] + pub vmm_server_id: Option, + #[doc = "Name of the virtual network in vmmServer."] + #[serde(rename = "networkName", default, skip_serializing_if = "Option::is_none")] + pub network_name: Option, + #[doc = "Gets or sets the provisioning state."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl VirtualNetworkProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/search/src/package_2022_09/models.rs b/services/mgmt/search/src/package_2022_09/models.rs index 947ad1acb1..b31c6fc3d3 100644 --- a/services/mgmt/search/src/package_2022_09/models.rs +++ b/services/mgmt/search/src/package_2022_09/models.rs @@ -819,8 +819,6 @@ pub mod search_service_properties { Disabled, #[serde(rename = "error")] Error, - #[serde(rename = "stopped")] - Stopped, } #[doc = "The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/services/mgmt/security/Cargo.toml b/services/mgmt/security/Cargo.toml index 1d5b138cfd..3efa326f49 100644 --- a/services/mgmt/security/Cargo.toml +++ b/services/mgmt/security/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-03", "enable_reqwest"] +default = ["package-dotnet-sdk", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] -"package-preview-2023-03" = [] -"package-preview-2023-02" = [] -"package-preview-2022-11" = [] -"package-preview-2022-08" = [] -"package-preview-2022-07" = [] \ No newline at end of file +"package-dotnet-sdk" = [] +"package-composite-v2" = [] +"package-composite-v1" = [] +"package-2023-01" = [] +"package-2022-05" = [] \ No newline at end of file diff --git a/services/mgmt/security/README.md b/services/mgmt/security/README.md index 1e174e6f70..7bc61413f1 100644 --- a/services/mgmt/security/README.md +++ b/services/mgmt/security/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/security/r To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-03`. +The default tag is `package-dotnet-sdk`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: -- `package-preview-2023-03` has 10 operations from 2 API versions: `2023-01-01-preview`, `2023-03-01-preview`. Use crate feature `package-preview-2023-03` to enable. The operations will be in the `package_preview_2023_03` module. -- `package-preview-2023-02` has 11 operations from 1 API versions: `2023-02-01-preview`. Use crate feature `package-preview-2023-02` to enable. The operations will be in the `package_preview_2023_02` module. -- `package-preview-2022-11` has 4 operations from 1 API versions: `2022-11-20-preview`. Use crate feature `package-preview-2022-11` to enable. The operations will be in the `package_preview_2022_11` module. -- `package-preview-2022-08` has 6 operations from 1 API versions: `2022-08-01-preview`. Use crate feature `package-preview-2022-08` to enable. The operations will be in the `package_preview_2022_08` module. -- `package-preview-2022-07` has 8 operations from 1 API versions: `2022-07-01-preview`. Use crate feature `package-preview-2022-07` to enable. The operations will be in the `package_preview_2022_07` module. \ No newline at end of file +- `package-dotnet-sdk` has 197 operations from 20 API versions: `2015-06-01-preview`, `2017-08-01`, `2017-08-01-preview`, `2019-01-01`, `2019-01-01-preview`, `2019-08-01`, `2020-01-01`, `2020-01-01-preview`, `2021-01-15-preview`, `2021-05-01-preview`, `2021-06-01`, `2021-07-01-preview`, `2021-10-01-preview`, `2022-01-01`, `2022-01-01-preview`, `2022-03-01`, `2022-05-01`, `2022-07-01-preview`, `2022-08-01-preview`, `2023-02-01-preview`. Use crate feature `package-dotnet-sdk` to enable. The operations will be in the `package_dotnet_sdk` module. +- `package-composite-v2` has 154 operations from 12 API versions: `2015-06-01-preview`, `2017-08-01-preview`, `2018-06-01`, `2019-01-01`, `2019-01-01-preview`, `2020-01-01-preview`, `2020-07-01-preview`, `2021-01-15-preview`, `2021-05-01-preview`, `2021-07-01-preview`, `2021-10-01-preview`, `2022-08-01-preview`. Use crate feature `package-composite-v2` to enable. The operations will be in the `package_composite_v2` module. +- `package-composite-v1` has 144 operations from 10 API versions: `2015-06-01-preview`, `2017-08-01-preview`, `2019-01-01-preview`, `2020-01-01-preview`, `2020-07-01-preview`, `2021-01-15-preview`, `2021-05-01-preview`, `2021-07-01-preview`, `2021-10-01-preview`, `2022-08-01-preview`. Use crate feature `package-composite-v1` to enable. The operations will be in the `package_composite_v1` module. +- `package-2023-01` has 3 operations from 1 API versions: `2023-01-01`. Use crate feature `package-2023-01` to enable. The operations will be in the `package_2023_01` module. +- `package-2022-05` has 3 operations from 1 API versions: `2022-05-01`. Use crate feature `package-2022-05` to enable. The operations will be in the `package_2022_05` module. \ No newline at end of file diff --git a/services/mgmt/security/autorust.toml b/services/mgmt/security/autorust.toml index 3df5c508bc..6851722061 100644 --- a/services/mgmt/security/autorust.toml +++ b/services/mgmt/security/autorust.toml @@ -2,5 +2,6 @@ deny = [ "package-2020-01-preview-only", # duplicate tag https://github.com/Azure/azure-rest-api-specs/pull/13828 "package-2019-08-only", # defines start_time_utc param twice + "package-composite-v3", # defines multiple components twice ] deny_contains_preview = true diff --git a/services/mgmt/security/src/lib.rs b/services/mgmt/security/src/lib.rs index f4973ca7f0..44e8787eb3 100644 --- a/services/mgmt/security/src/lib.rs +++ b/services/mgmt/security/src/lib.rs @@ -3,23 +3,23 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] -#[cfg(feature = "package-preview-2023-03")] -pub mod package_preview_2023_03; -#[cfg(all(feature = "package-preview-2023-03", not(feature = "no-default-tag")))] -pub use package_preview_2023_03::*; -#[cfg(feature = "package-preview-2023-02")] -pub mod package_preview_2023_02; -#[cfg(all(feature = "package-preview-2023-02", not(feature = "no-default-tag")))] -pub use package_preview_2023_02::*; -#[cfg(feature = "package-preview-2022-11")] -pub mod package_preview_2022_11; -#[cfg(all(feature = "package-preview-2022-11", not(feature = "no-default-tag")))] -pub use package_preview_2022_11::*; -#[cfg(feature = "package-preview-2022-08")] -pub mod package_preview_2022_08; -#[cfg(all(feature = "package-preview-2022-08", not(feature = "no-default-tag")))] -pub use package_preview_2022_08::*; -#[cfg(feature = "package-preview-2022-07")] -pub mod package_preview_2022_07; -#[cfg(all(feature = "package-preview-2022-07", not(feature = "no-default-tag")))] -pub use package_preview_2022_07::*; +#[cfg(feature = "package-dotnet-sdk")] +pub mod package_dotnet_sdk; +#[cfg(all(feature = "package-dotnet-sdk", not(feature = "no-default-tag")))] +pub use package_dotnet_sdk::*; +#[cfg(feature = "package-composite-v2")] +pub mod package_composite_v2; +#[cfg(all(feature = "package-composite-v2", not(feature = "no-default-tag")))] +pub use package_composite_v2::*; +#[cfg(feature = "package-composite-v1")] +pub mod package_composite_v1; +#[cfg(all(feature = "package-composite-v1", not(feature = "no-default-tag")))] +pub use package_composite_v1::*; +#[cfg(feature = "package-2023-01")] +pub mod package_2023_01; +#[cfg(all(feature = "package-2023-01", not(feature = "no-default-tag")))] +pub use package_2023_01::*; +#[cfg(feature = "package-2022-05")] +pub mod package_2022_05; +#[cfg(all(feature = "package-2022-05", not(feature = "no-default-tag")))] +pub use package_2022_05::*; diff --git a/services/mgmt/security/src/package_preview_2022_11/mod.rs b/services/mgmt/security/src/package_2022_05/mod.rs similarity index 61% rename from services/mgmt/security/src/package_preview_2022_11/mod.rs rename to services/mgmt/security/src/package_2022_05/mod.rs index b4720bc3f2..e6762d7a59 100644 --- a/services/mgmt/security/src/package_preview_2022_11/mod.rs +++ b/services/mgmt/security/src/package_2022_05/mod.rs @@ -103,61 +103,53 @@ impl Client { pipeline, } } - pub fn api_collection_client(&self) -> api_collection::Client { - api_collection::Client(self.clone()) - } - pub fn api_collection_offboarding_client(&self) -> api_collection_offboarding::Client { - api_collection_offboarding::Client(self.clone()) - } - pub fn api_collection_onboarding_client(&self) -> api_collection_onboarding::Client { - api_collection_onboarding::Client(self.clone()) + pub fn settings_client(&self) -> settings::Client { + settings::Client(self.clone()) } } -pub mod api_collection { +pub mod settings { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs"] - #[doc = "Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected."] + #[doc = "Settings about different configurations in Microsoft Defender for Cloud"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `service_name`: The name of the API Management service."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - service_name: impl Into, - ) -> list::RequestBuilder { + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), } } - #[doc = "Gets an Azure API Management API if it has been onboarded to Defender for APIs"] - #[doc = "Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected."] + #[doc = "Settings of different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: The name of the setting"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "updating settings about different configurations in Microsoft Defender for Cloud"] #[doc = ""] #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_collection_id`: A string representing the apiCollections resource within the Microsoft.Security provider namespace. This string matches the Azure API Management API name."] - pub fn get( + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: The name of the setting"] + #[doc = "* `setting`: Setting object"] + pub fn update( &self, subscription_id: impl Into, - resource_group_name: impl Into, - service_name: impl Into, - api_collection_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + setting_name: impl Into, + setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_collection_id: api_collection_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), } } } @@ -165,9 +157,9 @@ pub mod api_collection { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiCollectionResponseList = serde_json::from_slice(&bytes)?; + let body: models::SettingsList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -205,15 +197,17 @@ pub mod api_collection { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/providers/Microsoft.Security/apiCollections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ; + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings", + this.client.endpoint(), + &this.subscription_id + ))?; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -230,7 +224,7 @@ pub mod api_collection { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-20-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -246,7 +240,7 @@ pub mod api_collection { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-20-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -270,9 +264,9 @@ pub mod api_collection { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiCollectionResponse = serde_json::from_slice(&bytes)?; + let body: models::Setting = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -310,9 +304,7 @@ pub mod api_collection { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) api_collection_id: String, + pub(crate) setting_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -323,7 +315,12 @@ pub mod api_collection { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/providers/Microsoft.Security/apiCollections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_collection_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -333,7 +330,7 @@ pub mod api_collection { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-20-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -342,8 +339,8 @@ pub mod api_collection { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -354,42 +351,13 @@ pub mod api_collection { } } } -} -pub mod api_collection_onboarding { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Onboard an Azure API Management API to Defender for APIs"] - #[doc = "Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_collection_id`: A string representing the apiCollections resource within the Microsoft.Security provider namespace. This string matches the Azure API Management API name."] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - service_name: impl Into, - api_collection_id: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_collection_id: api_collection_id.into(), - } - } - } - pub mod create { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ApiCollectionResponse = serde_json::from_slice(&bytes)?; + let body: models::Setting = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -427,9 +395,8 @@ pub mod api_collection_onboarding { pub struct RequestBuilder { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) api_collection_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::Setting, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -440,7 +407,12 @@ pub mod api_collection_onboarding { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/providers/Microsoft.Security/apiCollections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_collection_id)) ? ; + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -450,8 +422,9 @@ pub mod api_collection_onboarding { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-20-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -459,8 +432,8 @@ pub mod api_collection_onboarding { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -472,85 +445,3 @@ pub mod api_collection_onboarding { } } } -pub mod api_collection_offboarding { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Offboard an Azure API Management API from Defender for APIs"] - #[doc = "Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations within the Azure API Management API for intrusive behaviors."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `service_name`: The name of the API Management service."] - #[doc = "* `api_collection_id`: A string representing the apiCollections resource within the Microsoft.Security provider namespace. This string matches the Azure API Management API name."] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - service_name: impl Into, - api_collection_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - service_name: service_name.into(), - api_collection_id: api_collection_id.into(), - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) service_name: String, - pub(crate) api_collection_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.ApiManagement/service/{}/providers/Microsoft.Security/apiCollections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . api_collection_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-20-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} diff --git a/services/mgmt/security/src/package_preview_2022_07/models.rs b/services/mgmt/security/src/package_2022_05/models.rs similarity index 50% rename from services/mgmt/security/src/package_preview_2022_07/models.rs rename to services/mgmt/security/src/package_2022_05/models.rs index 96807a94d3..6f23c80b1f 100644 --- a/services/mgmt/security/src/package_preview_2022_07/models.rs +++ b/services/mgmt/security/src/package_2022_05/models.rs @@ -3,176 +3,29 @@ use serde::de::{value, Deserializer, IntoDeserializer}; use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; -#[doc = "Security Application over a given scope"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Application { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Describes properties of an application"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Application { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Application's condition"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ApplicationCondition { - #[doc = "The application Condition's Property, e.g. ID, see examples"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub property: Option, - #[doc = "The application Condition's Value like IDs that contain some string, see examples"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The application Condition's Operator, for example Contains for id or In for list of possible IDs, see examples"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub operator: Option, -} -impl ApplicationCondition { - pub fn new() -> Self { - Self::default() - } -} -pub mod application_condition { - use super::*; - #[doc = "The application Condition's Operator, for example Contains for id or In for list of possible IDs, see examples"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Operator")] - pub enum Operator { - Contains, - Equals, - In, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Operator { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Operator { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Operator { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Contains => serializer.serialize_unit_variant("Operator", 0u32, "Contains"), - Self::Equals => serializer.serialize_unit_variant("Operator", 1u32, "Equals"), - Self::In => serializer.serialize_unit_variant("Operator", 2u32, "In"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } +#[doc = "The alert sync setting properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertSyncSettingProperties { + #[doc = "Is the alert sync setting enabled"] + pub enabled: bool, } -#[doc = "List of application's condition sets - OR between ConditionSets, AND between conditions in a set"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ApplicationConditionSets {} -impl ApplicationConditionSets { - pub fn new() -> Self { - Self::default() +impl AlertSyncSettingProperties { + pub fn new(enabled: bool) -> Self { + Self { enabled } } } -pub type ApplicationConditions = Vec; -#[doc = "Describes properties of an application"] +#[doc = "Represents an alert sync setting"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApplicationProperties { - #[doc = "display name of the application"] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "description of the application"] +pub struct AlertSyncSettings { + #[serde(flatten)] + pub setting: Setting, + #[doc = "The alert sync setting properties"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The application source, what it affects, e.g. Assessments"] - #[serde(rename = "sourceResourceType")] - pub source_resource_type: application_properties::SourceResourceType, - #[doc = "The application conditionSets - see examples"] - #[serde(rename = "conditionSets")] - pub condition_sets: Vec, + pub properties: Option, } -impl ApplicationProperties { - pub fn new(source_resource_type: application_properties::SourceResourceType, condition_sets: Vec) -> Self { - Self { - display_name: None, - description: None, - source_resource_type, - condition_sets, - } - } -} -pub mod application_properties { - use super::*; - #[doc = "The application source, what it affects, e.g. Assessments"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "SourceResourceType")] - pub enum SourceResourceType { - Assessments, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for SourceResourceType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for SourceResourceType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for SourceResourceType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Assessments => serializer.serialize_unit_variant("SourceResourceType", 0u32, "Assessments"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "Page of a security applications list"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ApplicationsList { - #[doc = "Collection of applications in this page"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page"] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ApplicationsList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ApplicationsList { - pub fn new() -> Self { - Self::default() +impl AlertSyncSettings { + pub fn new(setting: Setting) -> Self { + Self { setting, properties: None } } } #[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] @@ -226,6 +79,31 @@ impl CloudErrorBody { Self::default() } } +#[doc = "The data export setting properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSettingProperties { + #[doc = "Is the data export setting enabled"] + pub enabled: bool, +} +impl DataExportSettingProperties { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +#[doc = "Represents a data export setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSettings { + #[serde(flatten)] + pub setting: Setting, + #[doc = "The data export setting properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DataExportSettings { + pub fn new(setting: Setting) -> Self { + Self { setting, properties: None } + } +} #[doc = "The resource management error additional info."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct ErrorAdditionalInfo { @@ -259,3 +137,86 @@ impl Resource { Self::default() } } +#[doc = "The kind of the security setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Setting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "the kind of the settings string"] + pub kind: setting::Kind, +} +impl Setting { + pub fn new(kind: setting::Kind) -> Self { + Self { + resource: Resource::default(), + kind, + } + } +} +pub mod setting { + use super::*; + #[doc = "the kind of the settings string"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + DataExportSettings, + AlertSuppressionSetting, + AlertSyncSettings, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::DataExportSettings => serializer.serialize_unit_variant("Kind", 0u32, "DataExportSettings"), + Self::AlertSuppressionSetting => serializer.serialize_unit_variant("Kind", 1u32, "AlertSuppressionSetting"), + Self::AlertSyncSettings => serializer.serialize_unit_variant("Kind", 2u32, "AlertSyncSettings"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Subscription settings list."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SettingsList { + #[doc = "The settings list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SettingsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SettingsList { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/security/src/package_2023_01/mod.rs b/services/mgmt/security/src/package_2023_01/mod.rs new file mode 100644 index 0000000000..3f48e1989f --- /dev/null +++ b/services/mgmt/security/src/package_2023_01/mod.rs @@ -0,0 +1,429 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn pricings_client(&self) -> pricings::Client { + pricings::Client(self.clone()) + } +} +pub mod pricings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists Microsoft Defender for Cloud pricing configurations in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + pub fn get(&self, subscription_id: impl Into, pricing_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + } + } + #[doc = "Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + #[doc = "* `pricing`: Pricing object"] + pub fn update( + &self, + subscription_id: impl Into, + pricing_name: impl Into, + pricing: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + pricing: pricing.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PricingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + pub(crate) pricing: models::Pricing, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.pricing)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/security/src/package_2023_01/models.rs b/services/mgmt/security/src/package_2023_01/models.rs new file mode 100644 index 0000000000..b0d8c4650f --- /dev/null +++ b/services/mgmt/security/src/package_2023_01/models.rs @@ -0,0 +1,315 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudError { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl CloudError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudErrorBody { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl CloudErrorBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A plan's extension properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Extension { + #[doc = "The extension name. Supported values are:

**AgentlessDiscoveryForKubernetes** - API-based discovery of information about Kubernetes cluster architecture, workload objects, and setup. Required for Kubernetes inventory, identity and network exposure detection, attack path analysis and risk hunting as part of the cloud security explorer.\r\nAvailable for CloudPosture plan.

**OnUploadMalwareScanning** - Limits the GB to be scanned per month for each storage account within the subscription. Once this limit reached on a given storage account, Blobs won't be scanned during current calendar month.\r\nAvailable for StorageAccounts plan.

**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob storage container with sensitive data such as credentials, credit cards, and more, to help prioritize and investigate security events.\r\nAvailable for StorageAccounts and CloudPosture plans.

**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for images stored in your container registries.\r\nAvailable for CloudPosture and Containers plans."] + pub name: String, + #[doc = "Indicates whether the extension is enabled."] + #[serde(rename = "isEnabled")] + pub is_enabled: extension::IsEnabled, + #[doc = "Property values associated with the extension."] + #[serde(rename = "additionalExtensionProperties", default, skip_serializing_if = "Option::is_none")] + pub additional_extension_properties: Option, + #[doc = "A status describing the success/failure of the extension's enablement/disablement operation."] + #[serde(rename = "operationStatus", default, skip_serializing_if = "Option::is_none")] + pub operation_status: Option, +} +impl Extension { + pub fn new(name: String, is_enabled: extension::IsEnabled) -> Self { + Self { + name, + is_enabled, + additional_extension_properties: None, + operation_status: None, + } + } +} +pub mod extension { + use super::*; + #[doc = "Indicates whether the extension is enabled."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "IsEnabled")] + pub enum IsEnabled { + True, + False, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for IsEnabled { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for IsEnabled { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for IsEnabled { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::True => serializer.serialize_unit_variant("IsEnabled", 0u32, "True"), + Self::False => serializer.serialize_unit_variant("IsEnabled", 1u32, "False"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A status describing the success/failure of the extension's enablement/disablement operation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationStatus { + #[doc = "The operation status code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Additional information regarding the success/failure of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl OperationStatus { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation_status { + use super::*; + #[doc = "The operation status code."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Code")] + pub enum Code { + Succeeded, + Failed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Code { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Code { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Code { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("Code", 0u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("Code", 1u32, "Failed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Pricing { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Pricing properties for the relevant scope"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Pricing { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of pricing configurations response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingList { + #[doc = "List of pricing configurations"] + pub value: Vec, +} +impl PricingList { + pub fn new(value: Vec) -> Self { + Self { value } + } +} +#[doc = "Pricing properties for the relevant scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingProperties { + #[doc = "The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] + #[serde(rename = "pricingTier")] + pub pricing_tier: pricing_properties::PricingTier, + #[doc = "The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is applied."] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, + #[doc = "The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S)."] + #[serde(rename = "freeTrialRemainingTime", default, skip_serializing_if = "Option::is_none")] + pub free_trial_remaining_time: Option, + #[doc = "Optional. If `pricingTier` is `Standard` then this property holds the date of the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z)."] + #[serde(rename = "enablementTime", default, with = "azure_core::date::rfc3339::option")] + pub enablement_time: Option, + #[doc = "Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deprecated: Option, + #[doc = "Optional. List of plans that replace this plan. This property exists only if this plan is deprecated."] + #[serde( + rename = "replacedBy", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub replaced_by: Vec, + #[doc = "Optional. List of extensions offered under a plan."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub extensions: Vec, +} +impl PricingProperties { + pub fn new(pricing_tier: pricing_properties::PricingTier) -> Self { + Self { + pricing_tier, + sub_plan: None, + free_trial_remaining_time: None, + enablement_time: None, + deprecated: None, + replaced_by: Vec::new(), + extensions: Vec::new(), + } + } +} +pub mod pricing_properties { + use super::*; + #[doc = "The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PricingTier")] + pub enum PricingTier { + Free, + Standard, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PricingTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PricingTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PricingTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Free => serializer.serialize_unit_variant("PricingTier", 0u32, "Free"), + Self::Standard => serializer.serialize_unit_variant("PricingTier", 1u32, "Standard"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes an Azure resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} diff --git a/services/mgmt/security/src/package_composite_v1/mod.rs b/services/mgmt/security/src/package_composite_v1/mod.rs new file mode 100644 index 0000000000..5583d6d422 --- /dev/null +++ b/services/mgmt/security/src/package_composite_v1/mod.rs @@ -0,0 +1,16524 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn adaptive_application_controls_client(&self) -> adaptive_application_controls::Client { + adaptive_application_controls::Client(self.clone()) + } + pub fn adaptive_network_hardenings_client(&self) -> adaptive_network_hardenings::Client { + adaptive_network_hardenings::Client(self.clone()) + } + pub fn advanced_threat_protection_client(&self) -> advanced_threat_protection::Client { + advanced_threat_protection::Client(self.clone()) + } + pub fn alerts_client(&self) -> alerts::Client { + alerts::Client(self.clone()) + } + pub fn alerts_suppression_rules_client(&self) -> alerts_suppression_rules::Client { + alerts_suppression_rules::Client(self.clone()) + } + pub fn allowed_connections_client(&self) -> allowed_connections::Client { + allowed_connections::Client(self.clone()) + } + pub fn auto_provisioning_settings_client(&self) -> auto_provisioning_settings::Client { + auto_provisioning_settings::Client(self.clone()) + } + pub fn automations_client(&self) -> automations::Client { + automations::Client(self.clone()) + } + pub fn compliances_client(&self) -> compliances::Client { + compliances::Client(self.clone()) + } + pub fn connectors_client(&self) -> connectors::Client { + connectors::Client(self.clone()) + } + pub fn custom_assessment_automations_client(&self) -> custom_assessment_automations::Client { + custom_assessment_automations::Client(self.clone()) + } + pub fn custom_entity_store_assignments_client(&self) -> custom_entity_store_assignments::Client { + custom_entity_store_assignments::Client(self.clone()) + } + pub fn device_security_groups_client(&self) -> device_security_groups::Client { + device_security_groups::Client(self.clone()) + } + pub fn discovered_security_solutions_client(&self) -> discovered_security_solutions::Client { + discovered_security_solutions::Client(self.clone()) + } + pub fn external_security_solutions_client(&self) -> external_security_solutions::Client { + external_security_solutions::Client(self.clone()) + } + pub fn information_protection_policies_client(&self) -> information_protection_policies::Client { + information_protection_policies::Client(self.clone()) + } + pub fn ingestion_settings_client(&self) -> ingestion_settings::Client { + ingestion_settings::Client(self.clone()) + } + pub fn jit_network_access_policies_client(&self) -> jit_network_access_policies::Client { + jit_network_access_policies::Client(self.clone()) + } + pub fn locations_client(&self) -> locations::Client { + locations::Client(self.clone()) + } + pub fn mde_onboardings_client(&self) -> mde_onboardings::Client { + mde_onboardings::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn pricings_client(&self) -> pricings::Client { + pricings::Client(self.clone()) + } + pub fn regulatory_compliance_assessments_client(&self) -> regulatory_compliance_assessments::Client { + regulatory_compliance_assessments::Client(self.clone()) + } + pub fn regulatory_compliance_controls_client(&self) -> regulatory_compliance_controls::Client { + regulatory_compliance_controls::Client(self.clone()) + } + pub fn regulatory_compliance_standards_client(&self) -> regulatory_compliance_standards::Client { + regulatory_compliance_standards::Client(self.clone()) + } + pub fn secure_score_control_definitions_client(&self) -> secure_score_control_definitions::Client { + secure_score_control_definitions::Client(self.clone()) + } + pub fn secure_score_controls_client(&self) -> secure_score_controls::Client { + secure_score_controls::Client(self.clone()) + } + pub fn secure_scores_client(&self) -> secure_scores::Client { + secure_scores::Client(self.clone()) + } + pub fn security_connectors_client(&self) -> security_connectors::Client { + security_connectors::Client(self.clone()) + } + pub fn security_contacts_client(&self) -> security_contacts::Client { + security_contacts::Client(self.clone()) + } + pub fn settings_client(&self) -> settings::Client { + settings::Client(self.clone()) + } + pub fn software_inventories_client(&self) -> software_inventories::Client { + software_inventories::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_baseline_rules_client(&self) -> sql_vulnerability_assessment_baseline_rules::Client { + sql_vulnerability_assessment_baseline_rules::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_scan_results_client(&self) -> sql_vulnerability_assessment_scan_results::Client { + sql_vulnerability_assessment_scan_results::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_scans_client(&self) -> sql_vulnerability_assessment_scans::Client { + sql_vulnerability_assessment_scans::Client(self.clone()) + } + pub fn sub_assessments_client(&self) -> sub_assessments::Client { + sub_assessments::Client(self.clone()) + } + pub fn tasks_client(&self) -> tasks::Client { + tasks::Client(self.clone()) + } + pub fn topology_client(&self) -> topology::Client { + topology::Client(self.clone()) + } + pub fn workspace_settings_client(&self) -> workspace_settings::Client { + workspace_settings::Client(self.clone()) + } +} +pub mod security_connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves details of a specific security connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + #[doc = "Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `security_connector`: The security connector resource"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + security_connector: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + security_connector: security_connector.into(), + } + } + #[doc = "Updates a security connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `security_connector`: The security connector resource"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + security_connector: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + security_connector: security_connector.into(), + } + } + #[doc = "Deletes a security connector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityConnectors", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) security_connector: models::SecurityConnector, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_connector)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) security_connector: models::SecurityConnector, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_connector)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod mde_onboardings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The configuration or data needed to onboard the machine to MDE"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "The default configuration or data needed to onboard the machine to MDE"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn get(&self, subscription_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MdeOnboardingDataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/mdeOnboardings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MdeOnboardingData = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/mdeOnboardings/default", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod custom_assessment_automations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a custom assessment automation"] + #[doc = "Gets a single custom assessment automation by name for the provided subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + } + } + #[doc = "Creates a custom assessment automation"] + #[doc = "Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + #[doc = "* `custom_assessment_automation_body`: Custom Assessment Automation body"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + custom_assessment_automation_body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + custom_assessment_automation_body: custom_assessment_automation_body.into(), + } + } + #[doc = "Deletes a custom assessment automation"] + #[doc = "Deletes a custom assessment automation by name for a provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + } + } + #[doc = "List custom assessment automations in a subscription and a resource group"] + #[doc = "List custom assessment automations by provided subscription and resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List custom assessment automations in a subscription"] + #[doc = "List custom assessment automations by provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + pub(crate) custom_assessment_automation_body: models::CustomAssessmentAutomationRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.custom_assessment_automation_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/customAssessmentAutomations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod custom_entity_store_assignments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a custom entity store assignment"] + #[doc = "Gets a single custom entity store assignment by name for the provided subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + } + } + #[doc = "Creates a custom entity store assignment"] + #[doc = "Creates a custom entity store assignment for the provided subscription, if not already exists."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + #[doc = "* `custom_entity_store_assignment_request_body`: Custom entity store assignment body"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + custom_entity_store_assignment_request_body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + custom_entity_store_assignment_request_body: custom_entity_store_assignment_request_body.into(), + } + } + #[doc = "Deleted a custom entity store assignment"] + #[doc = "Delete a custom entity store assignment by name for a provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + } + } + #[doc = "List custom entity store assignments in a subscription and a resource group"] + #[doc = "List custom entity store assignments by a provided subscription and resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List custom entity store assignments in a subscription"] + #[doc = "List custom entity store assignments by provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + pub(crate) custom_entity_store_assignment_request_body: models::CustomEntityStoreAssignmentRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.custom_entity_store_assignment_request_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignmentsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignmentsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/customEntityStoreAssignments", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod software_inventories { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the software inventory of the virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets the software inventory of all virtual machines in the subscriptions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a single software data of the virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `software_name`: Name of the installed software."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + software_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + software_name: software_name.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SoftwaresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/softwareInventories", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_namespace, + &this.resource_type, + &this.resource_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SoftwaresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/softwareInventories", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Software = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) software_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/softwareInventories/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_namespace, + &this.resource_type, + &this.resource_name, + &this.software_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_scans { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the scan details of a single scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan record for the latest scan."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + scan_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets a list of scan records."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Scan = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}", + this.client.endpoint(), + &this.resource_id, + &this.scan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Scans = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_scan_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the scan results of a single rule in a scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] + #[doc = "* `scan_result_id`: The rule Id of the results."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + scan_id: impl Into, + scan_result_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + scan_result_id: scan_result_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets a list of scan results for a single scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list( + &self, + scan_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScanResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) scan_result_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults/{}", + this.client.endpoint(), + &this.resource_id, + &this.scan_id, + &this.scan_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScanResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults", + this.client.endpoint(), + &this.resource_id, + &this.scan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_baseline_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the results for a given rule in the Baseline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Creates a Baseline for a rule in a database. Will overwrite any previously existing results."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn create_or_update( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + body: None, + } + } + #[doc = "Deletes a rule from the Baseline of a given database."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn delete( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets the results for all rules in the Baseline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Add a list of baseline rules. Will overwrite any previously existing results (for all rules)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn add(&self, workspace_id: impl Into, resource_id: impl Into) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + body: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuleResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuleResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + pub(crate) body: Option, + } + impl RequestBuilder { + #[doc = "The baseline results for this rule."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RulesResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RulesResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + pub(crate) body: Option, + } + impl RequestBuilder { + #[doc = "The baseline rules."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod secure_scores { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `secure_score_name`: The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below."] + pub fn get(&self, subscription_id: impl Into, secure_score_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + secure_score_name: secure_score_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreItem = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) secure_score_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores/{}", + this.client.endpoint(), + &this.subscription_id, + &this.secure_score_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod secure_score_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all security controls for a specific initiative within a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `secure_score_name`: The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below."] + pub fn list_by_secure_score( + &self, + subscription_id: impl Into, + secure_score_name: impl Into, + ) -> list_by_secure_score::RequestBuilder { + list_by_secure_score::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + secure_score_name: secure_score_name.into(), + expand: None, + } + } + #[doc = "Get all security controls within a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + expand: None, + } + } + } + pub mod list_by_secure_score { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) secure_score_name: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores/{}/secureScoreControls", + this.client.endpoint(), + &this.subscription_id, + &this.secure_score_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScoreControls", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod secure_score_control_definitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the available security controls, their assessments, and the max score"] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "For a specified subscription, list the available security controls, their assessments, and the max score"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlDefinitionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.Security/secureScoreControlDefinitions", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlDefinitionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScoreControlDefinitions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Cloud accounts connectors of a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific cloud account connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + pub fn get(&self, subscription_id: impl Into, connector_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + } + } + #[doc = "Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + #[doc = "* `connector_setting`: Settings for the cloud account connector"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + connector_name: impl Into, + connector_setting: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + connector_setting: connector_setting.into(), + } + } + #[doc = "Delete a cloud account connector from a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + pub fn delete(&self, subscription_id: impl Into, connector_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + pub(crate) connector_setting: models::ConnectorSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.connector_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod security_contacts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get Default Security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + pub fn get(&self, subscription_id: impl Into, security_contact_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + } + } + #[doc = "Create security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + #[doc = "* `security_contact`: Security contact object"] + pub fn create( + &self, + subscription_id: impl Into, + security_contact_name: impl Into, + security_contact: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + security_contact: security_contact.into(), + } + } + #[doc = "Delete security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + pub fn delete(&self, subscription_id: impl Into, security_contact_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContactList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContact = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContact = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + pub(crate) security_contact: models::SecurityContact, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_contact)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod automations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves information about the model of a security automation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + } + } + #[doc = "Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + #[doc = "* `automation`: The security automation resource"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + automation: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + automation: automation.into(), + } + } + #[doc = "Deletes a security automation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + } + } + #[doc = "Validates the security automation model before create or update. Any validation errors are returned to the client."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + #[doc = "* `automation`: The security automation resource"] + pub fn validate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + automation: impl Into, + ) -> validate::RequestBuilder { + validate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + automation: automation.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/automations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Automation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Automation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + pub(crate) automation: models::Automation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.automation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod validate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationValidationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + pub(crate) automation: models::Automation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}/validate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.automation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sub_assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get security sub-assessments on all your scanned resources inside a subscription scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list_all(&self, scope: impl Into) -> list_all::RequestBuilder { + list_all::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Get security sub-assessments on all your scanned resources inside a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + pub fn list(&self, scope: impl Into, assessment_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + } + } + #[doc = "Get a security sub-assessment on your scanned resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `sub_assessment_name`: The Sub-Assessment Key - Unique key for the sub-assessment type"] + pub fn get( + &self, + scope: impl Into, + assessment_name: impl Into, + sub_assessment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + sub_assessment_name: sub_assessment_name.into(), + } + } + } + pub mod list_all { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/subAssessments", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/subAssessments", + this.client.endpoint(), + &this.scope, + &this.assessment_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + pub(crate) sub_assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/subAssessments/{}", + this.client.endpoint(), + &this.scope, + &this.assessment_name, + &this.sub_assessment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_standards { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Supported regulatory compliance standards details and state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Supported regulatory compliance details state for selected standard"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceStandardList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceStandard = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.regulatory_compliance_standard_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "All supported regulatory compliance controls details and state for selected standard"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + pub fn list( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + filter: None, + } + } + #[doc = "Selected regulatory compliance control details and state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceControl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details and state of assessments mapped to selected regulatory compliance control"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + pub fn list( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + filter: None, + } + } + #[doc = "Supported regulatory compliance details and state for selected assessment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + #[doc = "* `regulatory_compliance_assessment_name`: Name of the regulatory compliance assessment object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + regulatory_compliance_assessment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + regulatory_compliance_assessment_name: regulatory_compliance_assessment_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}/regulatoryComplianceAssessments" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + pub(crate) regulatory_compliance_assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}/regulatoryComplianceAssessments/{}" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name , & this . regulatory_compliance_assessment_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pricings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security pricing configurations in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Security pricing configurations in the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Security pricing configuration in the subscriptionSecurity pricing configuration in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + pub fn get_subscription_pricing( + &self, + subscription_id: impl Into, + pricing_name: impl Into, + ) -> get_subscription_pricing::RequestBuilder { + get_subscription_pricing::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + } + } + #[doc = "Security pricing configuration in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + #[doc = "* `pricing`: Pricing object"] + pub fn update_subscription_pricing( + &self, + subscription_id: impl Into, + pricing_name: impl Into, + pricing: impl Into, + ) -> update_subscription_pricing::RequestBuilder { + update_subscription_pricing::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + pricing: pricing.into(), + } + } + #[doc = "Security pricing configuration in the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `pricing_name`: name of the pricing configuration"] + pub fn get_resource_group_pricing( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + pricing_name: impl Into, + ) -> get_resource_group_pricing::RequestBuilder { + get_resource_group_pricing::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + pricing_name: pricing_name.into(), + } + } + #[doc = "Security pricing configuration in the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `pricing_name`: name of the pricing configuration"] + #[doc = "* `pricing`: Pricing object"] + pub fn create_or_update_resource_group_pricing( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + pricing_name: impl Into, + pricing: impl Into, + ) -> create_or_update_resource_group_pricing::RequestBuilder { + create_or_update_resource_group_pricing::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + pricing_name: pricing_name.into(), + pricing: pricing.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PricingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PricingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/pricings", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_pricing { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_pricing { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + pub(crate) pricing: models::Pricing, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.pricing)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_resource_group_pricing { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) pricing_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update_resource_group_pricing { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) pricing_name: String, + pub(crate) pricing: models::Pricing, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.pricing)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + pub fn get(&self, subscription_id: impl Into, workspace_setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + } + } + #[doc = "creating settings about where we should store your security data and logs"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + #[doc = "* `workspace_setting`: Security data setting object"] + pub fn create( + &self, + subscription_id: impl Into, + workspace_setting_name: impl Into, + workspace_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + workspace_setting: workspace_setting.into(), + } + } + #[doc = "Settings about where we should store your security data and logs"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + #[doc = "* `workspace_setting`: Security data setting object"] + pub fn update( + &self, + subscription_id: impl Into, + workspace_setting_name: impl Into, + workspace_setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + workspace_setting: workspace_setting.into(), + } + } + #[doc = "Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + pub fn delete(&self, subscription_id: impl Into, workspace_setting_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + pub(crate) workspace_setting: models::WorkspaceSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + pub(crate) workspace_setting: models::WorkspaceSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod auto_provisioning_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Exposes the auto provisioning settings of the subscriptions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific setting"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Auto provisioning setting key"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "Details of a specific setting"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Auto provisioning setting key"] + #[doc = "* `setting`: Auto provisioning setting key"] + pub fn create( + &self, + subscription_id: impl Into, + setting_name: impl Into, + setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::AutoProvisioningSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod compliances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The Compliance scores of the specific management group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Details of a specific Compliance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `compliance_name`: name of the Compliance"] + pub fn get(&self, scope: impl Into, compliance_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + compliance_name: compliance_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComplianceList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/compliances", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Compliance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) compliance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/compliances/{}", + this.client.endpoint(), + &this.scope, + &this.compliance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod advanced_threat_protection { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the Advanced Threat Protection settings for the specified resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `setting_name`: Advanced Threat Protection setting name."] + pub fn get(&self, resource_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "Creates or updates the Advanced Threat Protection settings on a specified resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `setting_name`: Advanced Threat Protection setting name."] + #[doc = "* `advanced_threat_protection_setting`: Advanced Threat Protection Settings"] + pub fn create( + &self, + resource_id: impl Into, + setting_name: impl Into, + advanced_threat_protection_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + setting_name: setting_name.into(), + advanced_threat_protection_setting: advanced_threat_protection_setting.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdvancedThreatProtectionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/advancedThreatProtectionSettings/{}", + this.client.endpoint(), + &this.resource_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdvancedThreatProtectionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) setting_name: String, + pub(crate) advanced_threat_protection_setting: models::AdvancedThreatProtectionSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/advancedThreatProtectionSettings/{}", + this.client.endpoint(), + &this.resource_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.advanced_threat_protection_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod device_security_groups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method get the list of device security groups for the specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + } + } + #[doc = "Use this method to get the device security group for the specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + pub fn get(&self, resource_id: impl Into, device_security_group_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + } + } + #[doc = "Use this method to creates or updates the device security group on a specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + #[doc = "* `device_security_group`: Security group object."] + pub fn create_or_update( + &self, + resource_id: impl Into, + device_security_group_name: impl Into, + device_security_group: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + device_security_group: device_security_group.into(), + } + } + #[doc = "User this method to deletes the device security group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + pub fn delete(&self, resource_id: impl Into, device_security_group_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroupList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups", + this.client.endpoint(), + &this.resource_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + pub(crate) device_security_group: models::DeviceSecurityGroup, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.device_security_group)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings about different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings of different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Name of setting: (MCAS/WDATP)"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "updating settings about different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Name of setting: (MCAS/WDATP)"] + #[doc = "* `setting`: Setting object"] + pub fn update( + &self, + subscription_id: impl Into, + setting_name: impl Into, + setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SettingsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Setting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Setting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::Setting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod information_protection_policies { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details of the information protection policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `information_protection_policy_name`: Name of the information protection policy."] + pub fn get(&self, scope: impl Into, information_protection_policy_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + information_protection_policy_name: information_protection_policy_name.into(), + } + } + #[doc = "Details of the information protection policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `information_protection_policy_name`: Name of the information protection policy."] + #[doc = "* `information_protection_policy`: Information protection policy."] + pub fn create_or_update( + &self, + scope: impl Into, + information_protection_policy_name: impl Into, + information_protection_policy: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + information_protection_policy_name: information_protection_policy_name.into(), + information_protection_policy: information_protection_policy.into(), + } + } + #[doc = "Information protection policies of a specific management group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) information_protection_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies/{}", + this.client.endpoint(), + &this.scope, + &this.information_protection_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) information_protection_policy_name: String, + pub(crate) information_protection_policy: models::InformationProtectionPolicy, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies/{}", + this.client.endpoint(), + &this.scope, + &this.information_protection_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.information_protection_policy)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Exposes all available operations for discovery purposes."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.Security/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod locations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn get(&self, subscription_id: impl Into, asc_location: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AscLocationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AscLocation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod tasks { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + pub fn get_subscription_level_task( + &self, + subscription_id: impl Into, + asc_location: impl Into, + task_name: impl Into, + ) -> get_subscription_level_task::RequestBuilder { + get_subscription_level_task::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + #[doc = "* `task_update_action_type`: Type of the action to do on the task"] + pub fn update_subscription_level_task_state( + &self, + subscription_id: impl Into, + asc_location: impl Into, + task_name: impl Into, + task_update_action_type: impl Into, + ) -> update_subscription_level_task_state::RequestBuilder { + update_subscription_level_task_state::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + task_update_action_type: task_update_action_type.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + pub fn get_resource_group_level_task( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + task_name: impl Into, + ) -> get_resource_group_level_task::RequestBuilder { + get_resource_group_level_task::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + #[doc = "* `task_update_action_type`: Type of the action to do on the task"] + pub fn update_resource_group_level_task_state( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + task_name: impl Into, + task_update_action_type: impl Into, + ) -> update_resource_group_level_task_state::RequestBuilder { + update_resource_group_level_task_state::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + task_update_action_type: task_update_action_type.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/tasks", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_level_task { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.task_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_level_task_state { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + pub(crate) task_update_action_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks/{}/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.task_name, + &this.task_update_action_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_resource_group_level_task { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.task_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_resource_group_level_task_state { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + pub(crate) task_update_action_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks/{}/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.task_name, + &this.task_update_action_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod alerts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the alerts that are associated with the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + select: None, + expand: None, + } + } + #[doc = "List all the alerts that are associated with the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + select: None, + expand: None, + } + } + #[doc = "List all the alerts that are associated with the subscription that are stored in a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_subscription_level_alerts_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_subscription_level_alerts_by_region::RequestBuilder { + list_subscription_level_alerts_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + filter: None, + select: None, + expand: None, + } + } + #[doc = "List all the alerts that are associated with the resource group that are stored in a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_resource_group_level_alerts_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + resource_group_name: impl Into, + ) -> list_resource_group_level_alerts_by_region::RequestBuilder { + list_resource_group_level_alerts_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + resource_group_name: resource_group_name.into(), + filter: None, + select: None, + expand: None, + } + } + #[doc = "Get an alert that is associated with a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn get_subscription_level_alert( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> get_subscription_level_alert::RequestBuilder { + get_subscription_level_alert::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Get an alert that is associated a resource group or a resource in a resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn get_resource_group_level_alerts( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + resource_group_name: impl Into, + ) -> get_resource_group_level_alerts::RequestBuilder { + get_resource_group_level_alerts::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_alert_state_to_dismiss( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_alert_state_to_dismiss::RequestBuilder { + update_subscription_level_alert_state_to_dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_alert_state_to_reactivate( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_alert_state_to_reactivate::RequestBuilder { + update_subscription_level_alert_state_to_reactivate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn update_resource_group_level_alert_state_to_dismiss( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + resource_group_name: impl Into, + ) -> update_resource_group_level_alert_state_to_dismiss::RequestBuilder { + update_resource_group_level_alert_state_to_dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn update_resource_group_level_alert_state_to_reactivate( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + resource_group_name: impl Into, + ) -> update_resource_group_level_alert_state_to_reactivate::RequestBuilder { + update_resource_group_level_alert_state_to_reactivate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + resource_group_name: resource_group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alerts", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_subscription_level_alerts_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_resource_group_level_alerts_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_level_alert { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_resource_group_level_alerts { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_level_alert_state_to_dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/dismiss", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_subscription_level_alert_state_to_reactivate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/reactivate", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_alert_state_to_dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/dismiss", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_alert_state_to_reactivate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/reactivate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod discovered_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of discovered Security Solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of discovered Security Solutions for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific discovered Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `discovered_security_solution_name`: Name of a discovered security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + discovered_security_solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + discovered_security_solution_name: discovered_security_solution_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/discoveredSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/discoveredSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) discovered_security_solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/discoveredSecuritySolutions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . asc_location , & this . discovered_security_solution_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod jit_network_access_policies { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Policies for protecting resources using Just-in-Time access control."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_region::RequestBuilder { + list_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_resource_group_and_region( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + ) -> list_by_resource_group_and_region::RequestBuilder { + list_by_resource_group_and_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + } + } + #[doc = "Create a policy for protecting resources using Just-in-Time access control"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + body: body.into(), + } + } + #[doc = "Delete a Just-in-Time access control policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + } + } + #[doc = "Initiate a JIT access from a specific Just-in-Time policy configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + #[doc = "* `jit_network_access_policy_initiate_type`: Type of the action to do on the Just-in-Time access policy."] + pub fn initiate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + jit_network_access_policy_initiate_type: impl Into, + body: impl Into, + ) -> initiate::RequestBuilder { + initiate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + jit_network_access_policy_initiate_type: jit_network_access_policy_initiate_type.into(), + body: body.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group_and_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + pub(crate) body: models::JitNetworkAccessPolicy, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod initiate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessRequest = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + pub(crate) jit_network_access_policy_initiate_type: String, + pub(crate) body: models::JitNetworkAccessPolicyInitiateRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . asc_location , & this . jit_network_access_policy_name , & this . jit_network_access_policy_initiate_type)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod adaptive_application_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of application control VM/server groups for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + include_path_recommendations: None, + summary: None, + } + } + #[doc = "Gets an application control VM/server group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control VM/server group"] + pub fn get( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + } + } + #[doc = "Update an application control VM/server group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control VM/server group"] + #[doc = "* `body`: The updated VM/server group data"] + pub fn put( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + body: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + body: body.into(), + } + } + #[doc = "Delete an application control VM/server group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control VM/server group"] + pub fn delete( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AppWhitelistingGroups = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) include_path_recommendations: Option, + pub(crate) summary: Option, + } + impl RequestBuilder { + #[doc = "Include the policy rules"] + pub fn include_path_recommendations(mut self, include_path_recommendations: bool) -> Self { + self.include_path_recommendations = Some(include_path_recommendations); + self + } + #[doc = "Return output in a summarized form"] + pub fn summary(mut self, summary: bool) -> Self { + self.summary = Some(summary); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applicationWhitelistings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(include_path_recommendations) = &this.include_path_recommendations { + req.url_mut() + .query_pairs_mut() + .append_pair("includePathRecommendations", &include_path_recommendations.to_string()); + } + if let Some(summary) = &this.summary { + req.url_mut().query_pairs_mut().append_pair("summary", &summary.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AppWhitelistingGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod put { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AppWhitelistingGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + pub(crate) body: models::AppWhitelistingPutGroupData, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod external_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of external security solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of external Security Solutions for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific external Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `external_security_solutions_name`: Name of an external security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + external_security_solutions_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + external_security_solutions_name: external_security_solutions_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/externalSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/ExternalSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) external_security_solutions_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/ExternalSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.external_security_solutions_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod topology { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list that allows to build a topology view of a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list that allows to build a topology view of a subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific topology component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `topology_resource_name`: Name of a topology resources collection."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + topology_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + topology_resource_name: topology_resource_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/topologies", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/topologies", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) topology_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/topologies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.topology_resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod allowed_connections { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of all possible traffic between resources for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the list of all possible traffic between resources for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets the list of all possible traffic between resources for the subscription and location, based on connection type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `connection_type`: The type of allowed connections (Internal, External)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + connection_type: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + connection_type: connection_type.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/allowedConnections", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/allowedConnections", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) connection_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/allowedConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.connection_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod adaptive_network_hardenings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of Adaptive Network Hardenings resources in scope of an extended resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets a single Adaptive Network Hardening resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `adaptive_network_hardening_resource_name`: The name of the Adaptive Network Hardening resource."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + adaptive_network_hardening_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + adaptive_network_hardening_resource_name: adaptive_network_hardening_resource_name.into(), + } + } + #[doc = "Enforces the given rules on the NSG(s) listed in the request"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `adaptive_network_hardening_resource_name`: The name of the Adaptive Network Hardening resource."] + #[doc = "* `adaptive_network_hardening_enforce_action`: Enforces the given rules on the NSG(s) listed in the request"] + pub fn enforce( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + adaptive_network_hardening_resource_name: impl Into, + adaptive_network_hardening_enforce_action: impl Into, + body: impl Into, + ) -> enforce::RequestBuilder { + enforce::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + adaptive_network_hardening_resource_name: adaptive_network_hardening_resource_name.into(), + adaptive_network_hardening_enforce_action: adaptive_network_hardening_enforce_action.into(), + body: body.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveNetworkHardeningsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveNetworkHardening = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) adaptive_network_hardening_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . adaptive_network_hardening_resource_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod enforce { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) adaptive_network_hardening_resource_name: String, + pub(crate) adaptive_network_hardening_enforce_action: String, + pub(crate) body: models::AdaptiveNetworkHardeningEnforceRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings/{}/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . adaptive_network_hardening_resource_name , & this . adaptive_network_hardening_enforce_action)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod alerts_suppression_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of all the dismiss rules for the given subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alert_type: None, + } + } + #[doc = "Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + pub fn get(&self, subscription_id: impl Into, alerts_suppression_rule_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + } + } + #[doc = "Update existing rule or create new rule if it doesn't exist"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + #[doc = "* `alerts_suppression_rule`: Suppression rule object"] + pub fn update( + &self, + subscription_id: impl Into, + alerts_suppression_rule_name: impl Into, + alerts_suppression_rule: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + alerts_suppression_rule: alerts_suppression_rule.into(), + } + } + #[doc = "Delete dismiss alert rule for this subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + pub fn delete( + &self, + subscription_id: impl Into, + alerts_suppression_rule_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRulesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alert_type: Option, + } + impl RequestBuilder { + #[doc = "Type of the alert to get rules for"] + pub fn alert_type(mut self, alert_type: impl Into) -> Self { + self.alert_type = Some(alert_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(alert_type) = &this.alert_type { + req.url_mut().query_pairs_mut().append_pair("AlertType", alert_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + pub(crate) alerts_suppression_rule: models::AlertsSuppressionRule, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.alerts_suppression_rule)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod ingestion_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn get(&self, subscription_id: impl Into, ingestion_setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Create setting for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + #[doc = "* `ingestion_setting`: Ingestion setting object"] + pub fn create( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ingestion_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + ingestion_setting: ingestion_setting.into(), + } + } + #[doc = "Deletes the ingestion settings for this subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn delete(&self, subscription_id: impl Into, ingestion_setting_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Returns the token that is used for correlating ingested telemetry with the resources in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn list_tokens( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ) -> list_tokens::RequestBuilder { + list_tokens::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Connection strings for ingesting security scan logs and data."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn list_connection_strings( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ) -> list_connection_strings::RequestBuilder { + list_connection_strings::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + pub(crate) ingestion_setting: models::IngestionSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.ingestion_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_tokens { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSettingToken = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}/listTokens", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_connection_strings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectionStrings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}/listConnectionStrings", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/security/src/package_composite_v1/models.rs b/services/mgmt/security/src/package_composite_v1/models.rs new file mode 100644 index 0000000000..ac9fcee38a --- /dev/null +++ b/services/mgmt/security/src/package_composite_v1/models.rs @@ -0,0 +1,8278 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadConnectivityState { + #[serde(rename = "connectivityState", default, skip_serializing_if = "Option::is_none")] + pub connectivity_state: Option, +} +impl AadConnectivityState { + pub fn new() -> Self { + Self::default() + } +} +pub mod aad_connectivity_state { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ConnectivityState")] + pub enum ConnectivityState { + Discovered, + NotLicensed, + Connected, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ConnectivityState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ConnectivityState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ConnectivityState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Discovered => serializer.serialize_unit_variant("ConnectivityState", 0u32, "Discovered"), + Self::NotLicensed => serializer.serialize_unit_variant("ConnectivityState", 1u32, "NotLicensed"), + Self::Connected => serializer.serialize_unit_variant("ConnectivityState", 2u32, "Connected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents an AAD identity protection solution which sends logs to an OMS workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AadExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(flatten)] + pub aad_connectivity_state: AadConnectivityState, +} +impl AadSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of active connections is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ActiveConnectionsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl ActiveConnectionsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardening { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Adaptive Network Hardening resource properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AdaptiveNetworkHardening { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdaptiveNetworkHardeningEnforceRequest { + #[doc = "The rules to enforce"] + pub rules: Vec, + #[doc = "The Azure resource IDs of the effective network security groups that will be updated with the created security rules from the Adaptive Network Hardening rules"] + #[serde(rename = "networkSecurityGroups")] + pub network_security_groups: Vec, +} +impl AdaptiveNetworkHardeningEnforceRequest { + pub fn new(rules: Vec, network_security_groups: Vec) -> Self { + Self { + rules, + network_security_groups, + } + } +} +#[doc = "Adaptive Network Hardening resource properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardeningProperties { + #[doc = "The security rules which are recommended to be effective on the VM"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, + #[doc = "The UTC time on which the rules were calculated"] + #[serde(rename = "rulesCalculationTime", default, with = "azure_core::date::rfc3339::option")] + pub rules_calculation_time: Option, + #[doc = "The Network Security Groups effective on the network interfaces of the protected resource"] + #[serde( + rename = "effectiveNetworkSecurityGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub effective_network_security_groups: Vec, +} +impl AdaptiveNetworkHardeningProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Response for ListAdaptiveNetworkHardenings API service call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardeningsList { + #[doc = "A list of Adaptive Network Hardenings resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of results"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AdaptiveNetworkHardeningsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AdaptiveNetworkHardeningsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of the sub-assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdditionalData { + #[doc = "Sub-assessment resource type"] + #[serde(rename = "assessedResourceType")] + pub assessed_resource_type: additional_data::AssessedResourceType, +} +impl AdditionalData { + pub fn new(assessed_resource_type: additional_data::AssessedResourceType) -> Self { + Self { assessed_resource_type } + } +} +pub mod additional_data { + use super::*; + #[doc = "Sub-assessment resource type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AssessedResourceType")] + pub enum AssessedResourceType { + SqlServerVulnerability, + ContainerRegistryVulnerability, + ServerVulnerability, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AssessedResourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AssessedResourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AssessedResourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SqlServerVulnerability => serializer.serialize_unit_variant("AssessedResourceType", 0u32, "SqlServerVulnerability"), + Self::ContainerRegistryVulnerability => { + serializer.serialize_unit_variant("AssessedResourceType", 1u32, "ContainerRegistryVulnerability") + } + Self::ServerVulnerability => serializer.serialize_unit_variant("AssessedResourceType", 2u32, "ServerVulnerability"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The Advanced Threat Protection settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdvancedThreatProtectionProperties { + #[doc = "Indicates whether Advanced Threat Protection is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option, +} +impl AdvancedThreatProtectionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Advanced Threat Protection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdvancedThreatProtectionSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The Advanced Threat Protection settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AdvancedThreatProtectionSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security alert"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Alert { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes security alert properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Alert { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Factors that increase our confidence that the alert is a true positive"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertConfidenceReason { + #[doc = "Type of confidence factor"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "description of the confidence reason"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} +impl AlertConfidenceReason { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties depending on the entity type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertEntity { + #[doc = "Type of entity"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl AlertEntity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties depending on the alert type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertExtendedProperties {} +impl AlertExtendedProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security alerts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AlertList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AlertList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes security alert properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertProperties { + #[doc = "State of the alert (Active, Dismissed etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The time the incident was reported to Microsoft.Security in UTC"] + #[serde(rename = "reportedTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub reported_time_utc: Option, + #[doc = "Name of the vendor that discovered the incident"] + #[serde(rename = "vendorName", default, skip_serializing_if = "Option::is_none")] + pub vendor_name: Option, + #[doc = "Name of the alert type"] + #[serde(rename = "alertName", default, skip_serializing_if = "Option::is_none")] + pub alert_name: Option, + #[doc = "Display name of the alert type"] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "The time the incident was detected by the vendor"] + #[serde(rename = "detectedTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub detected_time_utc: Option, + #[doc = "Description of the incident and what it means"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Recommended steps to reradiate the incident"] + #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] + pub remediation_steps: Option, + #[doc = "The action that was taken as a response to the alert (Active, Blocked etc.)"] + #[serde(rename = "actionTaken", default, skip_serializing_if = "Option::is_none")] + pub action_taken: Option, + #[doc = "Estimated severity of this alert"] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "The entity that the incident happened on"] + #[serde(rename = "compromisedEntity", default, skip_serializing_if = "Option::is_none")] + pub compromised_entity: Option, + #[doc = "Azure resource ID of the associated resource"] + #[serde(rename = "associatedResource", default, skip_serializing_if = "Option::is_none")] + pub associated_resource: Option, + #[doc = "Changing set of properties depending on the alert type."] + #[serde(rename = "extendedProperties", default, skip_serializing_if = "Option::is_none")] + pub extended_properties: Option, + #[doc = "The type of the alerted resource (Azure, Non-Azure)"] + #[serde(rename = "systemSource", default, skip_serializing_if = "Option::is_none")] + pub system_source: Option, + #[doc = "Whether this alert can be investigated with Azure Security Center"] + #[serde(rename = "canBeInvestigated", default, skip_serializing_if = "Option::is_none")] + pub can_be_investigated: Option, + #[doc = "Whether this alert is for incident type or not (otherwise - single alert)"] + #[serde(rename = "isIncident", default, skip_serializing_if = "Option::is_none")] + pub is_incident: Option, + #[doc = "objects that are related to this alerts"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub entities: Vec, + #[doc = "level of confidence we have on the alert"] + #[serde(rename = "confidenceScore", default, skip_serializing_if = "Option::is_none")] + pub confidence_score: Option, + #[doc = "reasons the alert got the confidenceScore value"] + #[serde( + rename = "confidenceReasons", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub confidence_reasons: Vec, + #[doc = "Azure subscription ID of the resource that had the security alert or the subscription ID of the workspace that this resource reports to"] + #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] + pub subscription_id: Option, + #[doc = "Instance ID of the alert."] + #[serde(rename = "instanceId", default, skip_serializing_if = "Option::is_none")] + pub instance_id: Option, + #[doc = "Azure resource ID of the workspace that the alert was reported to."] + #[serde(rename = "workspaceArmId", default, skip_serializing_if = "Option::is_none")] + pub workspace_arm_id: Option, + #[doc = "Alerts with the same CorrelationKey will be grouped together in Ibiza."] + #[serde(rename = "correlationKey", default, skip_serializing_if = "Option::is_none")] + pub correlation_key: Option, +} +impl AlertProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod alert_properties { + use super::*; + #[doc = "Estimated severity of this alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Silent, + Information, + Low, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Silent => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Silent"), + Self::Information => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Information"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Low"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes the suppression rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertsSuppressionRule { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes AlertsSuppressionRule properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AlertsSuppressionRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes AlertsSuppressionRule properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertsSuppressionRuleProperties { + #[doc = "Type of the alert to automatically suppress. For all alert types, use '*'"] + #[serde(rename = "alertType")] + pub alert_type: String, + #[doc = "The last time this rule was modified"] + #[serde(rename = "lastModifiedUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_utc: Option, + #[doc = "Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date."] + #[serde(rename = "expirationDateUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_date_utc: Option, + #[doc = "The reason for dismissing the alert"] + pub reason: String, + #[doc = "Possible states of the rule"] + pub state: alerts_suppression_rule_properties::State, + #[doc = "Any comment regarding the rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option, + #[serde(rename = "suppressionAlertsScope", default, skip_serializing_if = "Option::is_none")] + pub suppression_alerts_scope: Option, +} +impl AlertsSuppressionRuleProperties { + pub fn new(alert_type: String, reason: String, state: alerts_suppression_rule_properties::State) -> Self { + Self { + alert_type, + last_modified_utc: None, + expiration_date_utc: None, + reason, + state, + comment: None, + suppression_alerts_scope: None, + } + } +} +pub mod alerts_suppression_rule_properties { + use super::*; + #[doc = "Possible states of the rule"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + Enabled, + Disabled, + Expired, + } +} +#[doc = "Suppression rules list for subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertsSuppressionRulesList { + pub value: Vec, + #[doc = "URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AlertsSuppressionRulesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AlertsSuppressionRulesList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "List of all possible traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AllowedConnectionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AllowedConnectionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource whose properties describes the allowed traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[doc = "Describes the allowed traffic between Azure resources"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AllowedConnectionsResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the allowed traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsResourceProperties { + #[doc = "The UTC time on which the allowed connections resource was calculated"] + #[serde(rename = "calculatedDateTime", default, with = "azure_core::date::rfc3339::option")] + pub calculated_date_time: Option, + #[doc = "List of connectable resources"] + #[serde( + rename = "connectableResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub connectable_resources: Vec, +} +impl AllowedConnectionsResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is allowed."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AllowlistCustomAlertRule { + #[serde(flatten)] + pub list_custom_alert_rule: ListCustomAlertRule, + #[doc = "The values to allow. The format of the values depends on the rule type."] + #[serde(rename = "allowlistValues")] + pub allowlist_values: Vec, +} +impl AllowlistCustomAlertRule { + pub fn new(list_custom_alert_rule: ListCustomAlertRule, allowlist_values: Vec) -> Self { + Self { + list_custom_alert_rule, + allowlist_values, + } + } +} +#[doc = "Number of cloud to device messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppWhitelistingGroup { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[doc = "Represents a VM/server group and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] + pub properties: AppWhitelistingGroupData, +} +impl AppWhitelistingGroup { + pub fn new(properties: AppWhitelistingGroupData) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[doc = "Represents a VM/server group and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingGroupData { + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(rename = "enforcementMode", default, skip_serializing_if = "Option::is_none")] + pub enforcement_mode: Option, + #[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] + #[serde(rename = "protectionMode", default, skip_serializing_if = "Option::is_none")] + pub protection_mode: Option, + #[doc = "The configuration status of the VM/server group or machine or rule on the machine"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, + #[doc = "The recommendation status of the VM/server group or VM/server"] + #[serde(rename = "recommendationStatus", default, skip_serializing_if = "Option::is_none")] + pub recommendation_status: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issues: Option, + #[doc = "The source type of the VM/server group"] + #[serde(rename = "sourceSystem", default, skip_serializing_if = "Option::is_none")] + pub source_system: Option, + #[serde(rename = "vmRecommendations", default, skip_serializing_if = "Option::is_none")] + pub vm_recommendations: Option, + #[serde(rename = "pathRecommendations", default, skip_serializing_if = "Option::is_none")] + pub path_recommendations: Option, +} +impl AppWhitelistingGroupData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingGroups { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl AppWhitelistingGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An alert that VMs/servers within a group can have"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum AppWhitelistingIssue { + ViolationsAudited, + ViolationsBlocked, + MsiAndScriptViolationsAudited, + MsiAndScriptViolationsBlocked, + ExecutableViolationsAudited, + RulesViolatedManually, +} +#[doc = "Represents a summary of the alerts of the VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingIssueSummary { + #[doc = "An alert that VMs/servers within a group can have"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issue: Option, + #[doc = "The number of machines in the VM/server group that have this alert"] + #[serde(rename = "numberOfVms", default, skip_serializing_if = "Option::is_none")] + pub number_of_vms: Option, +} +impl AppWhitelistingIssueSummary { + pub fn new() -> Self { + Self::default() + } +} +pub type AppWhitelistingIssuesSummaries = Vec; +#[doc = "The altered data of the recommended VM/server group policy"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingPutGroupData { + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(rename = "enforcementMode", default, skip_serializing_if = "Option::is_none")] + pub enforcement_mode: Option, + #[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] + #[serde(rename = "protectionMode", default, skip_serializing_if = "Option::is_none")] + pub protection_mode: Option, + #[serde(rename = "vmRecommendations", default, skip_serializing_if = "Option::is_none")] + pub vm_recommendations: Option, + #[serde(rename = "pathRecommendations", default, skip_serializing_if = "Option::is_none")] + pub path_recommendations: Option, +} +impl AppWhitelistingPutGroupData { + pub fn new() -> Self { + Self::default() + } +} +pub type AppWhitelistingResourceType = String; +#[doc = "The ASC location of the subscription is in the \"name\" field"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "An empty set of properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AscLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of locations where ASC saves your data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocationList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AscLocationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AscLocationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An empty set of properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocationProperties {} +impl AscLocationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents an ATA security solution which sends logs to an OMS workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AtaExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AtaExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AtaSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(rename = "lastEventReceived", default, skip_serializing_if = "Option::is_none")] + pub last_event_received: Option, +} +impl AtaSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for cloud authentication management"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationDetailsProperties { + #[doc = "State of the multi-cloud connector"] + #[serde(rename = "authenticationProvisioningState", default, skip_serializing_if = "Option::is_none")] + pub authentication_provisioning_state: Option, + #[doc = "The permissions detected in the cloud account."] + #[serde( + rename = "grantedPermissions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub granted_permissions: Vec, + #[doc = "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials."] + #[serde(rename = "authenticationType")] + pub authentication_type: authentication_details_properties::AuthenticationType, +} +impl AuthenticationDetailsProperties { + pub fn new(authentication_type: authentication_details_properties::AuthenticationType) -> Self { + Self { + authentication_provisioning_state: None, + granted_permissions: Vec::new(), + authentication_type, + } + } +} +pub mod authentication_details_properties { + use super::*; + #[doc = "State of the multi-cloud connector"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthenticationProvisioningState")] + pub enum AuthenticationProvisioningState { + Valid, + Invalid, + Expired, + IncorrectPolicy, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AuthenticationProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthenticationProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthenticationProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("AuthenticationProvisioningState", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("AuthenticationProvisioningState", 1u32, "Invalid"), + Self::Expired => serializer.serialize_unit_variant("AuthenticationProvisioningState", 2u32, "Expired"), + Self::IncorrectPolicy => serializer.serialize_unit_variant("AuthenticationProvisioningState", 3u32, "IncorrectPolicy"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthenticationType")] + pub enum AuthenticationType { + #[serde(rename = "awsCreds")] + AwsCreds, + #[serde(rename = "awsAssumeRole")] + AwsAssumeRole, + #[serde(rename = "gcpCredentials")] + GcpCredentials, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AuthenticationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthenticationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthenticationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsCreds => serializer.serialize_unit_variant("AuthenticationType", 0u32, "awsCreds"), + Self::AwsAssumeRole => serializer.serialize_unit_variant("AuthenticationType", 1u32, "awsAssumeRole"), + Self::GcpCredentials => serializer.serialize_unit_variant("AuthenticationType", 2u32, "gcpCredentials"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Auto provisioning setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoProvisioningSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of an auto provisioning setting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AutoProvisioningSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of all the auto provisioning settings response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoProvisioningSettingList { + #[doc = "List of all the auto provisioning settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AutoProvisioningSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AutoProvisioningSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of an auto provisioning setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutoProvisioningSettingProperties { + #[doc = "Describes what kind of security agent provisioning action to take"] + #[serde(rename = "autoProvision")] + pub auto_provision: auto_provisioning_setting_properties::AutoProvision, +} +impl AutoProvisioningSettingProperties { + pub fn new(auto_provision: auto_provisioning_setting_properties::AutoProvision) -> Self { + Self { auto_provision } + } +} +pub mod auto_provisioning_setting_properties { + use super::*; + #[doc = "Describes what kind of security agent provisioning action to take"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoProvision")] + pub enum AutoProvision { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoProvision { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoProvision { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoProvision { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("AutoProvision", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("AutoProvision", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The security automation resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Automation { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "A set of properties that defines the behavior of the automation configuration. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Automation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The action that should be triggered."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationAction { + #[doc = "The type of the action that will be triggered by the Automation"] + #[serde(rename = "actionType")] + pub action_type: automation_action::ActionType, +} +impl AutomationAction { + pub fn new(action_type: automation_action::ActionType) -> Self { + Self { action_type } + } +} +pub mod automation_action { + use super::*; + #[doc = "The type of the action that will be triggered by the Automation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + LogicApp, + EventHub, + Workspace, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::LogicApp => serializer.serialize_unit_variant("ActionType", 0u32, "LogicApp"), + Self::EventHub => serializer.serialize_unit_variant("ActionType", 1u32, "EventHub"), + Self::Workspace => serializer.serialize_unit_variant("ActionType", 2u32, "Workspace"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionEventHub { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The target Event Hub Azure Resource ID."] + #[serde(rename = "eventHubResourceId", default, skip_serializing_if = "Option::is_none")] + pub event_hub_resource_id: Option, + #[doc = "The target Event Hub SAS policy name."] + #[serde(rename = "sasPolicyName", default, skip_serializing_if = "Option::is_none")] + pub sas_policy_name: Option, + #[doc = "The target Event Hub connection string (it will not be included in any response)."] + #[serde(rename = "connectionString", default, skip_serializing_if = "Option::is_none")] + pub connection_string: Option, +} +impl AutomationActionEventHub { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + event_hub_resource_id: None, + sas_policy_name: None, + connection_string: None, + } + } +} +#[doc = "The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionLogicApp { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App"] + #[serde(rename = "logicAppResourceId", default, skip_serializing_if = "Option::is_none")] + pub logic_app_resource_id: Option, + #[doc = "The Logic App trigger URI endpoint (it will not be included in any response)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} +impl AutomationActionLogicApp { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + logic_app_resource_id: None, + uri: None, + } + } +} +#[doc = "The\u{a0}Log\u{a0}Analytics\u{a0}Workspace\u{a0}to\u{a0}which\u{a0}event data will be exported. Security alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionWorkspace { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The fully qualified Log Analytics Workspace Azure Resource ID."] + #[serde(rename = "workspaceResourceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_resource_id: Option, +} +impl AutomationActionWorkspace { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + workspace_resource_id: None, + } + } +} +#[doc = "List of security automations response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationList { + #[doc = "The list of security automations under the given scope."] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AutomationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AutomationList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "A set of properties that defines the behavior of the automation configuration. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationProperties { + #[doc = "The security automation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Indicates whether the security automation is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option, + #[doc = "A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub scopes: Vec, + #[doc = "A collection of the source event types which evaluate the security automation set of rules."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub sources: Vec, + #[doc = "A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub actions: Vec, +} +impl AutomationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationRuleSet { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, +} +impl AutomationRuleSet { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A single automation scope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationScope { + #[doc = "The resources scope description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs)."] + #[serde(rename = "scopePath", default, skip_serializing_if = "Option::is_none")] + pub scope_path: Option, +} +impl AutomationScope { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The source event types which evaluate the security automation set of rules. For example - security alerts and security assessments. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationSource { + #[doc = "A valid event source type."] + #[serde(rename = "eventSource", default, skip_serializing_if = "Option::is_none")] + pub event_source: Option, + #[doc = "A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or')."] + #[serde( + rename = "ruleSets", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rule_sets: Vec, +} +impl AutomationSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod automation_source { + use super::*; + #[doc = "A valid event source type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventSource")] + pub enum EventSource { + Assessments, + AssessmentsSnapshot, + SubAssessments, + SubAssessmentsSnapshot, + Alerts, + SecureScores, + SecureScoresSnapshot, + SecureScoreControls, + SecureScoreControlsSnapshot, + RegulatoryComplianceAssessment, + RegulatoryComplianceAssessmentSnapshot, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventSource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventSource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventSource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Assessments => serializer.serialize_unit_variant("EventSource", 0u32, "Assessments"), + Self::AssessmentsSnapshot => serializer.serialize_unit_variant("EventSource", 1u32, "AssessmentsSnapshot"), + Self::SubAssessments => serializer.serialize_unit_variant("EventSource", 2u32, "SubAssessments"), + Self::SubAssessmentsSnapshot => serializer.serialize_unit_variant("EventSource", 3u32, "SubAssessmentsSnapshot"), + Self::Alerts => serializer.serialize_unit_variant("EventSource", 4u32, "Alerts"), + Self::SecureScores => serializer.serialize_unit_variant("EventSource", 5u32, "SecureScores"), + Self::SecureScoresSnapshot => serializer.serialize_unit_variant("EventSource", 6u32, "SecureScoresSnapshot"), + Self::SecureScoreControls => serializer.serialize_unit_variant("EventSource", 7u32, "SecureScoreControls"), + Self::SecureScoreControlsSnapshot => serializer.serialize_unit_variant("EventSource", 8u32, "SecureScoreControlsSnapshot"), + Self::RegulatoryComplianceAssessment => { + serializer.serialize_unit_variant("EventSource", 9u32, "RegulatoryComplianceAssessment") + } + Self::RegulatoryComplianceAssessmentSnapshot => { + serializer.serialize_unit_variant("EventSource", 10u32, "RegulatoryComplianceAssessmentSnapshot") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the event model to an expected value. This comparison is done by using one of the supported operators set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationTriggeringRule { + #[doc = "The JPath of the entity model property that should be checked."] + #[serde(rename = "propertyJPath", default, skip_serializing_if = "Option::is_none")] + pub property_j_path: Option, + #[doc = "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]"] + #[serde(rename = "propertyType", default, skip_serializing_if = "Option::is_none")] + pub property_type: Option, + #[doc = "The expected value."] + #[serde(rename = "expectedValue", default, skip_serializing_if = "Option::is_none")] + pub expected_value: Option, + #[doc = "A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, +} +impl AutomationTriggeringRule { + pub fn new() -> Self { + Self::default() + } +} +pub mod automation_triggering_rule { + use super::*; + #[doc = "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PropertyType")] + pub enum PropertyType { + String, + Integer, + Number, + Boolean, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PropertyType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PropertyType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PropertyType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::String => serializer.serialize_unit_variant("PropertyType", 0u32, "String"), + Self::Integer => serializer.serialize_unit_variant("PropertyType", 1u32, "Integer"), + Self::Number => serializer.serialize_unit_variant("PropertyType", 2u32, "Number"), + Self::Boolean => serializer.serialize_unit_variant("PropertyType", 3u32, "Boolean"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + Equals, + GreaterThan, + GreaterThanOrEqualTo, + LesserThan, + LesserThanOrEqualTo, + NotEquals, + Contains, + StartsWith, + EndsWith, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Equals => serializer.serialize_unit_variant("Operator", 0u32, "Equals"), + Self::GreaterThan => serializer.serialize_unit_variant("Operator", 1u32, "GreaterThan"), + Self::GreaterThanOrEqualTo => serializer.serialize_unit_variant("Operator", 2u32, "GreaterThanOrEqualTo"), + Self::LesserThan => serializer.serialize_unit_variant("Operator", 3u32, "LesserThan"), + Self::LesserThanOrEqualTo => serializer.serialize_unit_variant("Operator", 4u32, "LesserThanOrEqualTo"), + Self::NotEquals => serializer.serialize_unit_variant("Operator", 5u32, "NotEquals"), + Self::Contains => serializer.serialize_unit_variant("Operator", 6u32, "Contains"), + Self::StartsWith => serializer.serialize_unit_variant("Operator", 7u32, "StartsWith"), + Self::EndsWith => serializer.serialize_unit_variant("Operator", 8u32, "EndsWith"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The security automation model state property bag."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationValidationStatus { + #[doc = "Indicates whether the model is valid or not."] + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option, + #[doc = "The validation message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl AutomationValidationStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AWS cloud account connector based assume role, the role enables delegating access to your AWS resources. The role is composed of role Amazon Resource Name (ARN) and external ID. For more details, refer to Creating a Role to Delegate Permissions to an IAM User (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwAssumeRoleAuthenticationDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The ID of the cloud account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "Assumed role ID is an identifier that you can use to create temporary security credentials."] + #[serde(rename = "awsAssumeRoleArn")] + pub aws_assume_role_arn: String, + #[doc = "A unique identifier that is required when you assume a role in another account."] + #[serde(rename = "awsExternalId")] + pub aws_external_id: String, +} +impl AwAssumeRoleAuthenticationDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + aws_assume_role_arn: String, + aws_external_id: String, + ) -> Self { + Self { + authentication_details_properties, + account_id: None, + aws_assume_role_arn, + aws_external_id, + } + } +} +#[doc = "AWS cloud account connector based credentials, the credentials is composed of access key ID and secret key, for more details, refer to Creating an IAM User in Your AWS Account (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsCredsAuthenticationDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The ID of the cloud account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "Public key element of the AWS credential object (write only)"] + #[serde(rename = "awsAccessKeyId")] + pub aws_access_key_id: String, + #[doc = "Secret key element of the AWS credential object (write only)"] + #[serde(rename = "awsSecretAccessKey")] + pub aws_secret_access_key: String, +} +impl AwsCredsAuthenticationDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + aws_access_key_id: String, + aws_secret_access_key: String, + ) -> Self { + Self { + authentication_details_properties, + account_id: None, + aws_access_key_id, + aws_secret_access_key, + } + } +} +#[doc = "The aws connector environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, + #[doc = "The awsOrganization data "] + #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] + pub organizational_data: Option, +} +impl AwsEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { + environment_data, + organizational_data: None, + } + } +} +#[doc = "The awsOrganization data "] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalData { + #[doc = "The multi cloud account's membership type in the organization"] + #[serde(rename = "organizationMembershipType")] + pub organization_membership_type: aws_organizational_data::OrganizationMembershipType, +} +impl AwsOrganizationalData { + pub fn new(organization_membership_type: aws_organizational_data::OrganizationMembershipType) -> Self { + Self { + organization_membership_type, + } + } +} +pub mod aws_organizational_data { + use super::*; + #[doc = "The multi cloud account's membership type in the organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OrganizationMembershipType")] + pub enum OrganizationMembershipType { + Member, + Organization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OrganizationMembershipType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OrganizationMembershipType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OrganizationMembershipType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), + Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The awsOrganization data for the master account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalDataMaster { + #[serde(flatten)] + pub aws_organizational_data: AwsOrganizationalData, + #[doc = "If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset"] + #[serde(rename = "stacksetName", default, skip_serializing_if = "Option::is_none")] + pub stackset_name: Option, + #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] + #[serde( + rename = "excludedAccountIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_account_ids: Vec, +} +impl AwsOrganizationalDataMaster { + pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { + Self { + aws_organizational_data, + stackset_name: None, + excluded_account_ids: Vec::new(), + } + } +} +#[doc = "The awsOrganization data for the member account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalDataMember { + #[serde(flatten)] + pub aws_organizational_data: AwsOrganizationalData, + #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the account's parent"] + #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] + pub parent_hierarchy_id: Option, +} +impl AwsOrganizationalDataMember { + pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { + Self { + aws_organizational_data, + parent_hierarchy_id: None, + } + } +} +#[doc = "The AzureDevOps scope connector's environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureDevOpsScopeEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, +} +impl AzureDevOpsScopeEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { environment_data } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureResourceLink { + #[doc = "Azure resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl AzureResourceLink { + pub fn new() -> Self { + Self::default() + } +} +pub type AzureResourceLinks = Vec; +#[doc = "Describes an Azure resource with location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureTrackedResourceLocation { + #[doc = "Location where the resource is stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl AzureTrackedResourceLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Baseline details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Baseline { + #[doc = "Expected results."] + #[serde( + rename = "expectedResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub expected_results: Vec>, + #[doc = "Baseline update time (UTC)."] + #[serde(rename = "updatedTime", default, with = "azure_core::date::rfc3339::option")] + pub updated_time: Option, +} +impl Baseline { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule result adjusted with baseline."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BaselineAdjustedResult { + #[doc = "Baseline details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub baseline: Option, + #[doc = "The rule result status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Results the are not in baseline."] + #[serde( + rename = "resultsNotInBaseline", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results_not_in_baseline: Vec>, + #[doc = "Results the are in baseline."] + #[serde( + rename = "resultsOnlyInBaseline", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results_only_in_baseline: Vec>, +} +impl BaselineAdjustedResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The benchmark references."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenchmarkReference { + #[doc = "The benchmark name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub benchmark: Option, + #[doc = "The benchmark reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reference: Option, +} +impl BenchmarkReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "CVE details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cve { + #[doc = "CVE title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Link url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option, +} +impl Cve { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "CVSS details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cvss { + #[doc = "CVSS base"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub base: Option, +} +impl Cvss { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a security solution which sends CEF logs to an OMS workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CefExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CefExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CefSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option, + #[serde(rename = "lastEventReceived", default, skip_serializing_if = "Option::is_none")] + pub last_event_received: Option, +} +impl CefSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudError { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for CloudError { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl CloudError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudErrorBody { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl CloudErrorBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Compliance of a scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Compliance { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Compliance { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of Compliance objects response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceList { + #[doc = "List of Compliance objects"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ComplianceList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ComplianceList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceProperties { + #[doc = "The timestamp when the Compliance calculation was conducted."] + #[serde(rename = "assessmentTimestampUtcDate", default, with = "azure_core::date::rfc3339::option")] + pub assessment_timestamp_utc_date: Option, + #[doc = "The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation)."] + #[serde(rename = "resourceCount", default, skip_serializing_if = "Option::is_none")] + pub resource_count: Option, + #[doc = "An array of segment, which is the actually the compliance assessment."] + #[serde( + rename = "assessmentResult", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub assessment_result: Vec, +} +impl ComplianceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A segment of a compliance assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceSegment { + #[doc = "The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc."] + #[serde(rename = "segmentType", default, skip_serializing_if = "Option::is_none")] + pub segment_type: Option, + #[doc = "The size (%) of the segment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl ComplianceSegment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The configuration status of the VM/server group or machine or rule on the machine"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum ConfigurationStatus { + Configured, + NotConfigured, + InProgress, + Failed, + NoStatus, +} +#[doc = "Describes the allowed inbound and outbound traffic of an Azure resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectableResource { + #[doc = "The Azure resource id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The list of Azure resources that the resource has inbound allowed connection from"] + #[serde( + rename = "inboundConnectedResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_connected_resources: Vec, + #[doc = "The list of Azure resources that the resource has outbound allowed connection to"] + #[serde( + rename = "outboundConnectedResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub outbound_connected_resources: Vec, +} +impl ConnectableResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a connected resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectedResource { + #[doc = "The Azure resource id of the connected resource"] + #[serde(rename = "connectedResourceId", default, skip_serializing_if = "Option::is_none")] + pub connected_resource_id: Option, + #[doc = "The allowed tcp ports"] + #[serde(rename = "tcpPorts", default, skip_serializing_if = "Option::is_none")] + pub tcp_ports: Option, + #[doc = "The allowed udp ports"] + #[serde(rename = "udpPorts", default, skip_serializing_if = "Option::is_none")] + pub udp_ports: Option, +} +impl ConnectedResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectedWorkspace { + #[doc = "Azure resource ID of the connected OMS workspace"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ConnectedWorkspace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Connection string for ingesting security data and logs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionStrings { + #[doc = "Connection strings"] + pub value: Vec, +} +impl ConnectionStrings { + pub fn new(value: Vec) -> Self { + Self { value } + } +} +#[doc = "Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionToIpNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ConnectionToIpNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "The connector setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a connector setting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ConnectorSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "For a subscription, list of all cloud account connectors and their settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSettingList { + #[doc = "List of all the cloud account connector settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ConnectorSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ConnectorSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a connector setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSettingProperties { + #[doc = "Settings for hybrid compute management"] + #[serde(rename = "hybridComputeSettings", default, skip_serializing_if = "Option::is_none")] + pub hybrid_compute_settings: Option, + #[doc = "Settings for cloud authentication management"] + #[serde(rename = "authenticationDetails", default, skip_serializing_if = "Option::is_none")] + pub authentication_details: Option, +} +impl ConnectorSettingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Additional context fields for container registry Vulnerability assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ContainerRegistryVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Dictionary from cvss version to cvss details object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cvss: Option, + #[doc = "Indicates whether a patch is available or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patchable: Option, + #[doc = "List of CVEs"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cve: Vec, + #[doc = "Published time"] + #[serde(rename = "publishedTime", default, with = "azure_core::date::rfc3339::option")] + pub published_time: Option, + #[serde( + rename = "vendorReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vendor_references: Vec, + #[doc = "Name of the repository which the vulnerable image belongs to"] + #[serde(rename = "repositoryName", default, skip_serializing_if = "Option::is_none")] + pub repository_name: Option, + #[doc = "Digest of the vulnerable image"] + #[serde(rename = "imageDigest", default, skip_serializing_if = "Option::is_none")] + pub image_digest: Option, +} +impl ContainerRegistryVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + cvss: None, + patchable: None, + cve: Vec::new(), + published_time: None, + vendor_references: Vec::new(), + repository_name: None, + image_digest: None, + } + } +} +#[doc = "A custom alert rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CustomAlertRule { + #[doc = "The display name of the custom alert."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the custom alert."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Status of the custom alert."] + #[serde(rename = "isEnabled")] + pub is_enabled: bool, + #[doc = "The type of the custom alert rule."] + #[serde(rename = "ruleType")] + pub rule_type: String, +} +impl CustomAlertRule { + pub fn new(is_enabled: bool, rule_type: String) -> Self { + Self { + display_name: None, + description: None, + is_enabled, + rule_type, + } + } +} +#[doc = "Custom entity store assignment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "describes the custom entity store assignment properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomEntityStoreAssignment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the custom entity store assignment properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentProperties { + #[doc = "The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub principal: Option, + #[doc = "The link to entity store database."] + #[serde(rename = "entityStoreDatabaseLink", default, skip_serializing_if = "Option::is_none")] + pub entity_store_database_link: Option, +} +impl CustomEntityStoreAssignmentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the custom entity store assignment request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentRequest { + #[doc = "describes properties of custom entity store assignment request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomEntityStoreAssignmentRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of custom entity store assignment request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentRequestProperties { + #[doc = "The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub principal: Option, +} +impl CustomEntityStoreAssignmentRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of custom entity store assignments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentsListResult { + #[doc = "Collection of custom entity store assignments"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CustomEntityStoreAssignmentsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CustomEntityStoreAssignmentsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a data export setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSetting { + #[serde(flatten)] + pub setting: Setting, + #[doc = "The data export setting properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DataExportSetting { + pub fn new(setting: Setting) -> Self { + Self { setting, properties: None } + } +} +#[doc = "The data export setting properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSettingProperties { + #[doc = "Is the data export setting is enabled"] + pub enabled: bool, +} +impl DataExportSettingProperties { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is denied."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DenylistCustomAlertRule { + #[serde(flatten)] + pub list_custom_alert_rule: ListCustomAlertRule, + #[doc = "The values to deny. The format of the values depends on the rule type."] + #[serde(rename = "denylistValues")] + pub denylist_values: Vec, +} +impl DenylistCustomAlertRule { + pub fn new(list_custom_alert_rule: ListCustomAlertRule, denylist_values: Vec) -> Self { + Self { + list_custom_alert_rule, + denylist_values, + } + } +} +#[doc = "The device security group resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroup { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of a security group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DeviceSecurityGroup { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of device security groups"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroupList { + #[doc = "List of device security group objects"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceSecurityGroupList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DeviceSecurityGroupList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of a security group."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroupProperties { + #[doc = "The list of custom alert threshold rules."] + #[serde( + rename = "thresholdRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub threshold_rules: Vec, + #[doc = "The list of custom alert time-window rules."] + #[serde( + rename = "timeWindowRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub time_window_rules: Vec, + #[doc = "The allow-list custom alert rules."] + #[serde( + rename = "allowlistRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowlist_rules: Vec, + #[doc = "The deny-list custom alert rules."] + #[serde( + rename = "denylistRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub denylist_rules: Vec, +} +impl DeviceSecurityGroupProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of direct method invokes is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DirectMethodInvokesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl DirectMethodInvokesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiscoveredSecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + pub properties: DiscoveredSecuritySolutionProperties, +} +impl DiscoveredSecuritySolution { + pub fn new(properties: DiscoveredSecuritySolutionProperties) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiscoveredSecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DiscoveredSecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DiscoveredSecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiscoveredSecuritySolutionProperties { + #[doc = "The security family of the discovered solution"] + #[serde(rename = "securityFamily")] + pub security_family: discovered_security_solution_properties::SecurityFamily, + #[doc = "The security solutions' image offer"] + pub offer: String, + #[doc = "The security solutions' image publisher"] + pub publisher: String, + #[doc = "The security solutions' image sku"] + pub sku: String, +} +impl DiscoveredSecuritySolutionProperties { + pub fn new( + security_family: discovered_security_solution_properties::SecurityFamily, + offer: String, + publisher: String, + sku: String, + ) -> Self { + Self { + security_family, + offer, + publisher, + sku, + } + } +} +pub mod discovered_security_solution_properties { + use super::*; + #[doc = "The security family of the discovered solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SecurityFamily")] + pub enum SecurityFamily { + Waf, + Ngfw, + SaasWaf, + Va, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SecurityFamily { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SecurityFamily { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SecurityFamily { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Waf => serializer.serialize_unit_variant("SecurityFamily", 0u32, "Waf"), + Self::Ngfw => serializer.serialize_unit_variant("SecurityFamily", 1u32, "Ngfw"), + Self::SaasWaf => serializer.serialize_unit_variant("SecurityFamily", 2u32, "SaasWaf"), + Self::Va => serializer.serialize_unit_variant("SecurityFamily", 3u32, "Va"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ETag { + #[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl ETag { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the Network Security Groups effective on a network interface"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EffectiveNetworkSecurityGroups { + #[doc = "The Azure resource ID of the network interface"] + #[serde(rename = "networkInterface", default, skip_serializing_if = "Option::is_none")] + pub network_interface: Option, + #[doc = "The Network Security Groups effective on the network interface"] + #[serde( + rename = "networkSecurityGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_security_groups: Vec, +} +impl EffectiveNetworkSecurityGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The application control policy enforcement/protection mode of the VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum EnforcementMode { + Audit, + Enforce, + None, +} +#[doc = "The VM/server supportability of Enforce feature"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum EnforcementSupport { + Supported, + NotSupported, + Unknown, +} +#[doc = "The security connector environment data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnvironmentData { + #[doc = "The type of the environment data."] + #[serde(rename = "environmentType")] + pub environment_type: environment_data::EnvironmentType, +} +impl EnvironmentData { + pub fn new(environment_type: environment_data::EnvironmentType) -> Self { + Self { environment_type } + } +} +pub mod environment_data { + use super::*; + #[doc = "The type of the environment data."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EnvironmentType")] + pub enum EnvironmentType { + AwsAccount, + GcpProject, + GithubScope, + AzureDevOpsScope, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EnvironmentType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EnvironmentType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EnvironmentType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsAccount => serializer.serialize_unit_variant("EnvironmentType", 0u32, "AwsAccount"), + Self::GcpProject => serializer.serialize_unit_variant("EnvironmentType", 1u32, "GcpProject"), + Self::GithubScope => serializer.serialize_unit_variant("EnvironmentType", 2u32, "GithubScope"), + Self::AzureDevOpsScope => serializer.serialize_unit_variant("EnvironmentType", 3u32, "AzureDevOpsScope"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub external_security_solution_kind: ExternalSecuritySolutionKind, + #[serde(flatten)] + pub location: Location, +} +impl ExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionKind { + #[doc = "The kind of the external solution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl ExternalSecuritySolutionKind { + pub fn new() -> Self { + Self::default() + } +} +pub mod external_security_solution_kind { + use super::*; + #[doc = "The kind of the external solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + #[serde(rename = "CEF")] + Cef, + #[serde(rename = "ATA")] + Ata, + #[serde(rename = "AAD")] + Aad, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Cef => serializer.serialize_unit_variant("Kind", 0u32, "CEF"), + Self::Ata => serializer.serialize_unit_variant("Kind", 1u32, "ATA"), + Self::Aad => serializer.serialize_unit_variant("Kind", 2u32, "AAD"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExternalSecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExternalSecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The solution properties (correspond to the solution kind)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionProperties { + #[serde(rename = "deviceVendor", default, skip_serializing_if = "Option::is_none")] + pub device_vendor: Option, + #[serde(rename = "deviceType", default, skip_serializing_if = "Option::is_none")] + pub device_type: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option, +} +impl ExternalSecuritySolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of failed local logins is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FailedLocalLoginsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl FailedLocalLoginsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The type of the file (for Linux files - Executable is used)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum FileType { + Exe, + Dll, + Msi, + Script, + Executable, + Unknown, +} +#[doc = "Number of file uploads is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileUploadsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl FileUploadsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID and a JSON API key (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpCredentialsDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The organization ID of the GCP cloud account"] + #[serde(rename = "organizationId")] + pub organization_id: String, + #[doc = "Type field of the API key (write only)"] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Project ID field of the API key (write only)"] + #[serde(rename = "projectId")] + pub project_id: String, + #[doc = "Private key ID field of the API key (write only)"] + #[serde(rename = "privateKeyId")] + pub private_key_id: String, + #[doc = "Private key field of the API key (write only)"] + #[serde(rename = "privateKey")] + pub private_key: String, + #[doc = "Client email field of the API key (write only)"] + #[serde(rename = "clientEmail")] + pub client_email: String, + #[doc = "Client ID field of the API key (write only)"] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Auth URI field of the API key (write only)"] + #[serde(rename = "authUri")] + pub auth_uri: String, + #[doc = "Token URI field of the API key (write only)"] + #[serde(rename = "tokenUri")] + pub token_uri: String, + #[doc = "Auth provider x509 certificate URL field of the API key (write only)"] + #[serde(rename = "authProviderX509CertUrl")] + pub auth_provider_x509_cert_url: String, + #[doc = "Client x509 certificate URL field of the API key (write only)"] + #[serde(rename = "clientX509CertUrl")] + pub client_x509_cert_url: String, +} +impl GcpCredentialsDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + organization_id: String, + type_: String, + project_id: String, + private_key_id: String, + private_key: String, + client_email: String, + client_id: String, + auth_uri: String, + token_uri: String, + auth_provider_x509_cert_url: String, + client_x509_cert_url: String, + ) -> Self { + Self { + authentication_details_properties, + organization_id, + type_, + project_id, + private_key_id, + private_key, + client_email, + client_id, + auth_uri, + token_uri, + auth_provider_x509_cert_url, + client_x509_cert_url, + } + } +} +#[doc = "The gcpOrganization data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalData { + #[doc = "The multi cloud account's membership type in the organization"] + #[serde(rename = "organizationMembershipType")] + pub organization_membership_type: gcp_organizational_data::OrganizationMembershipType, +} +impl GcpOrganizationalData { + pub fn new(organization_membership_type: gcp_organizational_data::OrganizationMembershipType) -> Self { + Self { + organization_membership_type, + } + } +} +pub mod gcp_organizational_data { + use super::*; + #[doc = "The multi cloud account's membership type in the organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OrganizationMembershipType")] + pub enum OrganizationMembershipType { + Member, + Organization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OrganizationMembershipType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OrganizationMembershipType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OrganizationMembershipType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), + Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The gcpOrganization data for the member account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalDataMember { + #[serde(flatten)] + pub gcp_organizational_data: GcpOrganizationalData, + #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the project's parent"] + #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] + pub parent_hierarchy_id: Option, + #[doc = "The GCP management project number from organizational onboarding"] + #[serde(rename = "managementProjectNumber", default, skip_serializing_if = "Option::is_none")] + pub management_project_number: Option, +} +impl GcpOrganizationalDataMember { + pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { + Self { + gcp_organizational_data, + parent_hierarchy_id: None, + management_project_number: None, + } + } +} +#[doc = "The gcpOrganization data for the parent account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalDataOrganization { + #[serde(flatten)] + pub gcp_organizational_data: GcpOrganizationalData, + #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] + #[serde( + rename = "excludedProjectNumbers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_project_numbers: Vec, + #[doc = "The service account email address which represents the organization level permissions container."] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id which represents the permissions required to auto provision security connectors"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, +} +impl GcpOrganizationalDataOrganization { + pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { + Self { + gcp_organizational_data, + excluded_project_numbers: Vec::new(), + service_account_email_address: None, + workload_identity_provider_id: None, + } + } +} +#[doc = "The details about the project represented by the security connector"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GcpProjectDetails { + #[doc = "The unique GCP Project number"] + #[serde(rename = "projectNumber", default, skip_serializing_if = "Option::is_none")] + pub project_number: Option, + #[doc = "The GCP Project id"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option, + #[doc = "The GCP workload identity federation pool id"] + #[serde(rename = "workloadIdentityPoolId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_pool_id: Option, +} +impl GcpProjectDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The GCP project connector environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpProjectEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, + #[doc = "The gcpOrganization data"] + #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] + pub organizational_data: Option, + #[doc = "The details about the project represented by the security connector"] + #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] + pub project_details: Option, +} +impl GcpProjectEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { + environment_data, + organizational_data: None, + project_details: None, + } + } +} +#[doc = "The github scope connector's environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GithubScopeEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, +} +impl GithubScopeEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { environment_data } + } +} +pub type GroupResourceId = String; +#[doc = "Number of cloud to device messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Settings for hybrid compute management"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridComputeSettingsProperties { + #[doc = "State of the service principal and its secret"] + #[serde(rename = "hybridComputeProvisioningState", default, skip_serializing_if = "Option::is_none")] + pub hybrid_compute_provisioning_state: Option, + #[doc = "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines"] + #[serde(rename = "autoProvision")] + pub auto_provision: hybrid_compute_settings_properties::AutoProvision, + #[doc = "The name of the resource group where Arc (Hybrid Compute) connectors are connected."] + #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] + pub resource_group_name: Option, + #[doc = "The location where the metadata of machines will be stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use."] + #[serde(rename = "proxyServer", default, skip_serializing_if = "Option::is_none")] + pub proxy_server: Option, + #[doc = "Details of the service principal."] + #[serde(rename = "servicePrincipal", default, skip_serializing_if = "Option::is_none")] + pub service_principal: Option, +} +impl HybridComputeSettingsProperties { + pub fn new(auto_provision: hybrid_compute_settings_properties::AutoProvision) -> Self { + Self { + hybrid_compute_provisioning_state: None, + auto_provision, + resource_group_name: None, + region: None, + proxy_server: None, + service_principal: None, + } + } +} +pub mod hybrid_compute_settings_properties { + use super::*; + #[doc = "State of the service principal and its secret"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "HybridComputeProvisioningState")] + pub enum HybridComputeProvisioningState { + Valid, + Invalid, + Expired, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for HybridComputeProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for HybridComputeProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for HybridComputeProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("HybridComputeProvisioningState", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("HybridComputeProvisioningState", 1u32, "Invalid"), + Self::Expired => serializer.serialize_unit_variant("HybridComputeProvisioningState", 2u32, "Expired"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoProvision")] + pub enum AutoProvision { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoProvision { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoProvision { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoProvision { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("AutoProvision", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("AutoProvision", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The information type keyword."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionKeyword { + #[doc = "The keyword pattern."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option, + #[doc = "Indicates whether the keyword is custom or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[doc = "Indicates whether the keyword can be applied on numeric types or not."] + #[serde(rename = "canBeNumeric", default, skip_serializing_if = "Option::is_none")] + pub can_be_numeric: Option, + #[doc = "Indicates whether the keyword is excluded or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub excluded: Option, +} +impl InformationProtectionKeyword { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information protection policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicy { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of an information protection policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl InformationProtectionPolicy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information protection policies response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicyList { + #[doc = "List of information protection policies."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for InformationProtectionPolicyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl InformationProtectionPolicyList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of an information protection policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicyProperties { + #[doc = "Describes the last UTC time the policy was modified."] + #[serde(rename = "lastModifiedUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_utc: Option, + #[doc = "Describes the version of the policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Dictionary of sensitivity labels."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub labels: Option, + #[doc = "The sensitivity information types."] + #[serde(rename = "informationTypes", default, skip_serializing_if = "Option::is_none")] + pub information_types: Option, +} +impl InformationProtectionPolicyProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The information type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationType { + #[doc = "The name of the information type."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the information type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The order of the information type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "The recommended label id to be associated with this information type."] + #[serde(rename = "recommendedLabelId", default, skip_serializing_if = "Option::is_none")] + pub recommended_label_id: Option, + #[doc = "Indicates whether the information type is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "Indicates whether the information type is custom or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[doc = "The information type keywords."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub keywords: Vec, +} +impl InformationType { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Connection string for ingesting security data and logs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionConnectionString { + #[doc = "The region where ingested logs and data resides"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Connection string value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl IngestionConnectionString { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Configures how to correlate scan data and logs with resources associated with the subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Ingestion setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IngestionSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of ingestion settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingList { + #[doc = "List of ingestion settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IngestionSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IngestionSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Ingestion setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingProperties {} +impl IngestionSettingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Configures how to correlate scan data and logs with resources associated with the subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingToken { + #[doc = "The token is used for correlating security data and logs with the resources in the subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option, +} +impl IngestionSettingToken { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JitNetworkAccessPoliciesList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for JitNetworkAccessPoliciesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl JitNetworkAccessPoliciesList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicy { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub kind: Kind, + #[serde(flatten)] + pub location: Location, + pub properties: JitNetworkAccessPolicyProperties, +} +impl JitNetworkAccessPolicy { + pub fn new(properties: JitNetworkAccessPolicyProperties) -> Self { + Self { + resource: Resource::default(), + kind: Kind::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiatePort { + pub number: PortNumber, + #[doc = "Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "The time to close the request in UTC"] + #[serde(rename = "endTimeUtc", with = "azure_core::date::rfc3339")] + pub end_time_utc: time::OffsetDateTime, +} +impl JitNetworkAccessPolicyInitiatePort { + pub fn new(number: PortNumber, end_time_utc: time::OffsetDateTime) -> Self { + Self { + number, + allowed_source_address_prefix: None, + end_time_utc, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiateRequest { + #[doc = "A list of virtual machines & ports to open access for"] + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[doc = "The justification for making the initiate request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub justification: Option, +} +impl JitNetworkAccessPolicyInitiateRequest { + pub fn new(virtual_machines: Vec) -> Self { + Self { + virtual_machines, + justification: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiateVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "The ports to open for the resource with the `id`"] + pub ports: Vec, +} +impl JitNetworkAccessPolicyInitiateVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { id, ports } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyProperties { + #[doc = "Configurations for Microsoft.Compute/virtualMachines resource type."] + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub requests: Vec, + #[doc = "Gets the provisioning state of the Just-in-Time policy."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl JitNetworkAccessPolicyProperties { + pub fn new(virtual_machines: Vec) -> Self { + Self { + virtual_machines, + requests: Vec::new(), + provisioning_state: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "Port configurations for the virtual machine"] + pub ports: Vec, + #[doc = "Public IP address of the Azure Firewall that is linked to this policy, if applicable"] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, +} +impl JitNetworkAccessPolicyVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { + id, + ports, + public_ip_address: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPortRule { + pub number: PortNumber, + pub protocol: jit_network_access_port_rule::Protocol, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefixes\" parameter. Should be an IP address or CIDR, for example \"192.168.0.3\" or \"192.168.0.0/16\"."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefix\" parameter."] + #[serde( + rename = "allowedSourceAddressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_source_address_prefixes: Vec, + #[doc = "Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day"] + #[serde(rename = "maxRequestAccessDuration")] + pub max_request_access_duration: String, +} +impl JitNetworkAccessPortRule { + pub fn new(number: PortNumber, protocol: jit_network_access_port_rule::Protocol, max_request_access_duration: String) -> Self { + Self { + number, + protocol, + allowed_source_address_prefix: None, + allowed_source_address_prefixes: Vec::new(), + max_request_access_duration, + } + } +} +pub mod jit_network_access_port_rule { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Protocol")] + pub enum Protocol { + #[serde(rename = "TCP")] + Tcp, + #[serde(rename = "UDP")] + Udp, + #[serde(rename = "*")] + U2a, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Protocol { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Protocol { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Protocol { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "TCP"), + Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "UDP"), + Self::U2a => serializer.serialize_unit_variant("Protocol", 2u32, "*"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequest { + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[doc = "The start time of the request in UTC"] + #[serde(rename = "startTimeUtc", with = "azure_core::date::rfc3339")] + pub start_time_utc: time::OffsetDateTime, + #[doc = "The identity of the person who made the request"] + pub requestor: String, + #[doc = "The justification for making the initiate request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub justification: Option, +} +impl JitNetworkAccessRequest { + pub fn new( + virtual_machines: Vec, + start_time_utc: time::OffsetDateTime, + requestor: String, + ) -> Self { + Self { + virtual_machines, + start_time_utc, + requestor, + justification: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequestPort { + pub number: PortNumber, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefixes\" parameter. Should be an IP address or CIDR, for example \"192.168.0.3\" or \"192.168.0.0/16\"."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefix\" parameter."] + #[serde( + rename = "allowedSourceAddressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_source_address_prefixes: Vec, + #[doc = "The date & time at which the request ends in UTC"] + #[serde(rename = "endTimeUtc", with = "azure_core::date::rfc3339")] + pub end_time_utc: time::OffsetDateTime, + #[doc = "The status of the port"] + pub status: jit_network_access_request_port::Status, + #[doc = "A description of why the `status` has its value"] + #[serde(rename = "statusReason")] + pub status_reason: jit_network_access_request_port::StatusReason, + #[doc = "The port which is mapped to this port's `number` in the Azure Firewall, if applicable"] + #[serde(rename = "mappedPort", default, skip_serializing_if = "Option::is_none")] + pub mapped_port: Option, +} +impl JitNetworkAccessRequestPort { + pub fn new( + number: PortNumber, + end_time_utc: time::OffsetDateTime, + status: jit_network_access_request_port::Status, + status_reason: jit_network_access_request_port::StatusReason, + ) -> Self { + Self { + number, + allowed_source_address_prefix: None, + allowed_source_address_prefixes: Vec::new(), + end_time_utc, + status, + status_reason, + mapped_port: None, + } + } +} +pub mod jit_network_access_request_port { + use super::*; + #[doc = "The status of the port"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Revoked, + Initiated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Revoked => serializer.serialize_unit_variant("Status", 0u32, "Revoked"), + Self::Initiated => serializer.serialize_unit_variant("Status", 1u32, "Initiated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A description of why the `status` has its value"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "StatusReason")] + pub enum StatusReason { + Expired, + UserRequested, + NewerRequestInitiated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for StatusReason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for StatusReason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for StatusReason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Expired => serializer.serialize_unit_variant("StatusReason", 0u32, "Expired"), + Self::UserRequested => serializer.serialize_unit_variant("StatusReason", 1u32, "UserRequested"), + Self::NewerRequestInitiated => serializer.serialize_unit_variant("StatusReason", 2u32, "NewerRequestInitiated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequestVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "The ports that were opened for the virtual machine"] + pub ports: Vec, +} +impl JitNetworkAccessRequestVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { id, ports } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Kind { + #[doc = "Kind of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl Kind { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A List custom alert rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListCustomAlertRule { + #[serde(flatten)] + pub custom_alert_rule: CustomAlertRule, + #[doc = "The value type of the items in the list."] + #[serde(rename = "valueType", default, skip_serializing_if = "Option::is_none")] + pub value_type: Option, +} +impl ListCustomAlertRule { + pub fn new(custom_alert_rule: CustomAlertRule) -> Self { + Self { + custom_alert_rule, + value_type: None, + } + } +} +pub mod list_custom_alert_rule { + use super::*; + #[doc = "The value type of the items in the list."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValueType")] + pub enum ValueType { + IpCidr, + String, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValueType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValueType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValueType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IpCidr => serializer.serialize_unit_variant("ValueType", 0u32, "IpCidr"), + Self::String => serializer.serialize_unit_variant("ValueType", 1u32, "String"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Login by a local user that isn't allowed. Allow list consists of login names to allow."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LocalUserNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl LocalUserNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "Describes an Azure resource with location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Location { + #[doc = "Location where the resource is stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl Location { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource of the configuration or data needed to onboard the machine to MDE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingData { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the MDE configuration or data parameter needed to onboard the machine to MDE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MdeOnboardingData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of all MDE onboarding data resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingDataList { + #[doc = "List of the resources of the configuration or data needed to onboard the machine to MDE"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl MdeOnboardingDataList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the MDE configuration or data parameter needed to onboard the machine to MDE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingDataProperties { + #[doc = "The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension"] + #[serde(rename = "onboardingPackageWindows", default, skip_serializing_if = "Option::is_none")] + pub onboarding_package_windows: Option, + #[doc = "The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension"] + #[serde(rename = "onboardingPackageLinux", default, skip_serializing_if = "Option::is_none")] + pub onboarding_package_linux: Option, +} +impl MdeOnboardingDataProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of cloud to device messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Possible operation in the REST API of Microsoft.Security"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Name of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Where the operation is originated"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Security operation display"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security operation display"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationDisplay { + #[doc = "The resource provider for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The display name of the resource the operation applies to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The display name of the security operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The description of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl OperationDisplay { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of possible operations for Microsoft.Security resource provider"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationList { + #[doc = "List of Security operations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a path that is recommended to be allowed and its properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PathRecommendation { + #[doc = "The full path to the application to allow"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "The recommendation action of the VM/server or rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option, + #[doc = "The type of the rule to be allowed"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Represents the publisher information of a process/rule"] + #[serde(rename = "publisherInfo", default, skip_serializing_if = "Option::is_none")] + pub publisher_info: Option, + #[doc = "Whether the path is commonly run on the machine"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub common: Option, + #[serde( + rename = "userSids", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub user_sids: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub usernames: Vec, + #[doc = "The type of the file (for Linux files - Executable is used)"] + #[serde(rename = "fileType", default, skip_serializing_if = "Option::is_none")] + pub file_type: Option, + #[doc = "The configuration status of the VM/server group or machine or rule on the machine"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, +} +impl PathRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub type PathRecommendations = Vec; +#[doc = "A permission detected in the cloud account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PermissionProperty")] +pub enum PermissionProperty { + #[serde(rename = "AWS::AWSSecurityHubReadOnlyAccess")] + AwsAwsSecurityHubReadOnlyAccess, + #[serde(rename = "AWS::SecurityAudit")] + AwsSecurityAudit, + #[serde(rename = "AWS::AmazonSSMAutomationRole")] + AwsAmazonSsmAutomationRole, + #[serde(rename = "GCP::Security Center Admin Viewer")] + GcpSecurityCenterAdminViewer, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PermissionProperty { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PermissionProperty { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PermissionProperty { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsAwsSecurityHubReadOnlyAccess => { + serializer.serialize_unit_variant("PermissionProperty", 0u32, "AWS::AWSSecurityHubReadOnlyAccess") + } + Self::AwsSecurityAudit => serializer.serialize_unit_variant("PermissionProperty", 1u32, "AWS::SecurityAudit"), + Self::AwsAmazonSsmAutomationRole => { + serializer.serialize_unit_variant("PermissionProperty", 2u32, "AWS::AmazonSSMAutomationRole") + } + Self::GcpSecurityCenterAdminViewer => { + serializer.serialize_unit_variant("PermissionProperty", 3u32, "GCP::Security Center Admin Viewer") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +pub type PortNumber = i64; +#[doc = "Pricing tier will be applied for the scope based on the resource ID"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Pricing { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Pricing data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Pricing { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of pricing configurations response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingList { + #[doc = "List of pricing configurations"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for PricingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl PricingList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Pricing data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingProperties { + #[doc = "Pricing tier type"] + #[serde(rename = "pricingTier")] + pub pricing_tier: pricing_properties::PricingTier, +} +impl PricingProperties { + pub fn new(pricing_tier: pricing_properties::PricingTier) -> Self { + Self { pricing_tier } + } +} +pub mod pricing_properties { + use super::*; + #[doc = "Pricing tier type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PricingTier")] + pub enum PricingTier { + Free, + Standard, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PricingTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PricingTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PricingTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Free => serializer.serialize_unit_variant("PricingTier", 0u32, "Free"), + Self::Standard => serializer.serialize_unit_variant("PricingTier", 1u32, "Standard"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Execution of a process that isn't allowed. Allow list consists of process names to allow."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProcessNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ProcessNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProtectionMode { + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exe: Option, + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub msi: Option, + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub script: Option, + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub executable: Option, +} +impl ProtectionMode { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyServerProperties { + #[doc = "Proxy server IP"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip: Option, + #[doc = "Proxy server port"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, +} +impl ProxyServerProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the publisher information of a process/rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PublisherInfo { + #[doc = "The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country"] + #[serde(rename = "publisherName", default, skip_serializing_if = "Option::is_none")] + pub publisher_name: Option, + #[doc = "The product name taken from the file's version resource"] + #[serde(rename = "productName", default, skip_serializing_if = "Option::is_none")] + pub product_name: Option, + #[doc = "The \"OriginalName\" field taken from the file's version resource"] + #[serde(rename = "binaryName", default, skip_serializing_if = "Option::is_none")] + pub binary_name: Option, + #[doc = "The binary file version taken from the file's version resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl PublisherInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule query details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryCheck { + #[doc = "The rule query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, + #[doc = "Expected result."] + #[serde( + rename = "expectedResult", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub expected_result: Vec>, + #[doc = "Column names of expected result."] + #[serde( + rename = "columnNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub column_names: Vec, +} +impl QueryCheck { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of device queue purges is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueuePurgesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl QueuePurgesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The recommendation action of the VM/server or rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationAction { + Recommended, + Add, + Remove, +} +#[doc = "The recommendation status of the VM/server group or VM/server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationStatus { + Recommended, + NotRecommended, + NotAvailable, + NoStatus, +} +#[doc = "The type of the rule to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationType { + File, + FileHash, + PublisherSignature, + ProductSignature, + BinarySignature, + VersionAndAboveSignature, +} +#[doc = "Regulatory compliance assessment details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance assessment data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance assessment response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceAssessmentList { + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceAssessmentList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance assessment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceAssessmentProperties { + #[doc = "The description of the regulatory compliance assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The expected type of assessment contained in the AssessmentDetailsLink"] + #[serde(rename = "assessmentType", default, skip_serializing_if = "Option::is_none")] + pub assessment_type: Option, + #[doc = "Link to more detailed assessment results data. The response type will be according to the assessmentType field"] + #[serde(rename = "assessmentDetailsLink", default, skip_serializing_if = "Option::is_none")] + pub assessment_details_link: Option, + #[doc = "Aggregative state based on the assessment's scanned resources states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The given assessment's related resources count with passed state."] + #[serde(rename = "passedResources", default, skip_serializing_if = "Option::is_none")] + pub passed_resources: Option, + #[doc = "The given assessment's related resources count with failed state."] + #[serde(rename = "failedResources", default, skip_serializing_if = "Option::is_none")] + pub failed_resources: Option, + #[doc = "The given assessment's related resources count with skipped state."] + #[serde(rename = "skippedResources", default, skip_serializing_if = "Option::is_none")] + pub skipped_resources: Option, + #[doc = "The given assessment's related resources count with unsupported state."] + #[serde(rename = "unsupportedResources", default, skip_serializing_if = "Option::is_none")] + pub unsupported_resources: Option, +} +impl RegulatoryComplianceAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_assessment_properties { + use super::*; + #[doc = "Aggregative state based on the assessment's scanned resources states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Regulatory compliance control details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceControl { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance control data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceControl { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance controls response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceControlList { + #[doc = "List of regulatory compliance controls"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceControlList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceControlList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance control data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceControlProperties { + #[doc = "The description of the regulatory compliance control"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Aggregative state based on the control's supported assessments states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a passed state"] + #[serde(rename = "passedAssessments", default, skip_serializing_if = "Option::is_none")] + pub passed_assessments: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a failed state"] + #[serde(rename = "failedAssessments", default, skip_serializing_if = "Option::is_none")] + pub failed_assessments: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a skipped state"] + #[serde(rename = "skippedAssessments", default, skip_serializing_if = "Option::is_none")] + pub skipped_assessments: Option, +} +impl RegulatoryComplianceControlProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_control_properties { + use super::*; + #[doc = "Aggregative state based on the control's supported assessments states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Regulatory compliance standard details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceStandard { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance standard data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceStandard { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance standards response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceStandardList { + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceStandardList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceStandardList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance standard data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceStandardProperties { + #[doc = "Aggregative state based on the standard's supported controls states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a passed state"] + #[serde(rename = "passedControls", default, skip_serializing_if = "Option::is_none")] + pub passed_controls: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a failed state"] + #[serde(rename = "failedControls", default, skip_serializing_if = "Option::is_none")] + pub failed_controls: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a skipped state"] + #[serde(rename = "skippedControls", default, skip_serializing_if = "Option::is_none")] + pub skipped_controls: Option, + #[doc = "The number of regulatory compliance controls of the given standard which are unsupported by automated assessments"] + #[serde(rename = "unsupportedControls", default, skip_serializing_if = "Option::is_none")] + pub unsupported_controls: Option, +} +impl RegulatoryComplianceStandardProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_standard_properties { + use super::*; + #[doc = "Aggregative state based on the standard's supported controls states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Remediation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Remediation { + #[doc = "Remediation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Remediation script."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub scripts: Vec, + #[doc = "Is remediation automated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub automated: Option, + #[doc = "Optional link to remediate in Azure Portal."] + #[serde(rename = "portalLink", default, skip_serializing_if = "Option::is_none")] + pub portal_link: Option, +} +impl Remediation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of the resource that was assessed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceDetails { + #[doc = "The platform where the assessed resource resides"] + pub source: resource_details::Source, +} +impl ResourceDetails { + pub fn new(source: resource_details::Source) -> Self { + Self { source } + } +} +pub mod resource_details { + use super::*; + #[doc = "The platform where the assessed resource resides"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Source")] + pub enum Source { + Azure, + OnPremise, + OnPremiseSql, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Source { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Source { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Source { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("Source", 0u32, "Azure"), + Self::OnPremise => serializer.serialize_unit_variant("Source", 1u32, "OnPremise"), + Self::OnPremiseSql => serializer.serialize_unit_variant("Source", 2u32, "OnPremiseSql"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Rule { + #[doc = "The name of the rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The rule's direction"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[serde(rename = "destinationPort", default, skip_serializing_if = "Option::is_none")] + pub destination_port: Option, + #[doc = "The rule's transport protocols"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub protocols: Vec, + #[doc = "The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol"] + #[serde( + rename = "ipAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ip_addresses: Vec, +} +impl Rule { + pub fn new() -> Self { + Self::default() + } +} +pub mod rule { + use super::*; + #[doc = "The rule's direction"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Direction")] + pub enum Direction { + Inbound, + Outbound, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Direction { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Direction { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Direction { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Inbound => serializer.serialize_unit_variant("Direction", 0u32, "Inbound"), + Self::Outbound => serializer.serialize_unit_variant("Direction", 1u32, "Outbound"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Rule results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResults { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Rule results properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RuleResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule results input."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResultsInput { + #[doc = "Take results from latest scan."] + #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] + pub latest_scan: Option, + #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results: Vec>, +} +impl RuleResultsInput { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule results properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResultsProperties { + #[doc = "Expected results in the baseline."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results: Vec>, +} +impl RuleResultsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule severity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleSeverity")] +pub enum RuleSeverity { + High, + Medium, + Low, + Informational, + Obsolete, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("RuleSeverity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("RuleSeverity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("RuleSeverity", 2u32, "Low"), + Self::Informational => serializer.serialize_unit_variant("RuleSeverity", 3u32, "Informational"), + Self::Obsolete => serializer.serialize_unit_variant("RuleSeverity", 4u32, "Obsolete"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The rule result status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleStatus")] +pub enum RuleStatus { + NonFinding, + Finding, + InternalError, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NonFinding => serializer.serialize_unit_variant("RuleStatus", 0u32, "NonFinding"), + Self::Finding => serializer.serialize_unit_variant("RuleStatus", 1u32, "Finding"), + Self::InternalError => serializer.serialize_unit_variant("RuleStatus", 2u32, "InternalError"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The rule type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleType")] +pub enum RuleType { + Binary, + BaselineExpected, + PositiveList, + NegativeList, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Binary => serializer.serialize_unit_variant("RuleType", 0u32, "Binary"), + Self::BaselineExpected => serializer.serialize_unit_variant("RuleType", 1u32, "BaselineExpected"), + Self::PositiveList => serializer.serialize_unit_variant("RuleType", 2u32, "PositiveList"), + Self::NegativeList => serializer.serialize_unit_variant("RuleType", 3u32, "NegativeList"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A list of rules results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RulesResults { + #[doc = "List of rule results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl RulesResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rules results input."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RulesResultsInput { + #[doc = "Take results from latest scan."] + #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] + pub latest_scan: Option, + #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option, +} +impl RulesResultsInput { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Scan { + #[serde(flatten)] + pub resource: Resource, + #[doc = "A vulnerability assessment scan record properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Scan { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan record properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanProperties { + #[doc = "The scan trigger type."] + #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] + pub trigger_type: Option, + #[doc = "The scan status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The server name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server: Option, + #[doc = "The database name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub database: Option, + #[doc = "The SQL version."] + #[serde(rename = "sqlVersion", default, skip_serializing_if = "Option::is_none")] + pub sql_version: Option, + #[doc = "The scan start time (UTC)."] + #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] + pub start_time: Option, + #[doc = "Scan results are valid until end time (UTC)."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "The number of failed rules with high severity."] + #[serde(rename = "highSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub high_severity_failed_rules_count: Option, + #[doc = "The number of failed rules with medium severity."] + #[serde(rename = "mediumSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub medium_severity_failed_rules_count: Option, + #[doc = "The number of failed rules with low severity."] + #[serde(rename = "lowSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub low_severity_failed_rules_count: Option, + #[doc = "The number of total passed rules."] + #[serde(rename = "totalPassedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_passed_rules_count: Option, + #[doc = "The number of total failed rules."] + #[serde(rename = "totalFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_failed_rules_count: Option, + #[doc = "The number of total rules assessed."] + #[serde(rename = "totalRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_rules_count: Option, + #[doc = "Baseline created for this database, and has one or more rules."] + #[serde(rename = "isBaselineApplied", default, skip_serializing_if = "Option::is_none")] + pub is_baseline_applied: Option, +} +impl ScanProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan result for a single rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResult { + #[serde(flatten)] + pub resource: Resource, + #[doc = "A vulnerability assessment scan result properties for a single rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ScanResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan result properties for a single rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResultProperties { + #[doc = "The rule Id."] + #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + #[doc = "The rule result status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Indicated whether the results specified here are trimmed."] + #[serde(rename = "isTrimmed", default, skip_serializing_if = "Option::is_none")] + pub is_trimmed: Option, + #[doc = "The results of the query that was run."] + #[serde( + rename = "queryResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub query_results: Vec>, + #[doc = "Remediation details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remediation: Option, + #[doc = "The rule result adjusted with baseline."] + #[serde(rename = "baselineAdjustedResult", default, skip_serializing_if = "Option::is_none")] + pub baseline_adjusted_result: Option, + #[doc = "vulnerability assessment rule metadata details."] + #[serde(rename = "ruleMetadata", default, skip_serializing_if = "Option::is_none")] + pub rule_metadata: Option, +} +impl ScanResultProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of vulnerability assessment scan results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResults { + #[doc = "List of vulnerability assessment scan results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ScanResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The scan status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScanState")] +pub enum ScanState { + Failed, + FailedToRun, + InProgress, + Passed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScanState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScanState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScanState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Failed => serializer.serialize_unit_variant("ScanState", 0u32, "Failed"), + Self::FailedToRun => serializer.serialize_unit_variant("ScanState", 1u32, "FailedToRun"), + Self::InProgress => serializer.serialize_unit_variant("ScanState", 2u32, "InProgress"), + Self::Passed => serializer.serialize_unit_variant("ScanState", 3u32, "Passed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The scan trigger type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScanTriggerType")] +pub enum ScanTriggerType { + OnDemand, + Recurring, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScanTriggerType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScanTriggerType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScanTriggerType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OnDemand => serializer.serialize_unit_variant("ScanTriggerType", 0u32, "OnDemand"), + Self::Recurring => serializer.serialize_unit_variant("ScanTriggerType", 1u32, "Recurring"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A list of vulnerability assessment scan records."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Scans { + #[doc = "List of vulnerability assessment scan records."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl Scans { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A more specific scope used to identify the alerts to suppress."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScopeElement { + #[doc = "The alert entity type to suppress by."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option, +} +impl ScopeElement { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScoreDetails { + #[doc = "Maximum score available"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, + #[doc = "Current score"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + #[doc = "Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl ScoreDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the security control."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionItem { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Security Control Definition Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreControlDefinitionItem { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Control Definition Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionItemProperties { + #[doc = "User friendly display name of the control"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "User friendly description of the control"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Maximum control score (0..10)"] + #[serde(rename = "maxScore", default, skip_serializing_if = "Option::is_none")] + pub max_score: Option, + #[doc = "The type of the security control (For example, BuiltIn)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "array of azure resource IDs"] + #[serde(rename = "assessmentDefinitions", default, skip_serializing_if = "Option::is_none")] + pub assessment_definitions: Option, +} +impl SecureScoreControlDefinitionItemProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The type of the security control (For example, BuiltIn)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionSource { + #[doc = "The type of security control (for example, BuiltIn)"] + #[serde(rename = "sourceType", default, skip_serializing_if = "Option::is_none")] + pub source_type: Option, +} +impl SecureScoreControlDefinitionSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod secure_score_control_definition_source { + use super::*; + #[doc = "The type of security control (for example, BuiltIn)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SourceType")] + pub enum SourceType { + BuiltIn, + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::BuiltIn => serializer.serialize_unit_variant("SourceType", 0u32, "BuiltIn"), + Self::Custom => serializer.serialize_unit_variant("SourceType", 1u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Details of the security control, its score, and the health status of the relevant resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDetails { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Calculation result data in control level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreControlDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security controls"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlList { + #[doc = "Collection of security controls in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoreControlList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoreControlList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlScore { + #[doc = "Maximum control score (0..10)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, + #[doc = "Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + #[doc = "Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl SecureScoreControlScore { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data in control level"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlScoreDetails { + #[doc = "User friendly display name of the control"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Calculation result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + #[doc = "Number of healthy resources in the control"] + #[serde(rename = "healthyResourceCount", default, skip_serializing_if = "Option::is_none")] + pub healthy_resource_count: Option, + #[doc = "Number of unhealthy resources in the control"] + #[serde(rename = "unhealthyResourceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_resource_count: Option, + #[doc = "Number of not applicable resources in the control"] + #[serde(rename = "notApplicableResourceCount", default, skip_serializing_if = "Option::is_none")] + pub not_applicable_resource_count: Option, + #[doc = "The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, + #[doc = "Information about the security control."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option, +} +impl SecureScoreControlScoreDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Secure score item data model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreItem { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a calculated secure score."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreItem { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a calculated secure score."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreItemProperties { + #[doc = "The initiative’s name"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Calculation result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + #[doc = "The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, +} +impl SecureScoreItemProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of secure scores"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoresList { + #[doc = "Collection of secure scores in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoresList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoresList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The security connector resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityConnector { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "A set of properties that defines the security connector configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityConnector { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A set of properties that defines the security connector configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityConnectorProperties { + #[doc = "The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector)."] + #[serde(rename = "hierarchyIdentifier", default, skip_serializing_if = "Option::is_none")] + pub hierarchy_identifier: Option, + #[doc = "The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings."] + #[serde(rename = "hierarchyIdentifierTrialEndDate", default, with = "azure_core::date::rfc3339::option")] + pub hierarchy_identifier_trial_end_date: Option, + #[doc = "The multi cloud resource's cloud name."] + #[serde(rename = "environmentName", default, skip_serializing_if = "Option::is_none")] + pub environment_name: Option, + #[doc = "A collection of offerings for the security connector."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub offerings: Vec, + #[doc = "The security connector environment data."] + #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] + pub environment_data: Option, +} +impl SecurityConnectorProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_connector_properties { + use super::*; + #[doc = "The multi cloud resource's cloud name."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EnvironmentName")] + pub enum EnvironmentName { + Azure, + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + Github, + AzureDevOps, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EnvironmentName { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EnvironmentName { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EnvironmentName { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("EnvironmentName", 0u32, "Azure"), + Self::Aws => serializer.serialize_unit_variant("EnvironmentName", 1u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("EnvironmentName", 2u32, "GCP"), + Self::Github => serializer.serialize_unit_variant("EnvironmentName", 3u32, "Github"), + Self::AzureDevOps => serializer.serialize_unit_variant("EnvironmentName", 4u32, "AzureDevOps"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of security connectors response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityConnectorsList { + #[doc = "The list of security connectors under the given scope."] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityConnectorsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityConnectorsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Contact details and configurations for notifications coming from Microsoft Defender for Cloud."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContact { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes security contact properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityContact { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security contacts response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContactList { + #[doc = "List of security contacts"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityContactList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityContactList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes security contact properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContactProperties { + #[doc = "List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations defined in this security contact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option, + #[doc = "The security contact's phone number"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[doc = "Defines whether to send email notifications about new security alerts"] + #[serde(rename = "alertNotifications", default, skip_serializing_if = "Option::is_none")] + pub alert_notifications: Option, + #[doc = "Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[serde(rename = "notificationsByRole", default, skip_serializing_if = "Option::is_none")] + pub notifications_by_role: Option, +} +impl SecurityContactProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_contact_properties { + use super::*; + #[doc = "Defines whether to send email notifications about new security alerts"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct AlertNotifications { + #[doc = "Defines if email notifications will be sent about new security alerts"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Defines the minimal alert severity which will be sent as email notifications"] + #[serde(rename = "minimalSeverity", default, skip_serializing_if = "Option::is_none")] + pub minimal_severity: Option, + } + impl AlertNotifications { + pub fn new() -> Self { + Self::default() + } + } + pub mod alert_notifications { + use super::*; + #[doc = "Defines if email notifications will be sent about new security alerts"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("State", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("State", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Defines the minimal alert severity which will be sent as email notifications"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimalSeverity")] + pub enum MinimalSeverity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimalSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimalSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimalSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("MinimalSeverity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("MinimalSeverity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("MinimalSeverity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NotificationsByRole { + #[doc = "Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC roles: "] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub roles: Vec, + } + impl NotificationsByRole { + pub fn new() -> Self { + Self::default() + } + } + pub mod notifications_by_role { + use super::*; + #[doc = "Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("State", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("State", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "A possible role to configure sending security notification alerts to"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "SecurityContactRole")] +pub enum SecurityContactRole { + AccountAdmin, + ServiceAdmin, + Owner, + Contributor, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for SecurityContactRole { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for SecurityContactRole { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for SecurityContactRole { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AccountAdmin => serializer.serialize_unit_variant("SecurityContactRole", 0u32, "AccountAdmin"), + Self::ServiceAdmin => serializer.serialize_unit_variant("SecurityContactRole", 1u32, "ServiceAdmin"), + Self::Owner => serializer.serialize_unit_variant("SecurityContactRole", 2u32, "Owner"), + Self::Contributor => serializer.serialize_unit_variant("SecurityContactRole", 3u32, "Contributor"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Security sub-assessment on a resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an sub-assessment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecuritySubAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security sub-assessments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessmentList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecuritySubAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecuritySubAssessmentList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of an sub-assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessmentProperties { + #[doc = "Vulnerability ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "User friendly display name of the sub-assessment"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Status of the sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Information on how to remediate this sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remediation: Option, + #[doc = "Description of the impact of this sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub impact: Option, + #[doc = "Category of the sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The date and time the sub-assessment was generated"] + #[serde(rename = "timeGenerated", default, with = "azure_core::date::rfc3339::option")] + pub time_generated: Option, + #[doc = "Details of the resource that was assessed"] + #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] + pub resource_details: Option, + #[doc = "Details of the sub-assessment"] + #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] + pub additional_data: Option, +} +impl SecuritySubAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security task that we recommend to do in order to strengthen security"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTask { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityTask { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security task recommendations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityTaskList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityTaskList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties, depending on the task type that is derived from the name field"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskParameters { + #[doc = "Name of the task type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl SecurityTaskParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a task."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskProperties { + #[doc = "State of the task (Active, Resolved etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The time this task was discovered in UTC"] + #[serde(rename = "creationTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub creation_time_utc: Option, + #[doc = "Changing set of properties, depending on the task type that is derived from the name field"] + #[serde(rename = "securityTaskParameters", default, skip_serializing_if = "Option::is_none")] + pub security_task_parameters: Option, + #[doc = "The time this task's details were last changed in UTC"] + #[serde(rename = "lastStateChangeTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_state_change_time_utc: Option, + #[doc = "Additional data on the state of the task"] + #[serde(rename = "subState", default, skip_serializing_if = "Option::is_none")] + pub sub_state: Option, +} +impl SecurityTaskProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The sensitivity label."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SensitivityLabel { + #[doc = "The name of the sensitivity label."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rank of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + #[doc = "The order of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "Indicates whether the label is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl SensitivityLabel { + pub fn new() -> Self { + Self::default() + } +} +pub mod sensitivity_label { + use super::*; + #[doc = "The rank of the sensitivity label."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Rank { + None, + Low, + Medium, + High, + Critical, + } +} +#[doc = "Additional context fields for server vulnerability assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServerVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Dictionary from cvss version to cvss details object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cvss: Option, + #[doc = "Indicates whether a patch is available or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patchable: Option, + #[doc = "List of CVEs"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cve: Vec, + #[doc = "Threat name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub threat: Option, + #[doc = "Published time"] + #[serde(rename = "publishedTime", default, with = "azure_core::date::rfc3339::option")] + pub published_time: Option, + #[serde( + rename = "vendorReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vendor_references: Vec, +} +impl ServerVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + cvss: None, + patchable: None, + cve: Vec::new(), + threat: None, + published_time: None, + vendor_references: Vec::new(), + } + } +} +#[doc = "Details of the service principal."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServicePrincipalProperties { + #[doc = "Application ID of service principal."] + #[serde(rename = "applicationId", default, skip_serializing_if = "Option::is_none")] + pub application_id: Option, + #[doc = "A secret string that the application uses to prove its identity, also can be referred to as application password (write only)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option, +} +impl ServicePrincipalProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The kind of the security setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Setting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "the kind of the settings string (DataExportSetting)"] + pub kind: setting::Kind, +} +impl Setting { + pub fn new(kind: setting::Kind) -> Self { + Self { + resource: Resource::default(), + kind, + } + } +} +pub mod setting { + use super::*; + #[doc = "the kind of the settings string (DataExportSetting)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + DataExportSetting, + AlertSuppressionSetting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::DataExportSetting => serializer.serialize_unit_variant("Kind", 0u32, "DataExportSetting"), + Self::AlertSuppressionSetting => serializer.serialize_unit_variant("Kind", 1u32, "AlertSuppressionSetting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Subscription settings list."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SettingsList { + #[doc = "The settings list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SettingsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SettingsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a software data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Software { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Software Inventory resource properties"] + pub properties: SoftwareProperties, +} +impl Software { + pub fn new(properties: SoftwareProperties) -> Self { + Self { + resource: Resource::default(), + properties, + } + } +} +#[doc = "Software Inventory resource properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoftwareProperties { + #[doc = "Unique identifier for the virtual machine in the service."] + #[serde(rename = "deviceId", default, skip_serializing_if = "Option::is_none")] + pub device_id: Option, + #[doc = "Platform of the operating system running on the device."] + #[serde(rename = "osPlatform", default, skip_serializing_if = "Option::is_none")] + pub os_platform: Option, + #[doc = "Name of the software vendor."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vendor: Option, + #[doc = "Name of the software product."] + #[serde(rename = "softwareName", default, skip_serializing_if = "Option::is_none")] + pub software_name: Option, + #[doc = "Version number of the software product."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "End of support status."] + #[serde(rename = "endOfSupportStatus", default, skip_serializing_if = "Option::is_none")] + pub end_of_support_status: Option, + #[doc = "The end of support date in case the product is upcoming end of support."] + #[serde(rename = "endOfSupportDate", default, skip_serializing_if = "Option::is_none")] + pub end_of_support_date: Option, + #[doc = "Number of weaknesses."] + #[serde(rename = "numberOfKnownVulnerabilities", default, skip_serializing_if = "Option::is_none")] + pub number_of_known_vulnerabilities: Option, + #[doc = "First time that the software was seen in the device."] + #[serde(rename = "firstSeenAt", default, skip_serializing_if = "Option::is_none")] + pub first_seen_at: Option, +} +impl SoftwareProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod software_properties { + use super::*; + #[doc = "End of support status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndOfSupportStatus")] + pub enum EndOfSupportStatus { + None, + #[serde(rename = "noLongerSupported")] + NoLongerSupported, + #[serde(rename = "versionNoLongerSupported")] + VersionNoLongerSupported, + #[serde(rename = "upcomingNoLongerSupported")] + UpcomingNoLongerSupported, + #[serde(rename = "upcomingVersionNoLongerSupported")] + UpcomingVersionNoLongerSupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndOfSupportStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndOfSupportStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndOfSupportStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("EndOfSupportStatus", 0u32, "None"), + Self::NoLongerSupported => serializer.serialize_unit_variant("EndOfSupportStatus", 1u32, "noLongerSupported"), + Self::VersionNoLongerSupported => serializer.serialize_unit_variant("EndOfSupportStatus", 2u32, "versionNoLongerSupported"), + Self::UpcomingNoLongerSupported => { + serializer.serialize_unit_variant("EndOfSupportStatus", 3u32, "upcomingNoLongerSupported") + } + Self::UpcomingVersionNoLongerSupported => { + serializer.serialize_unit_variant("EndOfSupportStatus", 4u32, "upcomingVersionNoLongerSupported") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents the software inventory of the virtual machine."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoftwaresList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SoftwaresList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SoftwaresList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The source type of the VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum SourceSystem { + #[serde(rename = "Azure_AppLocker")] + AzureAppLocker, + #[serde(rename = "Azure_AuditD")] + AzureAuditD, + #[serde(rename = "NonAzure_AppLocker")] + NonAzureAppLocker, + #[serde(rename = "NonAzure_AuditD")] + NonAzureAuditD, + None, +} +#[doc = "Details of the resource that was assessed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlServerVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "The resource type the sub assessment refers to in its resource details"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The T-SQL query that runs on your SQL database to perform the particular check"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, +} +impl SqlServerVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + query: None, + } + } +} +#[doc = "Status of the sub-assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubAssessmentStatus { + #[doc = "Programmatic code for the status of the assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Programmatic code for the cause of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cause: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The sub-assessment severity level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, +} +impl SubAssessmentStatus { + pub fn new() -> Self { + Self::default() + } +} +pub mod sub_assessment_status { + use super::*; + #[doc = "Programmatic code for the status of the assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Code")] + pub enum Code { + Healthy, + Unhealthy, + NotApplicable, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Code { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Code { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Code { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Healthy => serializer.serialize_unit_variant("Code", 0u32, "Healthy"), + Self::Unhealthy => serializer.serialize_unit_variant("Code", 1u32, "Unhealthy"), + Self::NotApplicable => serializer.serialize_unit_variant("Code", 2u32, "NotApplicable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The sub-assessment severity level"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Low => serializer.serialize_unit_variant("Severity", 0u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::High => serializer.serialize_unit_variant("Severity", 2u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SuppressionAlertsScope { + #[doc = "All the conditions inside need to be true in order to suppress the alert"] + #[serde(rename = "allOf")] + pub all_of: Vec, +} +impl SuppressionAlertsScope { + pub fn new(all_of: Vec) -> Self { + Self { all_of } + } +} +#[doc = "A list of key value pairs that describe the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Tags { + #[doc = "A list of key value pairs that describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl Tags { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is within the given range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ThresholdCustomAlertRule { + #[serde(flatten)] + pub custom_alert_rule: CustomAlertRule, + #[doc = "The minimum threshold."] + #[serde(rename = "minThreshold")] + pub min_threshold: i64, + #[doc = "The maximum threshold."] + #[serde(rename = "maxThreshold")] + pub max_threshold: i64, +} +impl ThresholdCustomAlertRule { + pub fn new(custom_alert_rule: CustomAlertRule, min_threshold: i64, max_threshold: i64) -> Self { + Self { + custom_alert_rule, + min_threshold, + max_threshold, + } + } +} +#[doc = "A custom alert rule that checks if the number of activities (depends on the custom alert type) in a time window is within the given range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TimeWindowCustomAlertRule { + #[serde(flatten)] + pub threshold_custom_alert_rule: ThresholdCustomAlertRule, + #[doc = "The time window size in iso8601 format."] + #[serde(rename = "timeWindowSize")] + pub time_window_size: String, +} +impl TimeWindowCustomAlertRule { + pub fn new(threshold_custom_alert_rule: ThresholdCustomAlertRule, time_window_size: String) -> Self { + Self { + threshold_custom_alert_rule, + time_window_size, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TopologyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TopologyList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TopologyResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyResourceProperties { + #[doc = "The UTC time on which the topology was calculated"] + #[serde(rename = "calculatedDateTime", default, with = "azure_core::date::rfc3339::option")] + pub calculated_date_time: Option, + #[doc = "Azure resources which are part of this topology resource"] + #[serde( + rename = "topologyResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub topology_resources: Vec, +} +impl TopologyResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResource { + #[doc = "Azure resource id"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The security severity of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "Indicates if the resource has security recommendations"] + #[serde(rename = "recommendationsExist", default, skip_serializing_if = "Option::is_none")] + pub recommendations_exist: Option, + #[doc = "Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.)"] + #[serde(rename = "networkZones", default, skip_serializing_if = "Option::is_none")] + pub network_zones: Option, + #[doc = "Score of the resource based on its security severity"] + #[serde(rename = "topologyScore", default, skip_serializing_if = "Option::is_none")] + pub topology_score: Option, + #[doc = "The location of this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Azure resources connected to this resource which are in higher level in the topology view"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub parents: Vec, + #[doc = "Azure resources connected to this resource which are in lower level in the topology view"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub children: Vec, +} +impl TopologySingleResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResourceChild { + #[doc = "Azure resource id which serves as child resource in topology view"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl TopologySingleResourceChild { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResourceParent { + #[doc = "Azure resource id which serves as parent resource in topology view"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl TopologySingleResourceParent { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure tracked resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub azure_tracked_resource_location: AzureTrackedResourceLocation, + #[serde(flatten)] + pub kind: Kind, + #[serde(flatten)] + pub e_tag: ETag, + #[serde(flatten)] + pub tags: Tags, +} +impl TrackedResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of twin updates is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TwinUpdatesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl TwinUpdatesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of unauthorized operations is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UnauthorizedOperationsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl UnauthorizedOperationsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Represents a user that is recommended to be allowed for a certain rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserRecommendation { + #[doc = "Represents a user that is recommended to be allowed for a certain rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The recommendation action of the VM/server or rule"] + #[serde(rename = "recommendationAction", default, skip_serializing_if = "Option::is_none")] + pub recommendation_action: Option, +} +impl UserRecommendation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "vulnerability assessment rule metadata details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VaRule { + #[doc = "The rule Id."] + #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + #[doc = "The rule severity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The rule category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The rule type."] + #[serde(rename = "ruleType", default, skip_serializing_if = "Option::is_none")] + pub rule_type: Option, + #[doc = "The rule title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "The rule description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rule rationale."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rationale: Option, + #[doc = "The rule query details."] + #[serde(rename = "queryCheck", default, skip_serializing_if = "Option::is_none")] + pub query_check: Option, + #[doc = "The benchmark references."] + #[serde( + rename = "benchmarkReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub benchmark_references: Vec, +} +impl VaRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Vendor reference"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VendorReference { + #[doc = "Link title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Link url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option, +} +impl VendorReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a machine that is part of a VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VmRecommendation { + #[doc = "The configuration status of the VM/server group or machine or rule on the machine"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, + #[doc = "The recommendation action of the VM/server or rule"] + #[serde(rename = "recommendationAction", default, skip_serializing_if = "Option::is_none")] + pub recommendation_action: Option, + #[doc = "The full azure resource id of the machine"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The VM/server supportability of Enforce feature"] + #[serde(rename = "enforcementSupport", default, skip_serializing_if = "Option::is_none")] + pub enforcement_support: Option, +} +impl VmRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub type VmRecommendations = Vec; +pub type VmResourceId = String; +#[doc = "Configures where to store the OMS agent data for workspaces under a scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Workspace setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of workspace settings response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceSettingList { + #[doc = "List of workspace settings"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WorkspaceSettingList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Workspace setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceSettingProperties { + #[doc = "The full Azure ID of the workspace to save the data in"] + #[serde(rename = "workspaceId")] + pub workspace_id: String, + #[doc = "All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope"] + pub scope: String, +} +impl WorkspaceSettingProperties { + pub fn new(workspace_id: String, scope: String) -> Self { + Self { workspace_id, scope } + } +} +#[doc = "The security offering details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudOffering { + #[doc = "The type of the security offering."] + #[serde(rename = "offeringType")] + pub offering_type: cloud_offering::OfferingType, + #[doc = "The offering description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl CloudOffering { + pub fn new(offering_type: cloud_offering::OfferingType) -> Self { + Self { + offering_type, + description: None, + } + } +} +pub mod cloud_offering { + use super::*; + #[doc = "The type of the security offering."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OfferingType")] + pub enum OfferingType { + CspmMonitorAws, + DefenderForContainersAws, + DefenderForServersAws, + DefenderForDatabasesAws, + InformationProtectionAws, + CspmMonitorGcp, + CspmMonitorGithub, + CspmMonitorAzureDevOps, + DefenderForServersGcp, + DefenderForContainersGcp, + DefenderForDatabasesGcp, + DefenderCspmAws, + DefenderCspmGcp, + DefenderForDevOpsGithub, + DefenderForDevOpsAzureDevOps, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OfferingType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OfferingType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OfferingType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CspmMonitorAws => serializer.serialize_unit_variant("OfferingType", 0u32, "CspmMonitorAws"), + Self::DefenderForContainersAws => serializer.serialize_unit_variant("OfferingType", 1u32, "DefenderForContainersAws"), + Self::DefenderForServersAws => serializer.serialize_unit_variant("OfferingType", 2u32, "DefenderForServersAws"), + Self::DefenderForDatabasesAws => serializer.serialize_unit_variant("OfferingType", 3u32, "DefenderForDatabasesAws"), + Self::InformationProtectionAws => serializer.serialize_unit_variant("OfferingType", 4u32, "InformationProtectionAws"), + Self::CspmMonitorGcp => serializer.serialize_unit_variant("OfferingType", 5u32, "CspmMonitorGcp"), + Self::CspmMonitorGithub => serializer.serialize_unit_variant("OfferingType", 6u32, "CspmMonitorGithub"), + Self::CspmMonitorAzureDevOps => serializer.serialize_unit_variant("OfferingType", 7u32, "CspmMonitorAzureDevOps"), + Self::DefenderForServersGcp => serializer.serialize_unit_variant("OfferingType", 8u32, "DefenderForServersGcp"), + Self::DefenderForContainersGcp => serializer.serialize_unit_variant("OfferingType", 9u32, "DefenderForContainersGcp"), + Self::DefenderForDatabasesGcp => serializer.serialize_unit_variant("OfferingType", 10u32, "DefenderForDatabasesGcp"), + Self::DefenderCspmAws => serializer.serialize_unit_variant("OfferingType", 11u32, "DefenderCspmAws"), + Self::DefenderCspmGcp => serializer.serialize_unit_variant("OfferingType", 12u32, "DefenderCspmGcp"), + Self::DefenderForDevOpsGithub => serializer.serialize_unit_variant("OfferingType", 13u32, "DefenderForDevOpsGithub"), + Self::DefenderForDevOpsAzureDevOps => { + serializer.serialize_unit_variant("OfferingType", 14u32, "DefenderForDevOpsAzureDevOps") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The CSPM monitoring for AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, +} +impl CspmMonitorAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + } + } +} +pub mod cspm_monitor_aws_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The CSPM monitoring for AzureDevOps offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorAzureDevOpsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl CspmMonitorAzureDevOpsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The CSPM monitoring for GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, +} +impl CspmMonitorGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + } + } +} +pub mod cspm_monitor_gcp_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The GCP workload identity provider id for the offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The CSPM monitoring for github offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorGithubOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl CspmMonitorGithubOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "Custom Assessment Automation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "describes the Custom Assessment Automation properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomAssessmentAutomation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the Custom Assessment Automation properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationProperties { + #[doc = "GZip encoded KQL query representing the assessment automation results required."] + #[serde(rename = "compressedQuery", default, skip_serializing_if = "Option::is_none")] + pub compressed_query: Option, + #[doc = "Relevant cloud for the custom assessment automation."] + #[serde(rename = "supportedCloud", default, skip_serializing_if = "Option::is_none")] + pub supported_cloud: Option, + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The display name of the assessments generated by this assessment automation."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The remediation description to relate to the assessments generated by this assessment automation."] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, + #[doc = "The assessment metadata key used when an assessment is generated for this assessment automation."] + #[serde(rename = "assessmentKey", default, skip_serializing_if = "Option::is_none")] + pub assessment_key: Option, +} +impl CustomAssessmentAutomationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod custom_assessment_automation_properties { + use super::*; + #[doc = "Relevant cloud for the custom assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SupportedCloud")] + pub enum SupportedCloud { + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SupportedCloud { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SupportedCloud { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SupportedCloud { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("SupportedCloud", 0u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("SupportedCloud", 1u32, "GCP"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("Severity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("Severity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Custom Assessment Automation request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationRequest { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes the Custom Assessment Automation properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomAssessmentAutomationRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the Custom Assessment Automation properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationRequestProperties { + #[doc = "Base 64 encoded KQL query representing the assessment automation results required."] + #[serde(rename = "compressedQuery", default, skip_serializing_if = "Option::is_none")] + pub compressed_query: Option, + #[doc = "Relevant cloud for the custom assessment automation."] + #[serde(rename = "supportedCloud", default, skip_serializing_if = "Option::is_none")] + pub supported_cloud: Option, + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The display name of the assessments generated by this assessment automation."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The remediation description to relate to the assessments generated by this assessment automation."] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, +} +impl CustomAssessmentAutomationRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod custom_assessment_automation_request_properties { + use super::*; + #[doc = "Relevant cloud for the custom assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SupportedCloud")] + pub enum SupportedCloud { + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SupportedCloud { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SupportedCloud { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SupportedCloud { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("SupportedCloud", 0u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("SupportedCloud", 1u32, "GCP"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("Severity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("Severity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of Custom Assessment Automations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationsListResult { + #[doc = "Collection of Custom Assessment Automations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CustomAssessmentAutomationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CustomAssessmentAutomationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The CSPM P1 for Aws offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderCspmAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] + pub vm_scanners: Option, +} +impl DefenderCspmAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + vm_scanners: None, + } + } +} +pub mod defender_cspm_aws_offering { + use super::*; + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VmScanners { + #[doc = "Is Microsoft Defender for Server VM scanning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VmScanners { + pub fn new() -> Self { + Self::default() + } + } + pub mod vm_scanners { + use super::*; + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + #[doc = "The scanning mode for the vm scan."] + #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] + pub scanning_mode: Option, + #[doc = "VM tags that indicates that VM should not be scanned"] + #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] + pub exclusion_tags: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The scanning mode for the vm scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ScanningMode")] + pub enum ScanningMode { + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ScanningMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ScanningMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ScanningMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "The CSPM P1 for GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderCspmGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderCspmGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for Databases AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderFoDatabasesAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The RDS configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rds: Option, +} +impl DefenderFoDatabasesAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + arc_auto_provisioning: None, + rds: None, + } + } +} +pub mod defender_fo_databases_aws_offering { + use super::*; + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The RDS configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Rds { + #[doc = "Is RDS protection enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl Rds { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for Containers AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForContainersAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The kubernetes service connection configuration"] + #[serde(rename = "kubernetesService", default, skip_serializing_if = "Option::is_none")] + pub kubernetes_service: Option, + #[doc = "The kubernetes to scuba connection configuration"] + #[serde(rename = "kubernetesScubaReader", default, skip_serializing_if = "Option::is_none")] + pub kubernetes_scuba_reader: Option, + #[doc = "The cloudwatch to kinesis connection configuration"] + #[serde(rename = "cloudWatchToKinesis", default, skip_serializing_if = "Option::is_none")] + pub cloud_watch_to_kinesis: Option, + #[doc = "The kinesis to s3 connection configuration"] + #[serde(rename = "kinesisToS3", default, skip_serializing_if = "Option::is_none")] + pub kinesis_to_s3: Option, + #[doc = "The container vulnerability assessment configuration"] + #[serde(rename = "containerVulnerabilityAssessment", default, skip_serializing_if = "Option::is_none")] + pub container_vulnerability_assessment: Option, + #[doc = "The container vulnerability assessment task configuration"] + #[serde(rename = "containerVulnerabilityAssessmentTask", default, skip_serializing_if = "Option::is_none")] + pub container_vulnerability_assessment_task: Option, + #[doc = "Enable container vulnerability assessment feature"] + #[serde( + rename = "enableContainerVulnerabilityAssessment", + default, + skip_serializing_if = "Option::is_none" + )] + pub enable_container_vulnerability_assessment: Option, + #[doc = "Is audit logs pipeline auto provisioning enabled"] + #[serde(rename = "autoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub auto_provisioning: Option, + #[doc = "The retention time in days of kube audit logs set on the CloudWatch log group"] + #[serde(rename = "kubeAuditRetentionTime", default, skip_serializing_if = "Option::is_none")] + pub kube_audit_retention_time: Option, + #[doc = "The externalId used by the data reader to prevent the confused deputy attack"] + #[serde(rename = "scubaExternalId", default, skip_serializing_if = "Option::is_none")] + pub scuba_external_id: Option, +} +impl DefenderForContainersAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + kubernetes_service: None, + kubernetes_scuba_reader: None, + cloud_watch_to_kinesis: None, + kinesis_to_s3: None, + container_vulnerability_assessment: None, + container_vulnerability_assessment_task: None, + enable_container_vulnerability_assessment: None, + auto_provisioning: None, + kube_audit_retention_time: None, + scuba_external_id: None, + } + } +} +pub mod defender_for_containers_aws_offering { + use super::*; + #[doc = "The kubernetes service connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KubernetesService { + #[doc = "The cloud role ARN in AWS for this feature used for provisioning resources"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KubernetesService { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The kubernetes to scuba connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KubernetesScubaReader { + #[doc = "The cloud role ARN in AWS for this feature used for reading data"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KubernetesScubaReader { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The cloudwatch to kinesis connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct CloudWatchToKinesis { + #[doc = "The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl CloudWatchToKinesis { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The kinesis to s3 connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KinesisToS3 { + #[doc = "The cloud role ARN in AWS used by Kinesis to transfer data into S3"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KinesisToS3 { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The container vulnerability assessment configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ContainerVulnerabilityAssessment { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ContainerVulnerabilityAssessment { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The container vulnerability assessment task configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ContainerVulnerabilityAssessmentTask { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ContainerVulnerabilityAssessmentTask { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The containers GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForContainersGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "dataPipelineNativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub data_pipeline_native_cloud_connection: Option, + #[doc = "Is audit logs data collection enabled"] + #[serde(rename = "auditLogsAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub audit_logs_auto_provisioning_flag: Option, + #[doc = "Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled"] + #[serde(rename = "defenderAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub defender_agent_auto_provisioning_flag: Option, + #[doc = "Is Policy Kubernetes agent auto provisioning enabled"] + #[serde(rename = "policyAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub policy_agent_auto_provisioning_flag: Option, +} +impl DefenderForContainersGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + data_pipeline_native_cloud_connection: None, + audit_logs_auto_provisioning_flag: None, + defender_agent_auto_provisioning_flag: None, + policy_agent_auto_provisioning_flag: None, + } + } +} +pub mod defender_for_containers_gcp_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DataPipelineNativeCloudConnection { + #[doc = "The data collection service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The data collection GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl DataPipelineNativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for Databases GCP offering configurations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDatabasesGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The native cloud connection configuration"] + #[serde( + rename = "defenderForDatabasesArcAutoProvisioning", + default, + skip_serializing_if = "Option::is_none" + )] + pub defender_for_databases_arc_auto_provisioning: Option, +} +impl DefenderForDatabasesGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + arc_auto_provisioning: None, + defender_for_databases_arc_auto_provisioning: None, + } + } +} +pub mod defender_for_databases_gcp_offering { + use super::*; + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForDatabasesArcAutoProvisioning { + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl DefenderForDatabasesArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for DevOps for Azure DevOps offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDevOpsAzureDevOpsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderForDevOpsAzureDevOpsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for DevOps for Github offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDevOpsGithubOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderForDevOpsGithubOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for Servers AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForServersAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Defender for servers connection configuration"] + #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] + pub defender_for_servers: Option, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub va_auto_provisioning: Option, + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub mde_auto_provisioning: Option, + #[doc = "configuration for the servers offering subPlan"] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] + pub vm_scanners: Option, +} +impl DefenderForServersAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + defender_for_servers: None, + arc_auto_provisioning: None, + va_auto_provisioning: None, + mde_auto_provisioning: None, + sub_plan: None, + vm_scanners: None, + } + } +} +pub mod defender_for_servers_aws_offering { + use super::*; + #[doc = "The Defender for servers connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForServers { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl DefenderForServers { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VaAutoProvisioning { + #[doc = "Is Vulnerability Assessment auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VaAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + pub mod va_auto_provisioning { + use super::*; + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Qualys, + #[serde(rename = "TVM")] + Tvm, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), + Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MdeAutoProvisioning { + #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl MdeAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "configuration for the servers offering subPlan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SubPlan { + #[doc = "The available sub plans"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SubPlan { + pub fn new() -> Self { + Self::default() + } + } + pub mod sub_plan { + use super::*; + #[doc = "The available sub plans"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + P1, + P2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VmScanners { + #[doc = "Is Microsoft Defender for Server VM scanning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VmScanners { + pub fn new() -> Self { + Self::default() + } + } + pub mod vm_scanners { + use super::*; + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + #[doc = "The scanning mode for the vm scan."] + #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] + pub scanning_mode: Option, + #[doc = "VM tags that indicates that VM should not be scanned"] + #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] + pub exclusion_tags: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The scanning mode for the vm scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ScanningMode")] + pub enum ScanningMode { + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ScanningMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ScanningMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ScanningMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "The Defender for Servers GCP offering configurations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForServersGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Defender for servers connection configuration"] + #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] + pub defender_for_servers: Option, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub va_auto_provisioning: Option, + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub mde_auto_provisioning: Option, + #[doc = "configuration for the servers offering subPlan"] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, +} +impl DefenderForServersGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + defender_for_servers: None, + arc_auto_provisioning: None, + va_auto_provisioning: None, + mde_auto_provisioning: None, + sub_plan: None, + } + } +} +pub mod defender_for_servers_gcp_offering { + use super::*; + #[doc = "The Defender for servers connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForServers { + #[doc = "The workload identity provider id in GCP for this feature"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + #[doc = "The service account email address in GCP for this feature"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + } + impl DefenderForServers { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VaAutoProvisioning { + #[doc = "Is Vulnerability Assessment auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VaAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + pub mod va_auto_provisioning { + use super::*; + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Qualys, + #[serde(rename = "TVM")] + Tvm, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), + Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MdeAutoProvisioning { + #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl MdeAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "configuration for the servers offering subPlan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SubPlan { + #[doc = "The available sub plans"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SubPlan { + pub fn new() -> Self { + Self::default() + } + } + pub mod sub_plan { + use super::*; + #[doc = "The available sub plans"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + P1, + P2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "The information protection for AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InformationProtectionAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "informationProtection", default, skip_serializing_if = "Option::is_none")] + pub information_protection: Option, +} +impl InformationProtectionAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + information_protection: None, + } + } +} +pub mod information_protection_aws_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct InformationProtection { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl InformationProtection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "List of security controls definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionList { + #[doc = "Collection of security controls definition in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoreControlDefinitionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoreControlDefinitionList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/security/src/package_composite_v2/mod.rs b/services/mgmt/security/src/package_composite_v2/mod.rs new file mode 100644 index 0000000000..99f1dcaab6 --- /dev/null +++ b/services/mgmt/security/src/package_composite_v2/mod.rs @@ -0,0 +1,17733 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn adaptive_application_controls_client(&self) -> adaptive_application_controls::Client { + adaptive_application_controls::Client(self.clone()) + } + pub fn adaptive_network_hardenings_client(&self) -> adaptive_network_hardenings::Client { + adaptive_network_hardenings::Client(self.clone()) + } + pub fn advanced_threat_protection_client(&self) -> advanced_threat_protection::Client { + advanced_threat_protection::Client(self.clone()) + } + pub fn alerts_client(&self) -> alerts::Client { + alerts::Client(self.clone()) + } + pub fn alerts_suppression_rules_client(&self) -> alerts_suppression_rules::Client { + alerts_suppression_rules::Client(self.clone()) + } + pub fn allowed_connections_client(&self) -> allowed_connections::Client { + allowed_connections::Client(self.clone()) + } + pub fn auto_provisioning_settings_client(&self) -> auto_provisioning_settings::Client { + auto_provisioning_settings::Client(self.clone()) + } + pub fn automations_client(&self) -> automations::Client { + automations::Client(self.clone()) + } + pub fn compliances_client(&self) -> compliances::Client { + compliances::Client(self.clone()) + } + pub fn connectors_client(&self) -> connectors::Client { + connectors::Client(self.clone()) + } + pub fn custom_assessment_automations_client(&self) -> custom_assessment_automations::Client { + custom_assessment_automations::Client(self.clone()) + } + pub fn custom_entity_store_assignments_client(&self) -> custom_entity_store_assignments::Client { + custom_entity_store_assignments::Client(self.clone()) + } + pub fn device_security_groups_client(&self) -> device_security_groups::Client { + device_security_groups::Client(self.clone()) + } + pub fn discovered_security_solutions_client(&self) -> discovered_security_solutions::Client { + discovered_security_solutions::Client(self.clone()) + } + pub fn external_security_solutions_client(&self) -> external_security_solutions::Client { + external_security_solutions::Client(self.clone()) + } + pub fn information_protection_policies_client(&self) -> information_protection_policies::Client { + information_protection_policies::Client(self.clone()) + } + pub fn ingestion_settings_client(&self) -> ingestion_settings::Client { + ingestion_settings::Client(self.clone()) + } + pub fn io_t_security_solutions_client(&self) -> io_t_security_solutions::Client { + io_t_security_solutions::Client(self.clone()) + } + pub fn io_t_security_solutions_analytics_client(&self) -> io_t_security_solutions_analytics::Client { + io_t_security_solutions_analytics::Client(self.clone()) + } + pub fn io_t_security_solutions_analytics_aggregated_alert_client(&self) -> io_t_security_solutions_analytics_aggregated_alert::Client { + io_t_security_solutions_analytics_aggregated_alert::Client(self.clone()) + } + pub fn io_t_security_solutions_analytics_aggregated_alerts_client( + &self, + ) -> io_t_security_solutions_analytics_aggregated_alerts::Client { + io_t_security_solutions_analytics_aggregated_alerts::Client(self.clone()) + } + pub fn io_t_security_solutions_analytics_recommendation_client(&self) -> io_t_security_solutions_analytics_recommendation::Client { + io_t_security_solutions_analytics_recommendation::Client(self.clone()) + } + pub fn io_t_security_solutions_analytics_recommendations_client(&self) -> io_t_security_solutions_analytics_recommendations::Client { + io_t_security_solutions_analytics_recommendations::Client(self.clone()) + } + pub fn io_t_security_solutions_resource_group_client(&self) -> io_t_security_solutions_resource_group::Client { + io_t_security_solutions_resource_group::Client(self.clone()) + } + pub fn iot_security_solution_client(&self) -> iot_security_solution::Client { + iot_security_solution::Client(self.clone()) + } + pub fn jit_network_access_policies_client(&self) -> jit_network_access_policies::Client { + jit_network_access_policies::Client(self.clone()) + } + pub fn locations_client(&self) -> locations::Client { + locations::Client(self.clone()) + } + pub fn mde_onboardings_client(&self) -> mde_onboardings::Client { + mde_onboardings::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn pricings_client(&self) -> pricings::Client { + pricings::Client(self.clone()) + } + pub fn regulatory_compliance_assessments_client(&self) -> regulatory_compliance_assessments::Client { + regulatory_compliance_assessments::Client(self.clone()) + } + pub fn regulatory_compliance_controls_client(&self) -> regulatory_compliance_controls::Client { + regulatory_compliance_controls::Client(self.clone()) + } + pub fn regulatory_compliance_standards_client(&self) -> regulatory_compliance_standards::Client { + regulatory_compliance_standards::Client(self.clone()) + } + pub fn secure_score_control_definitions_client(&self) -> secure_score_control_definitions::Client { + secure_score_control_definitions::Client(self.clone()) + } + pub fn secure_score_controls_client(&self) -> secure_score_controls::Client { + secure_score_controls::Client(self.clone()) + } + pub fn secure_scores_client(&self) -> secure_scores::Client { + secure_scores::Client(self.clone()) + } + pub fn security_connectors_client(&self) -> security_connectors::Client { + security_connectors::Client(self.clone()) + } + pub fn security_contacts_client(&self) -> security_contacts::Client { + security_contacts::Client(self.clone()) + } + pub fn settings_client(&self) -> settings::Client { + settings::Client(self.clone()) + } + pub fn software_inventories_client(&self) -> software_inventories::Client { + software_inventories::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_baseline_rules_client(&self) -> sql_vulnerability_assessment_baseline_rules::Client { + sql_vulnerability_assessment_baseline_rules::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_scan_results_client(&self) -> sql_vulnerability_assessment_scan_results::Client { + sql_vulnerability_assessment_scan_results::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_scans_client(&self) -> sql_vulnerability_assessment_scans::Client { + sql_vulnerability_assessment_scans::Client(self.clone()) + } + pub fn sub_assessments_client(&self) -> sub_assessments::Client { + sub_assessments::Client(self.clone()) + } + pub fn tasks_client(&self) -> tasks::Client { + tasks::Client(self.clone()) + } + pub fn topology_client(&self) -> topology::Client { + topology::Client(self.clone()) + } + pub fn workspace_settings_client(&self) -> workspace_settings::Client { + workspace_settings::Client(self.clone()) + } +} +pub mod security_connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves details of a specific security connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + #[doc = "Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `security_connector`: The security connector resource"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + security_connector: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + security_connector: security_connector.into(), + } + } + #[doc = "Updates a security connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `security_connector`: The security connector resource"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + security_connector: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + security_connector: security_connector.into(), + } + } + #[doc = "Deletes a security connector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityConnectors", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) security_connector: models::SecurityConnector, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_connector)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) security_connector: models::SecurityConnector, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_connector)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod mde_onboardings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The configuration or data needed to onboard the machine to MDE"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "The default configuration or data needed to onboard the machine to MDE"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn get(&self, subscription_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MdeOnboardingDataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/mdeOnboardings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MdeOnboardingData = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/mdeOnboardings/default", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod custom_assessment_automations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a custom assessment automation"] + #[doc = "Gets a single custom assessment automation by name for the provided subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + } + } + #[doc = "Creates a custom assessment automation"] + #[doc = "Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + #[doc = "* `custom_assessment_automation_body`: Custom Assessment Automation body"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + custom_assessment_automation_body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + custom_assessment_automation_body: custom_assessment_automation_body.into(), + } + } + #[doc = "Deletes a custom assessment automation"] + #[doc = "Deletes a custom assessment automation by name for a provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + } + } + #[doc = "List custom assessment automations in a subscription and a resource group"] + #[doc = "List custom assessment automations by provided subscription and resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List custom assessment automations in a subscription"] + #[doc = "List custom assessment automations by provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + pub(crate) custom_assessment_automation_body: models::CustomAssessmentAutomationRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.custom_assessment_automation_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/customAssessmentAutomations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod custom_entity_store_assignments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a custom entity store assignment"] + #[doc = "Gets a single custom entity store assignment by name for the provided subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + } + } + #[doc = "Creates a custom entity store assignment"] + #[doc = "Creates a custom entity store assignment for the provided subscription, if not already exists."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + #[doc = "* `custom_entity_store_assignment_request_body`: Custom entity store assignment body"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + custom_entity_store_assignment_request_body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + custom_entity_store_assignment_request_body: custom_entity_store_assignment_request_body.into(), + } + } + #[doc = "Deleted a custom entity store assignment"] + #[doc = "Delete a custom entity store assignment by name for a provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + } + } + #[doc = "List custom entity store assignments in a subscription and a resource group"] + #[doc = "List custom entity store assignments by a provided subscription and resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List custom entity store assignments in a subscription"] + #[doc = "List custom entity store assignments by provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + pub(crate) custom_entity_store_assignment_request_body: models::CustomEntityStoreAssignmentRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.custom_entity_store_assignment_request_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignmentsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignmentsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/customEntityStoreAssignments", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod software_inventories { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the software inventory of the virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets the software inventory of all virtual machines in the subscriptions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a single software data of the virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `software_name`: Name of the installed software."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + software_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + software_name: software_name.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SoftwaresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/softwareInventories", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_namespace, + &this.resource_type, + &this.resource_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SoftwaresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/softwareInventories", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Software = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) software_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/softwareInventories/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_namespace, + &this.resource_type, + &this.resource_name, + &this.software_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_scans { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the scan details of a single scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan record for the latest scan."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + scan_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets a list of scan records."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Scan = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}", + this.client.endpoint(), + &this.resource_id, + &this.scan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Scans = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_scan_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the scan results of a single rule in a scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] + #[doc = "* `scan_result_id`: The rule Id of the results."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + scan_id: impl Into, + scan_result_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + scan_result_id: scan_result_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets a list of scan results for a single scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list( + &self, + scan_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScanResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) scan_result_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults/{}", + this.client.endpoint(), + &this.resource_id, + &this.scan_id, + &this.scan_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScanResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults", + this.client.endpoint(), + &this.resource_id, + &this.scan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_baseline_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the results for a given rule in the Baseline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Creates a Baseline for a rule in a database. Will overwrite any previously existing results."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn create_or_update( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + body: None, + } + } + #[doc = "Deletes a rule from the Baseline of a given database."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn delete( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets the results for all rules in the Baseline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Add a list of baseline rules. Will overwrite any previously existing results (for all rules)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn add(&self, workspace_id: impl Into, resource_id: impl Into) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + body: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuleResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuleResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + pub(crate) body: Option, + } + impl RequestBuilder { + #[doc = "The baseline results for this rule."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RulesResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RulesResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + pub(crate) body: Option, + } + impl RequestBuilder { + #[doc = "The baseline rules."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-07-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod secure_scores { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `secure_score_name`: The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below."] + pub fn get(&self, subscription_id: impl Into, secure_score_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + secure_score_name: secure_score_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreItem = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) secure_score_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores/{}", + this.client.endpoint(), + &this.subscription_id, + &this.secure_score_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod secure_score_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all security controls for a specific initiative within a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `secure_score_name`: The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below."] + pub fn list_by_secure_score( + &self, + subscription_id: impl Into, + secure_score_name: impl Into, + ) -> list_by_secure_score::RequestBuilder { + list_by_secure_score::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + secure_score_name: secure_score_name.into(), + expand: None, + } + } + #[doc = "Get all security controls within a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + expand: None, + } + } + } + pub mod list_by_secure_score { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) secure_score_name: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores/{}/secureScoreControls", + this.client.endpoint(), + &this.subscription_id, + &this.secure_score_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScoreControls", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod secure_score_control_definitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the available security controls, their assessments, and the max score"] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "For a specified subscription, list the available security controls, their assessments, and the max score"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlDefinitionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.Security/secureScoreControlDefinitions", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlDefinitionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScoreControlDefinitions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Cloud accounts connectors of a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific cloud account connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + pub fn get(&self, subscription_id: impl Into, connector_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + } + } + #[doc = "Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + #[doc = "* `connector_setting`: Settings for the cloud account connector"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + connector_name: impl Into, + connector_setting: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + connector_setting: connector_setting.into(), + } + } + #[doc = "Delete a cloud account connector from a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + pub fn delete(&self, subscription_id: impl Into, connector_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + pub(crate) connector_setting: models::ConnectorSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.connector_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod security_contacts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get Default Security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + pub fn get(&self, subscription_id: impl Into, security_contact_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + } + } + #[doc = "Create security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + #[doc = "* `security_contact`: Security contact object"] + pub fn create( + &self, + subscription_id: impl Into, + security_contact_name: impl Into, + security_contact: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + security_contact: security_contact.into(), + } + } + #[doc = "Delete security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + pub fn delete(&self, subscription_id: impl Into, security_contact_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContactList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContact = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContact = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + pub(crate) security_contact: models::SecurityContact, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_contact)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod automations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves information about the model of a security automation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + } + } + #[doc = "Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + #[doc = "* `automation`: The security automation resource"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + automation: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + automation: automation.into(), + } + } + #[doc = "Deletes a security automation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + } + } + #[doc = "Validates the security automation model before create or update. Any validation errors are returned to the client."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + #[doc = "* `automation`: The security automation resource"] + pub fn validate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + automation: impl Into, + ) -> validate::RequestBuilder { + validate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + automation: automation.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/automations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Automation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Automation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + pub(crate) automation: models::Automation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.automation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod validate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationValidationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + pub(crate) automation: models::Automation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}/validate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.automation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sub_assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get security sub-assessments on all your scanned resources inside a subscription scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list_all(&self, scope: impl Into) -> list_all::RequestBuilder { + list_all::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Get security sub-assessments on all your scanned resources inside a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + pub fn list(&self, scope: impl Into, assessment_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + } + } + #[doc = "Get a security sub-assessment on your scanned resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `sub_assessment_name`: The Sub-Assessment Key - Unique key for the sub-assessment type"] + pub fn get( + &self, + scope: impl Into, + assessment_name: impl Into, + sub_assessment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + sub_assessment_name: sub_assessment_name.into(), + } + } + } + pub mod list_all { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/subAssessments", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/subAssessments", + this.client.endpoint(), + &this.scope, + &this.assessment_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + pub(crate) sub_assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/subAssessments/{}", + this.client.endpoint(), + &this.scope, + &this.assessment_name, + &this.sub_assessment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_standards { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Supported regulatory compliance standards details and state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Supported regulatory compliance details state for selected standard"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceStandardList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceStandard = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.regulatory_compliance_standard_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "All supported regulatory compliance controls details and state for selected standard"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + pub fn list( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + filter: None, + } + } + #[doc = "Selected regulatory compliance control details and state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceControl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details and state of assessments mapped to selected regulatory compliance control"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + pub fn list( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + filter: None, + } + } + #[doc = "Supported regulatory compliance details and state for selected assessment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + #[doc = "* `regulatory_compliance_assessment_name`: Name of the regulatory compliance assessment object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + regulatory_compliance_assessment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + regulatory_compliance_assessment_name: regulatory_compliance_assessment_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}/regulatoryComplianceAssessments" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + pub(crate) regulatory_compliance_assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}/regulatoryComplianceAssessments/{}" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name , & this . regulatory_compliance_assessment_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pricings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists Microsoft Defender for Cloud pricing configurations in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + pub fn get(&self, subscription_id: impl Into, pricing_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + } + } + #[doc = "Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + #[doc = "* `pricing`: Pricing object"] + pub fn update( + &self, + subscription_id: impl Into, + pricing_name: impl Into, + pricing: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + pricing: pricing.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PricingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2018-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2018-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + pub(crate) pricing: models::Pricing, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2018-06-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.pricing)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod workspace_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + pub fn get(&self, subscription_id: impl Into, workspace_setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + } + } + #[doc = "creating settings about where we should store your security data and logs"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + #[doc = "* `workspace_setting`: Security data setting object"] + pub fn create( + &self, + subscription_id: impl Into, + workspace_setting_name: impl Into, + workspace_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + workspace_setting: workspace_setting.into(), + } + } + #[doc = "Settings about where we should store your security data and logs"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + #[doc = "* `workspace_setting`: Security data setting object"] + pub fn update( + &self, + subscription_id: impl Into, + workspace_setting_name: impl Into, + workspace_setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + workspace_setting: workspace_setting.into(), + } + } + #[doc = "Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + pub fn delete(&self, subscription_id: impl Into, workspace_setting_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + pub(crate) workspace_setting: models::WorkspaceSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + pub(crate) workspace_setting: models::WorkspaceSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod auto_provisioning_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Exposes the auto provisioning settings of the subscriptions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific setting"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Auto provisioning setting key"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "Details of a specific setting"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Auto provisioning setting key"] + #[doc = "* `setting`: Auto provisioning setting key"] + pub fn create( + &self, + subscription_id: impl Into, + setting_name: impl Into, + setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::AutoProvisioningSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod compliances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The Compliance scores of the specific management group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Details of a specific Compliance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `compliance_name`: name of the Compliance"] + pub fn get(&self, scope: impl Into, compliance_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + compliance_name: compliance_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComplianceList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/compliances", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Compliance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) compliance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/compliances/{}", + this.client.endpoint(), + &this.scope, + &this.compliance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod advanced_threat_protection { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the Advanced Threat Protection settings for the specified resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `setting_name`: Advanced Threat Protection setting name."] + pub fn get(&self, resource_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "Creates or updates the Advanced Threat Protection settings on a specified resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `setting_name`: Advanced Threat Protection setting name."] + #[doc = "* `advanced_threat_protection_setting`: Advanced Threat Protection Settings"] + pub fn create( + &self, + resource_id: impl Into, + setting_name: impl Into, + advanced_threat_protection_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + setting_name: setting_name.into(), + advanced_threat_protection_setting: advanced_threat_protection_setting.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdvancedThreatProtectionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/advancedThreatProtectionSettings/{}", + this.client.endpoint(), + &this.resource_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdvancedThreatProtectionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) setting_name: String, + pub(crate) advanced_threat_protection_setting: models::AdvancedThreatProtectionSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/advancedThreatProtectionSettings/{}", + this.client.endpoint(), + &this.resource_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.advanced_threat_protection_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod device_security_groups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method get the list of device security groups for the specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + } + } + #[doc = "Use this method to get the device security group for the specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + pub fn get(&self, resource_id: impl Into, device_security_group_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + } + } + #[doc = "Use this method to creates or updates the device security group on a specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + #[doc = "* `device_security_group`: Security group object."] + pub fn create_or_update( + &self, + resource_id: impl Into, + device_security_group_name: impl Into, + device_security_group: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + device_security_group: device_security_group.into(), + } + } + #[doc = "User this method to deletes the device security group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + pub fn delete(&self, resource_id: impl Into, device_security_group_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroupList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups", + this.client.endpoint(), + &this.resource_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + pub(crate) device_security_group: models::DeviceSecurityGroup, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.device_security_group)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings about different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings of different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Name of setting: (MCAS/WDATP)"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "updating settings about different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Name of setting: (MCAS/WDATP)"] + #[doc = "* `setting`: Setting object"] + pub fn update( + &self, + subscription_id: impl Into, + setting_name: impl Into, + setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SettingsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Setting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Setting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::Setting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod information_protection_policies { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details of the information protection policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `information_protection_policy_name`: Name of the information protection policy."] + pub fn get(&self, scope: impl Into, information_protection_policy_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + information_protection_policy_name: information_protection_policy_name.into(), + } + } + #[doc = "Details of the information protection policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `information_protection_policy_name`: Name of the information protection policy."] + #[doc = "* `information_protection_policy`: Information protection policy."] + pub fn create_or_update( + &self, + scope: impl Into, + information_protection_policy_name: impl Into, + information_protection_policy: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + information_protection_policy_name: information_protection_policy_name.into(), + information_protection_policy: information_protection_policy.into(), + } + } + #[doc = "Information protection policies of a specific management group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) information_protection_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies/{}", + this.client.endpoint(), + &this.scope, + &this.information_protection_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) information_protection_policy_name: String, + pub(crate) information_protection_policy: models::InformationProtectionPolicy, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies/{}", + this.client.endpoint(), + &this.scope, + &this.information_protection_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.information_protection_policy)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod io_t_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of security solutions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "filter the Security Solution with OData syntax. supporting filter by iotHubs"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/iotSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod io_t_security_solutions_resource_group { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of security solutions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list(&self, subscription_id: impl Into, resource_group_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "filter the Security Solution with OData syntax. supporting filter by iotHubs"] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod iot_security_solution { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details of a specific iot security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + #[doc = "Create new solution manager"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + #[doc = "* `iot_security_solution_data`: The security solution data"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + iot_security_solution_data: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + iot_security_solution_data: iot_security_solution_data.into(), + } + } + #[doc = "update existing Security Solution tags or user defined resources. To update other fields use the CreateOrUpdate method"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + #[doc = "* `update_iot_security_solution_data`: The security solution data"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + update_iot_security_solution_data: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + update_iot_security_solution_data: update_iot_security_solution_data.into(), + } + } + #[doc = "Create new solution manager"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) iot_security_solution_data: models::IoTSecuritySolutionModel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.iot_security_solution_data)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) update_iot_security_solution_data: models::UpdateIotSecuritySolutionData, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.update_iot_security_solution_data)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod io_t_security_solutions_analytics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + pub fn get_all( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> get_all::RequestBuilder { + get_all::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + pub fn get_default( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> get_default::RequestBuilder { + get_default::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + } + pub mod get_all { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionAnalyticsModelList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_default { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionAnalyticsModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod io_t_security_solutions_analytics_aggregated_alerts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + top: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedAlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The number of results to retrieve."] + pub fn top(mut self, top: i64) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedAlerts" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod io_t_security_solutions_analytics_aggregated_alert { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + #[doc = "* `aggregated_alert_name`: Identifier of the aggregated alert"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + aggregated_alert_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + aggregated_alert_name: aggregated_alert_name.into(), + } + } + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + #[doc = "* `aggregated_alert_name`: Identifier of the aggregated alert"] + pub fn dismiss( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + aggregated_alert_name: impl Into, + ) -> dismiss::RequestBuilder { + dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + aggregated_alert_name: aggregated_alert_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedAlert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) aggregated_alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedAlerts/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name , & this . aggregated_alert_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) aggregated_alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedAlerts/{}/dismiss" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name , & this . aggregated_alert_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod io_t_security_solutions_analytics_recommendation { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + #[doc = "* `aggregated_recommendation_name`: Identifier of the aggregated recommendation"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + aggregated_recommendation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + aggregated_recommendation_name: aggregated_recommendation_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedRecommendation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) aggregated_recommendation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedRecommendations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name , & this . aggregated_recommendation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod io_t_security_solutions_analytics_recommendations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security Analytics of a security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The solution manager name"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + top: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedRecommendationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "The number of results to retrieve."] + pub fn top(mut self, top: i64) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedRecommendations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Exposes all available operations for discovery purposes."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.Security/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod locations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn get(&self, subscription_id: impl Into, asc_location: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AscLocationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AscLocation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod tasks { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + pub fn get_subscription_level_task( + &self, + subscription_id: impl Into, + asc_location: impl Into, + task_name: impl Into, + ) -> get_subscription_level_task::RequestBuilder { + get_subscription_level_task::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + #[doc = "* `task_update_action_type`: Type of the action to do on the task"] + pub fn update_subscription_level_task_state( + &self, + subscription_id: impl Into, + asc_location: impl Into, + task_name: impl Into, + task_update_action_type: impl Into, + ) -> update_subscription_level_task_state::RequestBuilder { + update_subscription_level_task_state::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + task_update_action_type: task_update_action_type.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + pub fn get_resource_group_level_task( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + task_name: impl Into, + ) -> get_resource_group_level_task::RequestBuilder { + get_resource_group_level_task::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + #[doc = "* `task_update_action_type`: Type of the action to do on the task"] + pub fn update_resource_group_level_task_state( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + task_name: impl Into, + task_update_action_type: impl Into, + ) -> update_resource_group_level_task_state::RequestBuilder { + update_resource_group_level_task_state::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + task_update_action_type: task_update_action_type.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/tasks", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_level_task { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.task_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_level_task_state { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + pub(crate) task_update_action_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks/{}/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.task_name, + &this.task_update_action_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_resource_group_level_task { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.task_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_resource_group_level_task_state { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + pub(crate) task_update_action_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks/{}/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.task_name, + &this.task_update_action_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod alerts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the alerts that are associated with the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + select: None, + expand: None, + auto_dismiss_rule_name: None, + } + } + #[doc = "List all the alerts that are associated with the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + select: None, + expand: None, + auto_dismiss_rule_name: None, + } + } + #[doc = "List all the alerts that are associated with the subscription that are stored in a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_subscription_level_alerts_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_subscription_level_alerts_by_region::RequestBuilder { + list_subscription_level_alerts_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + filter: None, + select: None, + expand: None, + auto_dismiss_rule_name: None, + } + } + #[doc = "List all the alerts that are associated with the resource group that are stored in a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_resource_group_level_alerts_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + resource_group_name: impl Into, + ) -> list_resource_group_level_alerts_by_region::RequestBuilder { + list_resource_group_level_alerts_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + resource_group_name: resource_group_name.into(), + filter: None, + select: None, + expand: None, + auto_dismiss_rule_name: None, + } + } + #[doc = "Get an alert that is associated with a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn get_subscription_level_alert( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> get_subscription_level_alert::RequestBuilder { + get_subscription_level_alert::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Get an alert that is associated a resource group or a resource in a resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn get_resource_group_level_alerts( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + resource_group_name: impl Into, + ) -> get_resource_group_level_alerts::RequestBuilder { + get_resource_group_level_alerts::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_alert_state_to_dismiss( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_alert_state_to_dismiss::RequestBuilder { + update_subscription_level_alert_state_to_dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_alert_state_to_reactivate( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_alert_state_to_reactivate::RequestBuilder { + update_subscription_level_alert_state_to_reactivate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn update_resource_group_level_alert_state_to_dismiss( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + resource_group_name: impl Into, + ) -> update_resource_group_level_alert_state_to_dismiss::RequestBuilder { + update_resource_group_level_alert_state_to_dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn update_resource_group_level_alert_state_to_reactivate( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + resource_group_name: impl Into, + ) -> update_resource_group_level_alert_state_to_reactivate::RequestBuilder { + update_resource_group_level_alert_state_to_reactivate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + resource_group_name: resource_group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + pub(crate) auto_dismiss_rule_name: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "The name of an existing auto dismiss rule. Use it to simulate the rule on existing alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created"] + pub fn auto_dismiss_rule_name(mut self, auto_dismiss_rule_name: impl Into) -> Self { + self.auto_dismiss_rule_name = Some(auto_dismiss_rule_name.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alerts", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + if let Some(auto_dismiss_rule_name) = &this.auto_dismiss_rule_name { + req.url_mut() + .query_pairs_mut() + .append_pair("autoDismissRuleName", auto_dismiss_rule_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + pub(crate) auto_dismiss_rule_name: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "The name of an existing auto dismiss rule. Use it to simulate the rule on existing alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created"] + pub fn auto_dismiss_rule_name(mut self, auto_dismiss_rule_name: impl Into) -> Self { + self.auto_dismiss_rule_name = Some(auto_dismiss_rule_name.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + if let Some(auto_dismiss_rule_name) = &this.auto_dismiss_rule_name { + req.url_mut() + .query_pairs_mut() + .append_pair("autoDismissRuleName", auto_dismiss_rule_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_subscription_level_alerts_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + pub(crate) auto_dismiss_rule_name: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "The name of an existing auto dismiss rule. Use it to simulate the rule on existing alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created"] + pub fn auto_dismiss_rule_name(mut self, auto_dismiss_rule_name: impl Into) -> Self { + self.auto_dismiss_rule_name = Some(auto_dismiss_rule_name.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + if let Some(auto_dismiss_rule_name) = &this.auto_dismiss_rule_name { + req.url_mut() + .query_pairs_mut() + .append_pair("autoDismissRuleName", auto_dismiss_rule_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_resource_group_level_alerts_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + pub(crate) select: Option, + pub(crate) expand: Option, + pub(crate) auto_dismiss_rule_name: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "OData select. Optional."] + pub fn select(mut self, select: impl Into) -> Self { + self.select = Some(select.into()); + self + } + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "The name of an existing auto dismiss rule. Use it to simulate the rule on existing alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created"] + pub fn auto_dismiss_rule_name(mut self, auto_dismiss_rule_name: impl Into) -> Self { + self.auto_dismiss_rule_name = Some(auto_dismiss_rule_name.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(select) = &this.select { + req.url_mut().query_pairs_mut().append_pair("$select", select); + } + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + if let Some(auto_dismiss_rule_name) = &this.auto_dismiss_rule_name { + req.url_mut() + .query_pairs_mut() + .append_pair("autoDismissRuleName", auto_dismiss_rule_name); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_level_alert { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_resource_group_level_alerts { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_level_alert_state_to_dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/dismiss", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_subscription_level_alert_state_to_reactivate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/reactivate", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_alert_state_to_dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/dismiss", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_alert_state_to_reactivate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/reactivate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod discovered_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of discovered Security Solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of discovered Security Solutions for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific discovered Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `discovered_security_solution_name`: Name of a discovered security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + discovered_security_solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + discovered_security_solution_name: discovered_security_solution_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/discoveredSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/discoveredSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) discovered_security_solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/discoveredSecuritySolutions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . asc_location , & this . discovered_security_solution_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod jit_network_access_policies { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Policies for protecting resources using Just-in-Time access control."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_region::RequestBuilder { + list_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_resource_group_and_region( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + ) -> list_by_resource_group_and_region::RequestBuilder { + list_by_resource_group_and_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + } + } + #[doc = "Create a policy for protecting resources using Just-in-Time access control"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + body: body.into(), + } + } + #[doc = "Delete a Just-in-Time access control policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + } + } + #[doc = "Initiate a JIT access from a specific Just-in-Time policy configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + #[doc = "* `jit_network_access_policy_initiate_type`: Type of the action to do on the Just-in-Time access policy."] + pub fn initiate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + jit_network_access_policy_initiate_type: impl Into, + body: impl Into, + ) -> initiate::RequestBuilder { + initiate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + jit_network_access_policy_initiate_type: jit_network_access_policy_initiate_type.into(), + body: body.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group_and_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + pub(crate) body: models::JitNetworkAccessPolicy, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod initiate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessRequest = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + pub(crate) jit_network_access_policy_initiate_type: String, + pub(crate) body: models::JitNetworkAccessPolicyInitiateRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . asc_location , & this . jit_network_access_policy_name , & this . jit_network_access_policy_initiate_type)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod adaptive_application_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of application control VM/server groups for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + include_path_recommendations: None, + summary: None, + } + } + #[doc = "Gets an application control VM/server group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control VM/server group"] + pub fn get( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + } + } + #[doc = "Update an application control VM/server group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control VM/server group"] + #[doc = "* `body`: The updated VM/server group data"] + pub fn put( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + body: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + body: body.into(), + } + } + #[doc = "Delete an application control VM/server group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control VM/server group"] + pub fn delete( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AppWhitelistingGroups = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) include_path_recommendations: Option, + pub(crate) summary: Option, + } + impl RequestBuilder { + #[doc = "Include the policy rules"] + pub fn include_path_recommendations(mut self, include_path_recommendations: bool) -> Self { + self.include_path_recommendations = Some(include_path_recommendations); + self + } + #[doc = "Return output in a summarized form"] + pub fn summary(mut self, summary: bool) -> Self { + self.summary = Some(summary); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applicationWhitelistings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(include_path_recommendations) = &this.include_path_recommendations { + req.url_mut() + .query_pairs_mut() + .append_pair("includePathRecommendations", &include_path_recommendations.to_string()); + } + if let Some(summary) = &this.summary { + req.url_mut().query_pairs_mut().append_pair("summary", &summary.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AppWhitelistingGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod put { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AppWhitelistingGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + pub(crate) body: models::AppWhitelistingPutGroupData, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod external_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of external security solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of external Security Solutions for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific external Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `external_security_solutions_name`: Name of an external security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + external_security_solutions_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + external_security_solutions_name: external_security_solutions_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/externalSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/ExternalSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) external_security_solutions_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/ExternalSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.external_security_solutions_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod topology { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list that allows to build a topology view of a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list that allows to build a topology view of a subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific topology component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `topology_resource_name`: Name of a topology resources collection."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + topology_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + topology_resource_name: topology_resource_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/topologies", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/topologies", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) topology_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/topologies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.topology_resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod allowed_connections { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of all possible traffic between resources for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the list of all possible traffic between resources for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets the list of all possible traffic between resources for the subscription and location, based on connection type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `connection_type`: The type of allowed connections (Internal, External)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + connection_type: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + connection_type: connection_type.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/allowedConnections", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/allowedConnections", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) connection_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/allowedConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.connection_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod adaptive_network_hardenings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of Adaptive Network Hardenings resources in scope of an extended resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets a single Adaptive Network Hardening resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `adaptive_network_hardening_resource_name`: The name of the Adaptive Network Hardening resource."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + adaptive_network_hardening_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + adaptive_network_hardening_resource_name: adaptive_network_hardening_resource_name.into(), + } + } + #[doc = "Enforces the given rules on the NSG(s) listed in the request"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `adaptive_network_hardening_resource_name`: The name of the Adaptive Network Hardening resource."] + #[doc = "* `adaptive_network_hardening_enforce_action`: Enforces the given rules on the NSG(s) listed in the request"] + pub fn enforce( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + adaptive_network_hardening_resource_name: impl Into, + adaptive_network_hardening_enforce_action: impl Into, + body: impl Into, + ) -> enforce::RequestBuilder { + enforce::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + adaptive_network_hardening_resource_name: adaptive_network_hardening_resource_name.into(), + adaptive_network_hardening_enforce_action: adaptive_network_hardening_enforce_action.into(), + body: body.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveNetworkHardeningsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveNetworkHardening = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) adaptive_network_hardening_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . adaptive_network_hardening_resource_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod enforce { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) adaptive_network_hardening_resource_name: String, + pub(crate) adaptive_network_hardening_enforce_action: String, + pub(crate) body: models::AdaptiveNetworkHardeningEnforceRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings/{}/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . adaptive_network_hardening_resource_name , & this . adaptive_network_hardening_enforce_action)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod alerts_suppression_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of all the dismiss rules for the given subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alert_type: None, + } + } + #[doc = "Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + pub fn get(&self, subscription_id: impl Into, alerts_suppression_rule_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + } + } + #[doc = "Update existing rule or create new rule if it doesn't exist"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + #[doc = "* `alerts_suppression_rule`: Suppression rule object"] + pub fn update( + &self, + subscription_id: impl Into, + alerts_suppression_rule_name: impl Into, + alerts_suppression_rule: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + alerts_suppression_rule: alerts_suppression_rule.into(), + } + } + #[doc = "Delete dismiss alert rule for this subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + pub fn delete( + &self, + subscription_id: impl Into, + alerts_suppression_rule_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRulesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alert_type: Option, + } + impl RequestBuilder { + #[doc = "Type of the alert to get rules for"] + pub fn alert_type(mut self, alert_type: impl Into) -> Self { + self.alert_type = Some(alert_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(alert_type) = &this.alert_type { + req.url_mut().query_pairs_mut().append_pair("AlertType", alert_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + pub(crate) alerts_suppression_rule: models::AlertsSuppressionRule, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.alerts_suppression_rule)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod ingestion_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn get(&self, subscription_id: impl Into, ingestion_setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Create setting for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + #[doc = "* `ingestion_setting`: Ingestion setting object"] + pub fn create( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ingestion_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + ingestion_setting: ingestion_setting.into(), + } + } + #[doc = "Deletes the ingestion settings for this subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn delete(&self, subscription_id: impl Into, ingestion_setting_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Returns the token that is used for correlating ingested telemetry with the resources in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn list_tokens( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ) -> list_tokens::RequestBuilder { + list_tokens::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Connection strings for ingesting security scan logs and data."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn list_connection_strings( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ) -> list_connection_strings::RequestBuilder { + list_connection_strings::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + pub(crate) ingestion_setting: models::IngestionSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.ingestion_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_tokens { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSettingToken = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}/listTokens", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_connection_strings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectionStrings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}/listConnectionStrings", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/security/src/package_composite_v2/models.rs b/services/mgmt/security/src/package_composite_v2/models.rs new file mode 100644 index 0000000000..97f417dc0f --- /dev/null +++ b/services/mgmt/security/src/package_composite_v2/models.rs @@ -0,0 +1,9132 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadConnectivityState { + #[serde(rename = "connectivityState", default, skip_serializing_if = "Option::is_none")] + pub connectivity_state: Option, +} +impl AadConnectivityState { + pub fn new() -> Self { + Self::default() + } +} +pub mod aad_connectivity_state { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ConnectivityState")] + pub enum ConnectivityState { + Discovered, + NotLicensed, + Connected, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ConnectivityState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ConnectivityState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ConnectivityState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Discovered => serializer.serialize_unit_variant("ConnectivityState", 0u32, "Discovered"), + Self::NotLicensed => serializer.serialize_unit_variant("ConnectivityState", 1u32, "NotLicensed"), + Self::Connected => serializer.serialize_unit_variant("ConnectivityState", 2u32, "Connected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents an AAD identity protection solution which sends logs to an OMS workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AadExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(flatten)] + pub aad_connectivity_state: AadConnectivityState, +} +impl AadSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of active connections is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ActiveConnectionsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl ActiveConnectionsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardening { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Adaptive Network Hardening resource properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AdaptiveNetworkHardening { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdaptiveNetworkHardeningEnforceRequest { + #[doc = "The rules to enforce"] + pub rules: Vec, + #[doc = "The Azure resource IDs of the effective network security groups that will be updated with the created security rules from the Adaptive Network Hardening rules"] + #[serde(rename = "networkSecurityGroups")] + pub network_security_groups: Vec, +} +impl AdaptiveNetworkHardeningEnforceRequest { + pub fn new(rules: Vec, network_security_groups: Vec) -> Self { + Self { + rules, + network_security_groups, + } + } +} +#[doc = "Adaptive Network Hardening resource properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardeningProperties { + #[doc = "The security rules which are recommended to be effective on the VM"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, + #[doc = "The UTC time on which the rules were calculated"] + #[serde(rename = "rulesCalculationTime", default, with = "azure_core::date::rfc3339::option")] + pub rules_calculation_time: Option, + #[doc = "The Network Security Groups effective on the network interfaces of the protected resource"] + #[serde( + rename = "effectiveNetworkSecurityGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub effective_network_security_groups: Vec, +} +impl AdaptiveNetworkHardeningProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Response for ListAdaptiveNetworkHardenings API service call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardeningsList { + #[doc = "A list of Adaptive Network Hardenings resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of results"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AdaptiveNetworkHardeningsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AdaptiveNetworkHardeningsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of the sub-assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdditionalData { + #[doc = "Sub-assessment resource type"] + #[serde(rename = "assessedResourceType")] + pub assessed_resource_type: additional_data::AssessedResourceType, +} +impl AdditionalData { + pub fn new(assessed_resource_type: additional_data::AssessedResourceType) -> Self { + Self { assessed_resource_type } + } +} +pub mod additional_data { + use super::*; + #[doc = "Sub-assessment resource type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AssessedResourceType")] + pub enum AssessedResourceType { + SqlServerVulnerability, + ContainerRegistryVulnerability, + ServerVulnerability, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AssessedResourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AssessedResourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AssessedResourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SqlServerVulnerability => serializer.serialize_unit_variant("AssessedResourceType", 0u32, "SqlServerVulnerability"), + Self::ContainerRegistryVulnerability => { + serializer.serialize_unit_variant("AssessedResourceType", 1u32, "ContainerRegistryVulnerability") + } + Self::ServerVulnerability => serializer.serialize_unit_variant("AssessedResourceType", 2u32, "ServerVulnerability"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The Advanced Threat Protection settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdvancedThreatProtectionProperties { + #[doc = "Indicates whether Advanced Threat Protection is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option, +} +impl AdvancedThreatProtectionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Advanced Threat Protection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdvancedThreatProtectionSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The Advanced Threat Protection settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AdvancedThreatProtectionSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security alert"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Alert { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes security alert properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Alert { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Factors that increase our confidence that the alert is a true positive"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertConfidenceReason { + #[doc = "Type of confidence factor"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "description of the confidence reason"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} +impl AlertConfidenceReason { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties depending on the entity type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertEntity { + #[doc = "Type of entity"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl AlertEntity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties depending on the alert type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertExtendedProperties {} +impl AlertExtendedProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security alerts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AlertList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AlertList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes security alert properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertProperties { + #[doc = "State of the alert (Active, Dismissed etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The time the incident was reported to Microsoft.Security in UTC"] + #[serde(rename = "reportedTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub reported_time_utc: Option, + #[doc = "Name of the vendor that discovered the incident"] + #[serde(rename = "vendorName", default, skip_serializing_if = "Option::is_none")] + pub vendor_name: Option, + #[doc = "Name of the alert type"] + #[serde(rename = "alertName", default, skip_serializing_if = "Option::is_none")] + pub alert_name: Option, + #[doc = "Display name of the alert type"] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "The time the incident was detected by the vendor"] + #[serde(rename = "detectedTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub detected_time_utc: Option, + #[doc = "Description of the incident and what it means"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Recommended steps to reradiate the incident"] + #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] + pub remediation_steps: Option, + #[doc = "The action that was taken as a response to the alert (Active, Blocked etc.)"] + #[serde(rename = "actionTaken", default, skip_serializing_if = "Option::is_none")] + pub action_taken: Option, + #[doc = "Estimated severity of this alert"] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "The entity that the incident happened on"] + #[serde(rename = "compromisedEntity", default, skip_serializing_if = "Option::is_none")] + pub compromised_entity: Option, + #[doc = "Azure resource ID of the associated resource"] + #[serde(rename = "associatedResource", default, skip_serializing_if = "Option::is_none")] + pub associated_resource: Option, + #[doc = "Changing set of properties depending on the alert type."] + #[serde(rename = "extendedProperties", default, skip_serializing_if = "Option::is_none")] + pub extended_properties: Option, + #[doc = "The type of the alerted resource (Azure, Non-Azure)"] + #[serde(rename = "systemSource", default, skip_serializing_if = "Option::is_none")] + pub system_source: Option, + #[doc = "Whether this alert can be investigated with Azure Security Center"] + #[serde(rename = "canBeInvestigated", default, skip_serializing_if = "Option::is_none")] + pub can_be_investigated: Option, + #[doc = "Whether this alert is for incident type or not (otherwise - single alert)"] + #[serde(rename = "isIncident", default, skip_serializing_if = "Option::is_none")] + pub is_incident: Option, + #[doc = "objects that are related to this alerts"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub entities: Vec, + #[doc = "level of confidence we have on the alert"] + #[serde(rename = "confidenceScore", default, skip_serializing_if = "Option::is_none")] + pub confidence_score: Option, + #[doc = "reasons the alert got the confidenceScore value"] + #[serde( + rename = "confidenceReasons", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub confidence_reasons: Vec, + #[doc = "Azure subscription ID of the resource that had the security alert or the subscription ID of the workspace that this resource reports to"] + #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] + pub subscription_id: Option, + #[doc = "Instance ID of the alert."] + #[serde(rename = "instanceId", default, skip_serializing_if = "Option::is_none")] + pub instance_id: Option, + #[doc = "Azure resource ID of the workspace that the alert was reported to."] + #[serde(rename = "workspaceArmId", default, skip_serializing_if = "Option::is_none")] + pub workspace_arm_id: Option, + #[doc = "Alerts with the same CorrelationKey will be grouped together in Ibiza."] + #[serde(rename = "correlationKey", default, skip_serializing_if = "Option::is_none")] + pub correlation_key: Option, +} +impl AlertProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod alert_properties { + use super::*; + #[doc = "Estimated severity of this alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes the suppression rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertsSuppressionRule { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes AlertsSuppressionRule properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AlertsSuppressionRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes AlertsSuppressionRule properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertsSuppressionRuleProperties { + #[doc = "Type of the alert to automatically suppress. For all alert types, use '*'"] + #[serde(rename = "alertType")] + pub alert_type: String, + #[doc = "The last time this rule was modified"] + #[serde(rename = "lastModifiedUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_utc: Option, + #[doc = "Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date."] + #[serde(rename = "expirationDateUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_date_utc: Option, + #[doc = "The reason for dismissing the alert"] + pub reason: String, + #[doc = "Possible states of the rule"] + pub state: alerts_suppression_rule_properties::State, + #[doc = "Any comment regarding the rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option, + #[serde(rename = "suppressionAlertsScope", default, skip_serializing_if = "Option::is_none")] + pub suppression_alerts_scope: Option, +} +impl AlertsSuppressionRuleProperties { + pub fn new(alert_type: String, reason: String, state: alerts_suppression_rule_properties::State) -> Self { + Self { + alert_type, + last_modified_utc: None, + expiration_date_utc: None, + reason, + state, + comment: None, + suppression_alerts_scope: None, + } + } +} +pub mod alerts_suppression_rule_properties { + use super::*; + #[doc = "Possible states of the rule"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + Enabled, + Disabled, + Expired, + } +} +#[doc = "Suppression rules list for subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertsSuppressionRulesList { + pub value: Vec, + #[doc = "URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AlertsSuppressionRulesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AlertsSuppressionRulesList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "List of all possible traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AllowedConnectionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AllowedConnectionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource whose properties describes the allowed traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[doc = "Describes the allowed traffic between Azure resources"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AllowedConnectionsResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the allowed traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsResourceProperties { + #[doc = "The UTC time on which the allowed connections resource was calculated"] + #[serde(rename = "calculatedDateTime", default, with = "azure_core::date::rfc3339::option")] + pub calculated_date_time: Option, + #[doc = "List of connectable resources"] + #[serde( + rename = "connectableResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub connectable_resources: Vec, +} +impl AllowedConnectionsResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is allowed."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AllowlistCustomAlertRule { + #[serde(flatten)] + pub list_custom_alert_rule: ListCustomAlertRule, + #[doc = "The values to allow. The format of the values depends on the rule type."] + #[serde(rename = "allowlistValues")] + pub allowlist_values: Vec, +} +impl AllowlistCustomAlertRule { + pub fn new(list_custom_alert_rule: ListCustomAlertRule, allowlist_values: Vec) -> Self { + Self { + list_custom_alert_rule, + allowlist_values, + } + } +} +#[doc = "Number of cloud to device messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppWhitelistingGroup { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[doc = "Represents a VM/server group and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] + pub properties: AppWhitelistingGroupData, +} +impl AppWhitelistingGroup { + pub fn new(properties: AppWhitelistingGroupData) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[doc = "Represents a VM/server group and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingGroupData { + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(rename = "enforcementMode", default, skip_serializing_if = "Option::is_none")] + pub enforcement_mode: Option, + #[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] + #[serde(rename = "protectionMode", default, skip_serializing_if = "Option::is_none")] + pub protection_mode: Option, + #[doc = "The configuration status of the VM/server group or machine or rule on the machine"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, + #[doc = "The recommendation status of the VM/server group or VM/server"] + #[serde(rename = "recommendationStatus", default, skip_serializing_if = "Option::is_none")] + pub recommendation_status: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issues: Option, + #[doc = "The source type of the VM/server group"] + #[serde(rename = "sourceSystem", default, skip_serializing_if = "Option::is_none")] + pub source_system: Option, + #[serde(rename = "vmRecommendations", default, skip_serializing_if = "Option::is_none")] + pub vm_recommendations: Option, + #[serde(rename = "pathRecommendations", default, skip_serializing_if = "Option::is_none")] + pub path_recommendations: Option, +} +impl AppWhitelistingGroupData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingGroups { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl AppWhitelistingGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An alert that VMs/servers within a group can have"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum AppWhitelistingIssue { + ViolationsAudited, + ViolationsBlocked, + MsiAndScriptViolationsAudited, + MsiAndScriptViolationsBlocked, + ExecutableViolationsAudited, + RulesViolatedManually, +} +#[doc = "Represents a summary of the alerts of the VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingIssueSummary { + #[doc = "An alert that VMs/servers within a group can have"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issue: Option, + #[doc = "The number of machines in the VM/server group that have this alert"] + #[serde(rename = "numberOfVms", default, skip_serializing_if = "Option::is_none")] + pub number_of_vms: Option, +} +impl AppWhitelistingIssueSummary { + pub fn new() -> Self { + Self::default() + } +} +pub type AppWhitelistingIssuesSummaries = Vec; +#[doc = "The altered data of the recommended VM/server group policy"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AppWhitelistingPutGroupData { + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(rename = "enforcementMode", default, skip_serializing_if = "Option::is_none")] + pub enforcement_mode: Option, + #[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] + #[serde(rename = "protectionMode", default, skip_serializing_if = "Option::is_none")] + pub protection_mode: Option, + #[serde(rename = "vmRecommendations", default, skip_serializing_if = "Option::is_none")] + pub vm_recommendations: Option, + #[serde(rename = "pathRecommendations", default, skip_serializing_if = "Option::is_none")] + pub path_recommendations: Option, +} +impl AppWhitelistingPutGroupData { + pub fn new() -> Self { + Self::default() + } +} +pub type AppWhitelistingResourceType = String; +#[doc = "The ASC location of the subscription is in the \"name\" field"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "An empty set of properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AscLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of locations where ASC saves your data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocationList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AscLocationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AscLocationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An empty set of properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocationProperties {} +impl AscLocationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents an ATA security solution which sends logs to an OMS workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AtaExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AtaExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AtaSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(rename = "lastEventReceived", default, skip_serializing_if = "Option::is_none")] + pub last_event_received: Option, +} +impl AtaSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for cloud authentication management"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationDetailsProperties { + #[doc = "State of the multi-cloud connector"] + #[serde(rename = "authenticationProvisioningState", default, skip_serializing_if = "Option::is_none")] + pub authentication_provisioning_state: Option, + #[doc = "The permissions detected in the cloud account."] + #[serde( + rename = "grantedPermissions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub granted_permissions: Vec, + #[doc = "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials."] + #[serde(rename = "authenticationType")] + pub authentication_type: authentication_details_properties::AuthenticationType, +} +impl AuthenticationDetailsProperties { + pub fn new(authentication_type: authentication_details_properties::AuthenticationType) -> Self { + Self { + authentication_provisioning_state: None, + granted_permissions: Vec::new(), + authentication_type, + } + } +} +pub mod authentication_details_properties { + use super::*; + #[doc = "State of the multi-cloud connector"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthenticationProvisioningState")] + pub enum AuthenticationProvisioningState { + Valid, + Invalid, + Expired, + IncorrectPolicy, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AuthenticationProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthenticationProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthenticationProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("AuthenticationProvisioningState", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("AuthenticationProvisioningState", 1u32, "Invalid"), + Self::Expired => serializer.serialize_unit_variant("AuthenticationProvisioningState", 2u32, "Expired"), + Self::IncorrectPolicy => serializer.serialize_unit_variant("AuthenticationProvisioningState", 3u32, "IncorrectPolicy"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthenticationType")] + pub enum AuthenticationType { + #[serde(rename = "awsCreds")] + AwsCreds, + #[serde(rename = "awsAssumeRole")] + AwsAssumeRole, + #[serde(rename = "gcpCredentials")] + GcpCredentials, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AuthenticationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthenticationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthenticationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsCreds => serializer.serialize_unit_variant("AuthenticationType", 0u32, "awsCreds"), + Self::AwsAssumeRole => serializer.serialize_unit_variant("AuthenticationType", 1u32, "awsAssumeRole"), + Self::GcpCredentials => serializer.serialize_unit_variant("AuthenticationType", 2u32, "gcpCredentials"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Auto provisioning setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoProvisioningSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of an auto provisioning setting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AutoProvisioningSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of all the auto provisioning settings response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoProvisioningSettingList { + #[doc = "List of all the auto provisioning settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AutoProvisioningSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AutoProvisioningSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of an auto provisioning setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutoProvisioningSettingProperties { + #[doc = "Describes what kind of security agent provisioning action to take"] + #[serde(rename = "autoProvision")] + pub auto_provision: auto_provisioning_setting_properties::AutoProvision, +} +impl AutoProvisioningSettingProperties { + pub fn new(auto_provision: auto_provisioning_setting_properties::AutoProvision) -> Self { + Self { auto_provision } + } +} +pub mod auto_provisioning_setting_properties { + use super::*; + #[doc = "Describes what kind of security agent provisioning action to take"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoProvision")] + pub enum AutoProvision { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoProvision { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoProvision { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoProvision { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("AutoProvision", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("AutoProvision", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The security automation resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Automation { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "A set of properties that defines the behavior of the automation configuration. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Automation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The action that should be triggered."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationAction { + #[doc = "The type of the action that will be triggered by the Automation"] + #[serde(rename = "actionType")] + pub action_type: automation_action::ActionType, +} +impl AutomationAction { + pub fn new(action_type: automation_action::ActionType) -> Self { + Self { action_type } + } +} +pub mod automation_action { + use super::*; + #[doc = "The type of the action that will be triggered by the Automation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + LogicApp, + EventHub, + Workspace, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::LogicApp => serializer.serialize_unit_variant("ActionType", 0u32, "LogicApp"), + Self::EventHub => serializer.serialize_unit_variant("ActionType", 1u32, "EventHub"), + Self::Workspace => serializer.serialize_unit_variant("ActionType", 2u32, "Workspace"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionEventHub { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The target Event Hub Azure Resource ID."] + #[serde(rename = "eventHubResourceId", default, skip_serializing_if = "Option::is_none")] + pub event_hub_resource_id: Option, + #[doc = "The target Event Hub SAS policy name."] + #[serde(rename = "sasPolicyName", default, skip_serializing_if = "Option::is_none")] + pub sas_policy_name: Option, + #[doc = "The target Event Hub connection string (it will not be included in any response)."] + #[serde(rename = "connectionString", default, skip_serializing_if = "Option::is_none")] + pub connection_string: Option, +} +impl AutomationActionEventHub { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + event_hub_resource_id: None, + sas_policy_name: None, + connection_string: None, + } + } +} +#[doc = "The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionLogicApp { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App"] + #[serde(rename = "logicAppResourceId", default, skip_serializing_if = "Option::is_none")] + pub logic_app_resource_id: Option, + #[doc = "The Logic App trigger URI endpoint (it will not be included in any response)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} +impl AutomationActionLogicApp { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + logic_app_resource_id: None, + uri: None, + } + } +} +#[doc = "The\u{a0}Log\u{a0}Analytics\u{a0}Workspace\u{a0}to\u{a0}which\u{a0}event data will be exported. Security alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionWorkspace { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The fully qualified Log Analytics Workspace Azure Resource ID."] + #[serde(rename = "workspaceResourceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_resource_id: Option, +} +impl AutomationActionWorkspace { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + workspace_resource_id: None, + } + } +} +#[doc = "List of security automations response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationList { + #[doc = "The list of security automations under the given scope."] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AutomationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AutomationList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "A set of properties that defines the behavior of the automation configuration. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationProperties { + #[doc = "The security automation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Indicates whether the security automation is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option, + #[doc = "A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub scopes: Vec, + #[doc = "A collection of the source event types which evaluate the security automation set of rules."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub sources: Vec, + #[doc = "A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub actions: Vec, +} +impl AutomationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationRuleSet { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, +} +impl AutomationRuleSet { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A single automation scope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationScope { + #[doc = "The resources scope description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs)."] + #[serde(rename = "scopePath", default, skip_serializing_if = "Option::is_none")] + pub scope_path: Option, +} +impl AutomationScope { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The source event types which evaluate the security automation set of rules. For example - security alerts and security assessments. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationSource { + #[doc = "A valid event source type."] + #[serde(rename = "eventSource", default, skip_serializing_if = "Option::is_none")] + pub event_source: Option, + #[doc = "A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or')."] + #[serde( + rename = "ruleSets", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rule_sets: Vec, +} +impl AutomationSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod automation_source { + use super::*; + #[doc = "A valid event source type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventSource")] + pub enum EventSource { + Assessments, + AssessmentsSnapshot, + SubAssessments, + SubAssessmentsSnapshot, + Alerts, + SecureScores, + SecureScoresSnapshot, + SecureScoreControls, + SecureScoreControlsSnapshot, + RegulatoryComplianceAssessment, + RegulatoryComplianceAssessmentSnapshot, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventSource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventSource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventSource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Assessments => serializer.serialize_unit_variant("EventSource", 0u32, "Assessments"), + Self::AssessmentsSnapshot => serializer.serialize_unit_variant("EventSource", 1u32, "AssessmentsSnapshot"), + Self::SubAssessments => serializer.serialize_unit_variant("EventSource", 2u32, "SubAssessments"), + Self::SubAssessmentsSnapshot => serializer.serialize_unit_variant("EventSource", 3u32, "SubAssessmentsSnapshot"), + Self::Alerts => serializer.serialize_unit_variant("EventSource", 4u32, "Alerts"), + Self::SecureScores => serializer.serialize_unit_variant("EventSource", 5u32, "SecureScores"), + Self::SecureScoresSnapshot => serializer.serialize_unit_variant("EventSource", 6u32, "SecureScoresSnapshot"), + Self::SecureScoreControls => serializer.serialize_unit_variant("EventSource", 7u32, "SecureScoreControls"), + Self::SecureScoreControlsSnapshot => serializer.serialize_unit_variant("EventSource", 8u32, "SecureScoreControlsSnapshot"), + Self::RegulatoryComplianceAssessment => { + serializer.serialize_unit_variant("EventSource", 9u32, "RegulatoryComplianceAssessment") + } + Self::RegulatoryComplianceAssessmentSnapshot => { + serializer.serialize_unit_variant("EventSource", 10u32, "RegulatoryComplianceAssessmentSnapshot") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the event model to an expected value. This comparison is done by using one of the supported operators set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationTriggeringRule { + #[doc = "The JPath of the entity model property that should be checked."] + #[serde(rename = "propertyJPath", default, skip_serializing_if = "Option::is_none")] + pub property_j_path: Option, + #[doc = "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]"] + #[serde(rename = "propertyType", default, skip_serializing_if = "Option::is_none")] + pub property_type: Option, + #[doc = "The expected value."] + #[serde(rename = "expectedValue", default, skip_serializing_if = "Option::is_none")] + pub expected_value: Option, + #[doc = "A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, +} +impl AutomationTriggeringRule { + pub fn new() -> Self { + Self::default() + } +} +pub mod automation_triggering_rule { + use super::*; + #[doc = "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PropertyType")] + pub enum PropertyType { + String, + Integer, + Number, + Boolean, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PropertyType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PropertyType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PropertyType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::String => serializer.serialize_unit_variant("PropertyType", 0u32, "String"), + Self::Integer => serializer.serialize_unit_variant("PropertyType", 1u32, "Integer"), + Self::Number => serializer.serialize_unit_variant("PropertyType", 2u32, "Number"), + Self::Boolean => serializer.serialize_unit_variant("PropertyType", 3u32, "Boolean"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + Equals, + GreaterThan, + GreaterThanOrEqualTo, + LesserThan, + LesserThanOrEqualTo, + NotEquals, + Contains, + StartsWith, + EndsWith, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Equals => serializer.serialize_unit_variant("Operator", 0u32, "Equals"), + Self::GreaterThan => serializer.serialize_unit_variant("Operator", 1u32, "GreaterThan"), + Self::GreaterThanOrEqualTo => serializer.serialize_unit_variant("Operator", 2u32, "GreaterThanOrEqualTo"), + Self::LesserThan => serializer.serialize_unit_variant("Operator", 3u32, "LesserThan"), + Self::LesserThanOrEqualTo => serializer.serialize_unit_variant("Operator", 4u32, "LesserThanOrEqualTo"), + Self::NotEquals => serializer.serialize_unit_variant("Operator", 5u32, "NotEquals"), + Self::Contains => serializer.serialize_unit_variant("Operator", 6u32, "Contains"), + Self::StartsWith => serializer.serialize_unit_variant("Operator", 7u32, "StartsWith"), + Self::EndsWith => serializer.serialize_unit_variant("Operator", 8u32, "EndsWith"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The security automation model state property bag."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationValidationStatus { + #[doc = "Indicates whether the model is valid or not."] + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option, + #[doc = "The validation message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl AutomationValidationStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AWS cloud account connector based assume role, the role enables delegating access to your AWS resources. The role is composed of role Amazon Resource Name (ARN) and external ID. For more details, refer to Creating a Role to Delegate Permissions to an IAM User (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwAssumeRoleAuthenticationDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The ID of the cloud account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "Assumed role ID is an identifier that you can use to create temporary security credentials."] + #[serde(rename = "awsAssumeRoleArn")] + pub aws_assume_role_arn: String, + #[doc = "A unique identifier that is required when you assume a role in another account."] + #[serde(rename = "awsExternalId")] + pub aws_external_id: String, +} +impl AwAssumeRoleAuthenticationDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + aws_assume_role_arn: String, + aws_external_id: String, + ) -> Self { + Self { + authentication_details_properties, + account_id: None, + aws_assume_role_arn, + aws_external_id, + } + } +} +#[doc = "AWS cloud account connector based credentials, the credentials is composed of access key ID and secret key, for more details, refer to Creating an IAM User in Your AWS Account (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsCredsAuthenticationDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The ID of the cloud account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "Public key element of the AWS credential object (write only)"] + #[serde(rename = "awsAccessKeyId")] + pub aws_access_key_id: String, + #[doc = "Secret key element of the AWS credential object (write only)"] + #[serde(rename = "awsSecretAccessKey")] + pub aws_secret_access_key: String, +} +impl AwsCredsAuthenticationDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + aws_access_key_id: String, + aws_secret_access_key: String, + ) -> Self { + Self { + authentication_details_properties, + account_id: None, + aws_access_key_id, + aws_secret_access_key, + } + } +} +#[doc = "The aws connector environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, + #[doc = "The awsOrganization data "] + #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] + pub organizational_data: Option, +} +impl AwsEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { + environment_data, + organizational_data: None, + } + } +} +#[doc = "The awsOrganization data "] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalData { + #[doc = "The multi cloud account's membership type in the organization"] + #[serde(rename = "organizationMembershipType")] + pub organization_membership_type: aws_organizational_data::OrganizationMembershipType, +} +impl AwsOrganizationalData { + pub fn new(organization_membership_type: aws_organizational_data::OrganizationMembershipType) -> Self { + Self { + organization_membership_type, + } + } +} +pub mod aws_organizational_data { + use super::*; + #[doc = "The multi cloud account's membership type in the organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OrganizationMembershipType")] + pub enum OrganizationMembershipType { + Member, + Organization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OrganizationMembershipType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OrganizationMembershipType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OrganizationMembershipType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), + Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The awsOrganization data for the master account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalDataMaster { + #[serde(flatten)] + pub aws_organizational_data: AwsOrganizationalData, + #[doc = "If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset"] + #[serde(rename = "stacksetName", default, skip_serializing_if = "Option::is_none")] + pub stackset_name: Option, + #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] + #[serde( + rename = "excludedAccountIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_account_ids: Vec, +} +impl AwsOrganizationalDataMaster { + pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { + Self { + aws_organizational_data, + stackset_name: None, + excluded_account_ids: Vec::new(), + } + } +} +#[doc = "The awsOrganization data for the member account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalDataMember { + #[serde(flatten)] + pub aws_organizational_data: AwsOrganizationalData, + #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the account's parent"] + #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] + pub parent_hierarchy_id: Option, +} +impl AwsOrganizationalDataMember { + pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { + Self { + aws_organizational_data, + parent_hierarchy_id: None, + } + } +} +#[doc = "The AzureDevOps scope connector's environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureDevOpsScopeEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, +} +impl AzureDevOpsScopeEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { environment_data } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureResourceLink { + #[doc = "Azure resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl AzureResourceLink { + pub fn new() -> Self { + Self::default() + } +} +pub type AzureResourceLinks = Vec; +#[doc = "Describes an Azure resource with location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureTrackedResourceLocation { + #[doc = "Location where the resource is stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl AzureTrackedResourceLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Baseline details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Baseline { + #[doc = "Expected results."] + #[serde( + rename = "expectedResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub expected_results: Vec>, + #[doc = "Baseline update time (UTC)."] + #[serde(rename = "updatedTime", default, with = "azure_core::date::rfc3339::option")] + pub updated_time: Option, +} +impl Baseline { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule result adjusted with baseline."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BaselineAdjustedResult { + #[doc = "Baseline details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub baseline: Option, + #[doc = "The rule result status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Results the are not in baseline."] + #[serde( + rename = "resultsNotInBaseline", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results_not_in_baseline: Vec>, + #[doc = "Results the are in baseline."] + #[serde( + rename = "resultsOnlyInBaseline", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results_only_in_baseline: Vec>, +} +impl BaselineAdjustedResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The benchmark references."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenchmarkReference { + #[doc = "The benchmark name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub benchmark: Option, + #[doc = "The benchmark reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reference: Option, +} +impl BenchmarkReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "CVE details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cve { + #[doc = "CVE title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Link url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option, +} +impl Cve { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "CVSS details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cvss { + #[doc = "CVSS base"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub base: Option, +} +impl Cvss { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a security solution which sends CEF logs to an OMS workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CefExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CefExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CefSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option, + #[serde(rename = "lastEventReceived", default, skip_serializing_if = "Option::is_none")] + pub last_event_received: Option, +} +impl CefSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudError { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for CloudError { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl CloudError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudErrorBody { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl CloudErrorBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Compliance of a scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Compliance { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Compliance { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of Compliance objects response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceList { + #[doc = "List of Compliance objects"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ComplianceList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ComplianceList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceProperties { + #[doc = "The timestamp when the Compliance calculation was conducted."] + #[serde(rename = "assessmentTimestampUtcDate", default, with = "azure_core::date::rfc3339::option")] + pub assessment_timestamp_utc_date: Option, + #[doc = "The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation)."] + #[serde(rename = "resourceCount", default, skip_serializing_if = "Option::is_none")] + pub resource_count: Option, + #[doc = "An array of segment, which is the actually the compliance assessment."] + #[serde( + rename = "assessmentResult", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub assessment_result: Vec, +} +impl ComplianceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A segment of a compliance assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceSegment { + #[doc = "The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc."] + #[serde(rename = "segmentType", default, skip_serializing_if = "Option::is_none")] + pub segment_type: Option, + #[doc = "The size (%) of the segment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl ComplianceSegment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The configuration status of the VM/server group or machine or rule on the machine"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum ConfigurationStatus { + Configured, + NotConfigured, + InProgress, + Failed, + NoStatus, +} +#[doc = "Describes the allowed inbound and outbound traffic of an Azure resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectableResource { + #[doc = "The Azure resource id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The list of Azure resources that the resource has inbound allowed connection from"] + #[serde( + rename = "inboundConnectedResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_connected_resources: Vec, + #[doc = "The list of Azure resources that the resource has outbound allowed connection to"] + #[serde( + rename = "outboundConnectedResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub outbound_connected_resources: Vec, +} +impl ConnectableResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a connected resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectedResource { + #[doc = "The Azure resource id of the connected resource"] + #[serde(rename = "connectedResourceId", default, skip_serializing_if = "Option::is_none")] + pub connected_resource_id: Option, + #[doc = "The allowed tcp ports"] + #[serde(rename = "tcpPorts", default, skip_serializing_if = "Option::is_none")] + pub tcp_ports: Option, + #[doc = "The allowed udp ports"] + #[serde(rename = "udpPorts", default, skip_serializing_if = "Option::is_none")] + pub udp_ports: Option, +} +impl ConnectedResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectedWorkspace { + #[doc = "Azure resource ID of the connected OMS workspace"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ConnectedWorkspace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Connection string for ingesting security data and logs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionStrings { + #[doc = "Connection strings"] + pub value: Vec, +} +impl ConnectionStrings { + pub fn new(value: Vec) -> Self { + Self { value } + } +} +#[doc = "Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionToIpNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ConnectionToIpNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "The connector setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a connector setting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ConnectorSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "For a subscription, list of all cloud account connectors and their settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSettingList { + #[doc = "List of all the cloud account connector settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ConnectorSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ConnectorSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a connector setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSettingProperties { + #[doc = "Settings for hybrid compute management"] + #[serde(rename = "hybridComputeSettings", default, skip_serializing_if = "Option::is_none")] + pub hybrid_compute_settings: Option, + #[doc = "Settings for cloud authentication management"] + #[serde(rename = "authenticationDetails", default, skip_serializing_if = "Option::is_none")] + pub authentication_details: Option, +} +impl ConnectorSettingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Additional context fields for container registry Vulnerability assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ContainerRegistryVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Dictionary from cvss version to cvss details object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cvss: Option, + #[doc = "Indicates whether a patch is available or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patchable: Option, + #[doc = "List of CVEs"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cve: Vec, + #[doc = "Published time"] + #[serde(rename = "publishedTime", default, with = "azure_core::date::rfc3339::option")] + pub published_time: Option, + #[serde( + rename = "vendorReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vendor_references: Vec, + #[doc = "Name of the repository which the vulnerable image belongs to"] + #[serde(rename = "repositoryName", default, skip_serializing_if = "Option::is_none")] + pub repository_name: Option, + #[doc = "Digest of the vulnerable image"] + #[serde(rename = "imageDigest", default, skip_serializing_if = "Option::is_none")] + pub image_digest: Option, +} +impl ContainerRegistryVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + cvss: None, + patchable: None, + cve: Vec::new(), + published_time: None, + vendor_references: Vec::new(), + repository_name: None, + image_digest: None, + } + } +} +#[doc = "A custom alert rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CustomAlertRule { + #[doc = "The display name of the custom alert."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the custom alert."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Status of the custom alert."] + #[serde(rename = "isEnabled")] + pub is_enabled: bool, + #[doc = "The type of the custom alert rule."] + #[serde(rename = "ruleType")] + pub rule_type: String, +} +impl CustomAlertRule { + pub fn new(is_enabled: bool, rule_type: String) -> Self { + Self { + display_name: None, + description: None, + is_enabled, + rule_type, + } + } +} +#[doc = "Custom entity store assignment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "describes the custom entity store assignment properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomEntityStoreAssignment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the custom entity store assignment properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentProperties { + #[doc = "The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub principal: Option, + #[doc = "The link to entity store database."] + #[serde(rename = "entityStoreDatabaseLink", default, skip_serializing_if = "Option::is_none")] + pub entity_store_database_link: Option, +} +impl CustomEntityStoreAssignmentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the custom entity store assignment request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentRequest { + #[doc = "describes properties of custom entity store assignment request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomEntityStoreAssignmentRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of custom entity store assignment request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentRequestProperties { + #[doc = "The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub principal: Option, +} +impl CustomEntityStoreAssignmentRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of custom entity store assignments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentsListResult { + #[doc = "Collection of custom entity store assignments"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CustomEntityStoreAssignmentsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CustomEntityStoreAssignmentsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a data export setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSetting { + #[serde(flatten)] + pub setting: Setting, + #[doc = "The data export setting properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DataExportSetting { + pub fn new(setting: Setting) -> Self { + Self { setting, properties: None } + } +} +#[doc = "The data export setting properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSettingProperties { + #[doc = "Is the data export setting is enabled"] + pub enabled: bool, +} +impl DataExportSettingProperties { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is denied."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DenylistCustomAlertRule { + #[serde(flatten)] + pub list_custom_alert_rule: ListCustomAlertRule, + #[doc = "The values to deny. The format of the values depends on the rule type."] + #[serde(rename = "denylistValues")] + pub denylist_values: Vec, +} +impl DenylistCustomAlertRule { + pub fn new(list_custom_alert_rule: ListCustomAlertRule, denylist_values: Vec) -> Self { + Self { + list_custom_alert_rule, + denylist_values, + } + } +} +#[doc = "The device security group resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroup { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of a security group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DeviceSecurityGroup { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of device security groups"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroupList { + #[doc = "List of device security group objects"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceSecurityGroupList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DeviceSecurityGroupList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of a security group."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroupProperties { + #[doc = "The list of custom alert threshold rules."] + #[serde( + rename = "thresholdRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub threshold_rules: Vec, + #[doc = "The list of custom alert time-window rules."] + #[serde( + rename = "timeWindowRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub time_window_rules: Vec, + #[doc = "The allow-list custom alert rules."] + #[serde( + rename = "allowlistRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowlist_rules: Vec, + #[doc = "The deny-list custom alert rules."] + #[serde( + rename = "denylistRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub denylist_rules: Vec, +} +impl DeviceSecurityGroupProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of direct method invokes is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DirectMethodInvokesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl DirectMethodInvokesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiscoveredSecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + pub properties: DiscoveredSecuritySolutionProperties, +} +impl DiscoveredSecuritySolution { + pub fn new(properties: DiscoveredSecuritySolutionProperties) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiscoveredSecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DiscoveredSecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DiscoveredSecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiscoveredSecuritySolutionProperties { + #[doc = "The security family of the discovered solution"] + #[serde(rename = "securityFamily")] + pub security_family: discovered_security_solution_properties::SecurityFamily, + #[doc = "The security solutions' image offer"] + pub offer: String, + #[doc = "The security solutions' image publisher"] + pub publisher: String, + #[doc = "The security solutions' image sku"] + pub sku: String, +} +impl DiscoveredSecuritySolutionProperties { + pub fn new( + security_family: discovered_security_solution_properties::SecurityFamily, + offer: String, + publisher: String, + sku: String, + ) -> Self { + Self { + security_family, + offer, + publisher, + sku, + } + } +} +pub mod discovered_security_solution_properties { + use super::*; + #[doc = "The security family of the discovered solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SecurityFamily")] + pub enum SecurityFamily { + Waf, + Ngfw, + SaasWaf, + Va, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SecurityFamily { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SecurityFamily { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SecurityFamily { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Waf => serializer.serialize_unit_variant("SecurityFamily", 0u32, "Waf"), + Self::Ngfw => serializer.serialize_unit_variant("SecurityFamily", 1u32, "Ngfw"), + Self::SaasWaf => serializer.serialize_unit_variant("SecurityFamily", 2u32, "SaasWaf"), + Self::Va => serializer.serialize_unit_variant("SecurityFamily", 3u32, "Va"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ETag { + #[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl ETag { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the Network Security Groups effective on a network interface"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EffectiveNetworkSecurityGroups { + #[doc = "The Azure resource ID of the network interface"] + #[serde(rename = "networkInterface", default, skip_serializing_if = "Option::is_none")] + pub network_interface: Option, + #[doc = "The Network Security Groups effective on the network interface"] + #[serde( + rename = "networkSecurityGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_security_groups: Vec, +} +impl EffectiveNetworkSecurityGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The application control policy enforcement/protection mode of the VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum EnforcementMode { + Audit, + Enforce, + None, +} +#[doc = "The VM/server supportability of Enforce feature"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum EnforcementSupport { + Supported, + NotSupported, + Unknown, +} +#[doc = "The security connector environment data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnvironmentData { + #[doc = "The type of the environment data."] + #[serde(rename = "environmentType")] + pub environment_type: environment_data::EnvironmentType, +} +impl EnvironmentData { + pub fn new(environment_type: environment_data::EnvironmentType) -> Self { + Self { environment_type } + } +} +pub mod environment_data { + use super::*; + #[doc = "The type of the environment data."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EnvironmentType")] + pub enum EnvironmentType { + AwsAccount, + GcpProject, + GithubScope, + AzureDevOpsScope, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EnvironmentType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EnvironmentType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EnvironmentType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsAccount => serializer.serialize_unit_variant("EnvironmentType", 0u32, "AwsAccount"), + Self::GcpProject => serializer.serialize_unit_variant("EnvironmentType", 1u32, "GcpProject"), + Self::GithubScope => serializer.serialize_unit_variant("EnvironmentType", 2u32, "GithubScope"), + Self::AzureDevOpsScope => serializer.serialize_unit_variant("EnvironmentType", 3u32, "AzureDevOpsScope"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub external_security_solution_kind: ExternalSecuritySolutionKind, + #[serde(flatten)] + pub location: Location, +} +impl ExternalSecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionKind { + #[doc = "The kind of the external solution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl ExternalSecuritySolutionKind { + pub fn new() -> Self { + Self::default() + } +} +pub mod external_security_solution_kind { + use super::*; + #[doc = "The kind of the external solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + #[serde(rename = "CEF")] + Cef, + #[serde(rename = "ATA")] + Ata, + #[serde(rename = "AAD")] + Aad, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Cef => serializer.serialize_unit_variant("Kind", 0u32, "CEF"), + Self::Ata => serializer.serialize_unit_variant("Kind", 1u32, "ATA"), + Self::Aad => serializer.serialize_unit_variant("Kind", 2u32, "AAD"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExternalSecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExternalSecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The solution properties (correspond to the solution kind)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionProperties { + #[serde(rename = "deviceVendor", default, skip_serializing_if = "Option::is_none")] + pub device_vendor: Option, + #[serde(rename = "deviceType", default, skip_serializing_if = "Option::is_none")] + pub device_type: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option, +} +impl ExternalSecuritySolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of failed local logins is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FailedLocalLoginsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl FailedLocalLoginsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The type of the file (for Linux files - Executable is used)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum FileType { + Exe, + Dll, + Msi, + Script, + Executable, + Unknown, +} +#[doc = "Number of file uploads is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileUploadsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl FileUploadsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID and a JSON API key (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpCredentialsDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The organization ID of the GCP cloud account"] + #[serde(rename = "organizationId")] + pub organization_id: String, + #[doc = "Type field of the API key (write only)"] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Project ID field of the API key (write only)"] + #[serde(rename = "projectId")] + pub project_id: String, + #[doc = "Private key ID field of the API key (write only)"] + #[serde(rename = "privateKeyId")] + pub private_key_id: String, + #[doc = "Private key field of the API key (write only)"] + #[serde(rename = "privateKey")] + pub private_key: String, + #[doc = "Client email field of the API key (write only)"] + #[serde(rename = "clientEmail")] + pub client_email: String, + #[doc = "Client ID field of the API key (write only)"] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Auth URI field of the API key (write only)"] + #[serde(rename = "authUri")] + pub auth_uri: String, + #[doc = "Token URI field of the API key (write only)"] + #[serde(rename = "tokenUri")] + pub token_uri: String, + #[doc = "Auth provider x509 certificate URL field of the API key (write only)"] + #[serde(rename = "authProviderX509CertUrl")] + pub auth_provider_x509_cert_url: String, + #[doc = "Client x509 certificate URL field of the API key (write only)"] + #[serde(rename = "clientX509CertUrl")] + pub client_x509_cert_url: String, +} +impl GcpCredentialsDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + organization_id: String, + type_: String, + project_id: String, + private_key_id: String, + private_key: String, + client_email: String, + client_id: String, + auth_uri: String, + token_uri: String, + auth_provider_x509_cert_url: String, + client_x509_cert_url: String, + ) -> Self { + Self { + authentication_details_properties, + organization_id, + type_, + project_id, + private_key_id, + private_key, + client_email, + client_id, + auth_uri, + token_uri, + auth_provider_x509_cert_url, + client_x509_cert_url, + } + } +} +#[doc = "The gcpOrganization data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalData { + #[doc = "The multi cloud account's membership type in the organization"] + #[serde(rename = "organizationMembershipType")] + pub organization_membership_type: gcp_organizational_data::OrganizationMembershipType, +} +impl GcpOrganizationalData { + pub fn new(organization_membership_type: gcp_organizational_data::OrganizationMembershipType) -> Self { + Self { + organization_membership_type, + } + } +} +pub mod gcp_organizational_data { + use super::*; + #[doc = "The multi cloud account's membership type in the organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OrganizationMembershipType")] + pub enum OrganizationMembershipType { + Member, + Organization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OrganizationMembershipType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OrganizationMembershipType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OrganizationMembershipType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), + Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The gcpOrganization data for the member account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalDataMember { + #[serde(flatten)] + pub gcp_organizational_data: GcpOrganizationalData, + #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the project's parent"] + #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] + pub parent_hierarchy_id: Option, + #[doc = "The GCP management project number from organizational onboarding"] + #[serde(rename = "managementProjectNumber", default, skip_serializing_if = "Option::is_none")] + pub management_project_number: Option, +} +impl GcpOrganizationalDataMember { + pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { + Self { + gcp_organizational_data, + parent_hierarchy_id: None, + management_project_number: None, + } + } +} +#[doc = "The gcpOrganization data for the parent account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalDataOrganization { + #[serde(flatten)] + pub gcp_organizational_data: GcpOrganizationalData, + #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] + #[serde( + rename = "excludedProjectNumbers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_project_numbers: Vec, + #[doc = "The service account email address which represents the organization level permissions container."] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id which represents the permissions required to auto provision security connectors"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, +} +impl GcpOrganizationalDataOrganization { + pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { + Self { + gcp_organizational_data, + excluded_project_numbers: Vec::new(), + service_account_email_address: None, + workload_identity_provider_id: None, + } + } +} +#[doc = "The details about the project represented by the security connector"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GcpProjectDetails { + #[doc = "The unique GCP Project number"] + #[serde(rename = "projectNumber", default, skip_serializing_if = "Option::is_none")] + pub project_number: Option, + #[doc = "The GCP Project id"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option, + #[doc = "The GCP workload identity federation pool id"] + #[serde(rename = "workloadIdentityPoolId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_pool_id: Option, +} +impl GcpProjectDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The GCP project connector environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpProjectEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, + #[doc = "The gcpOrganization data"] + #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] + pub organizational_data: Option, + #[doc = "The details about the project represented by the security connector"] + #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] + pub project_details: Option, +} +impl GcpProjectEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { + environment_data, + organizational_data: None, + project_details: None, + } + } +} +#[doc = "The github scope connector's environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GithubScopeEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, +} +impl GithubScopeEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { environment_data } + } +} +pub type GroupResourceId = String; +#[doc = "Number of cloud to device messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Settings for hybrid compute management"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridComputeSettingsProperties { + #[doc = "State of the service principal and its secret"] + #[serde(rename = "hybridComputeProvisioningState", default, skip_serializing_if = "Option::is_none")] + pub hybrid_compute_provisioning_state: Option, + #[doc = "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines"] + #[serde(rename = "autoProvision")] + pub auto_provision: hybrid_compute_settings_properties::AutoProvision, + #[doc = "The name of the resource group where Arc (Hybrid Compute) connectors are connected."] + #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] + pub resource_group_name: Option, + #[doc = "The location where the metadata of machines will be stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use."] + #[serde(rename = "proxyServer", default, skip_serializing_if = "Option::is_none")] + pub proxy_server: Option, + #[doc = "Details of the service principal."] + #[serde(rename = "servicePrincipal", default, skip_serializing_if = "Option::is_none")] + pub service_principal: Option, +} +impl HybridComputeSettingsProperties { + pub fn new(auto_provision: hybrid_compute_settings_properties::AutoProvision) -> Self { + Self { + hybrid_compute_provisioning_state: None, + auto_provision, + resource_group_name: None, + region: None, + proxy_server: None, + service_principal: None, + } + } +} +pub mod hybrid_compute_settings_properties { + use super::*; + #[doc = "State of the service principal and its secret"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "HybridComputeProvisioningState")] + pub enum HybridComputeProvisioningState { + Valid, + Invalid, + Expired, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for HybridComputeProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for HybridComputeProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for HybridComputeProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("HybridComputeProvisioningState", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("HybridComputeProvisioningState", 1u32, "Invalid"), + Self::Expired => serializer.serialize_unit_variant("HybridComputeProvisioningState", 2u32, "Expired"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoProvision")] + pub enum AutoProvision { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoProvision { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoProvision { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoProvision { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("AutoProvision", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("AutoProvision", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The information type keyword."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionKeyword { + #[doc = "The keyword pattern."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option, + #[doc = "Indicates whether the keyword is custom or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[doc = "Indicates whether the keyword can be applied on numeric types or not."] + #[serde(rename = "canBeNumeric", default, skip_serializing_if = "Option::is_none")] + pub can_be_numeric: Option, + #[doc = "Indicates whether the keyword is excluded or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub excluded: Option, +} +impl InformationProtectionKeyword { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information protection policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicy { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of an information protection policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl InformationProtectionPolicy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information protection policies response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicyList { + #[doc = "List of information protection policies."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for InformationProtectionPolicyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl InformationProtectionPolicyList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of an information protection policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicyProperties { + #[doc = "Describes the last UTC time the policy was modified."] + #[serde(rename = "lastModifiedUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_utc: Option, + #[doc = "Describes the version of the policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Dictionary of sensitivity labels."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub labels: Option, + #[doc = "The sensitivity information types."] + #[serde(rename = "informationTypes", default, skip_serializing_if = "Option::is_none")] + pub information_types: Option, +} +impl InformationProtectionPolicyProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The information type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationType { + #[doc = "The name of the information type."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the information type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The order of the information type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "The recommended label id to be associated with this information type."] + #[serde(rename = "recommendedLabelId", default, skip_serializing_if = "Option::is_none")] + pub recommended_label_id: Option, + #[doc = "Indicates whether the information type is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "Indicates whether the information type is custom or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[doc = "The information type keywords."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub keywords: Vec, +} +impl InformationType { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Connection string for ingesting security data and logs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionConnectionString { + #[doc = "The region where ingested logs and data resides"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Connection string value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl IngestionConnectionString { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Configures how to correlate scan data and logs with resources associated with the subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Ingestion setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IngestionSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of ingestion settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingList { + #[doc = "List of ingestion settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IngestionSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IngestionSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Ingestion setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingProperties {} +impl IngestionSettingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Configures how to correlate scan data and logs with resources associated with the subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingToken { + #[doc = "The token is used for correlating security data and logs with the resources in the subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option, +} +impl IngestionSettingToken { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Solution Aggregated Alert information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedAlert { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "Security Solution Aggregated Alert data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecurityAggregatedAlert { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of IoT aggregated security alerts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityAggregatedAlertList { + #[doc = "List of aggregated alerts data"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IoTSecurityAggregatedAlertList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IoTSecurityAggregatedAlertList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Security Solution Aggregated Alert data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedAlertProperties { + #[doc = "Name of the alert type"] + #[serde(rename = "alertType", default, skip_serializing_if = "Option::is_none")] + pub alert_type: Option, + #[doc = "Display name of the alert type"] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "The date the incidents were detected by the vendor"] + #[serde(rename = "aggregatedDateUtc", default, skip_serializing_if = "Option::is_none")] + pub aggregated_date_utc: Option, + #[doc = "Name of the vendor that discovered the incident"] + #[serde(rename = "vendorName", default, skip_serializing_if = "Option::is_none")] + pub vendor_name: Option, + #[doc = "Estimated severity of this alert"] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "Recommended steps for remediation"] + #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] + pub remediation_steps: Option, + #[doc = "Description of the incident and what it means"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Occurrence number of the alert within the aggregated date"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Azure resource ID of the resource that got the alerts"] + #[serde(rename = "effectedResourceType", default, skip_serializing_if = "Option::is_none")] + pub effected_resource_type: Option, + #[doc = "The type of the alerted resource (Azure, Non-Azure)"] + #[serde(rename = "systemSource", default, skip_serializing_if = "Option::is_none")] + pub system_source: Option, + #[doc = "The action that was taken as a response to the alert (Active, Blocked etc.)"] + #[serde(rename = "actionTaken", default, skip_serializing_if = "Option::is_none")] + pub action_taken: Option, + #[doc = "query in log analytics to get the list of affected devices/alerts"] + #[serde(rename = "logAnalyticsQuery", default, skip_serializing_if = "Option::is_none")] + pub log_analytics_query: Option, +} +impl IoTSecurityAggregatedAlertProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_aggregated_alert_properties { + use super::*; + #[doc = "Estimated severity of this alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Security Solution Recommendation Information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedRecommendation { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "Security Solution Recommendation Information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecurityAggregatedRecommendation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of IoT aggregated security recommendations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityAggregatedRecommendationList { + #[doc = "List of aggregated alerts data"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IoTSecurityAggregatedRecommendationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IoTSecurityAggregatedRecommendationList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Security Solution Recommendation Information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedRecommendationProperties { + #[doc = "Name of the recommendation"] + #[serde(rename = "recommendationName", default, skip_serializing_if = "Option::is_none")] + pub recommendation_name: Option, + #[doc = "Display name of the recommendation type."] + #[serde(rename = "recommendationDisplayName", default, skip_serializing_if = "Option::is_none")] + pub recommendation_display_name: Option, + #[doc = "Description of the incident and what it means"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The recommendation-type GUID."] + #[serde(rename = "recommendationTypeId", default, skip_serializing_if = "Option::is_none")] + pub recommendation_type_id: Option, + #[doc = "Name of the vendor that discovered the issue"] + #[serde(rename = "detectedBy", default, skip_serializing_if = "Option::is_none")] + pub detected_by: Option, + #[doc = "Recommended steps for remediation"] + #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] + pub remediation_steps: Option, + #[doc = "Estimated severity of this recommendation"] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "the number of the healthy devices within the solution"] + #[serde(rename = "healthyDevices", default, skip_serializing_if = "Option::is_none")] + pub healthy_devices: Option, + #[doc = "the number of the unhealthy devices within the solution"] + #[serde(rename = "unhealthyDeviceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_device_count: Option, + #[doc = "query in log analytics to get the list of affected devices/alerts"] + #[serde(rename = "logAnalyticsQuery", default, skip_serializing_if = "Option::is_none")] + pub log_analytics_query: Option, +} +impl IoTSecurityAggregatedRecommendationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_aggregated_recommendation_properties { + use super::*; + #[doc = "Estimated severity of this recommendation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Statistic information about the number of alerts per device during the last period"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAlertedDevice { + #[doc = "Name of the alert type"] + #[serde(rename = "deviceId", default, skip_serializing_if = "Option::is_none")] + pub device_id: Option, + #[doc = "the number of alerts raised for this device"] + #[serde(rename = "alertsCount", default, skip_serializing_if = "Option::is_none")] + pub alerts_count: Option, +} +impl IoTSecurityAlertedDevice { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of devices with the count of raised alerts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityAlertedDevicesList { + #[doc = "List of aggregated alerts data"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl IoTSecurityAlertedDevicesList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Statistic information about the number of alerts per alert type during the last period"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityDeviceAlert { + #[doc = "Display name of the alert"] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "Estimated severity of this alert"] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "the number of alerts raised for this alert type"] + #[serde(rename = "alertsCount", default, skip_serializing_if = "Option::is_none")] + pub alerts_count: Option, +} +impl IoTSecurityDeviceAlert { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_device_alert { + use super::*; + #[doc = "Estimated severity of this alert"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of alerts with the count of raised alerts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityDeviceAlertsList { + #[doc = "List of top alerts data"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl IoTSecurityDeviceAlertsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Statistic information about the number of recommendations per recommendation type"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityDeviceRecommendation { + #[doc = "Display name of the recommendation"] + #[serde(rename = "recommendationDisplayName", default, skip_serializing_if = "Option::is_none")] + pub recommendation_display_name: Option, + #[doc = "Estimated severity of this recommendation"] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "the number of device with this recommendation"] + #[serde(rename = "devicesCount", default, skip_serializing_if = "Option::is_none")] + pub devices_count: Option, +} +impl IoTSecurityDeviceRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_device_recommendation { + use super::*; + #[doc = "Estimated severity of this recommendation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of recommendations with the count of devices"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityDeviceRecommendationsList { + #[doc = "List of aggregated recommendation data"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl IoTSecurityDeviceRecommendationsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Security Analytics of a security solution"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecuritySolutionAnalyticsModel { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Security Analytics of a security solution properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecuritySolutionAnalyticsModel { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of Security Analytics of a security solution"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecuritySolutionAnalyticsModelList { + #[doc = "List of Security Analytics of a security solution"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl IoTSecuritySolutionAnalyticsModelList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Security Analytics of a security solution properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecuritySolutionAnalyticsModelProperties { + #[doc = "Severity metrics"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metrics: Option, + #[doc = "number of unhealthy devices"] + #[serde(rename = "unhealthyDeviceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_device_count: Option, + #[doc = "The list of devices metrics by the aggregated date."] + #[serde( + rename = "devicesMetrics", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub devices_metrics: Vec, + #[doc = "List of devices with the count of raised alerts"] + #[serde(rename = "topAlertedDevices", default, skip_serializing_if = "Option::is_none")] + pub top_alerted_devices: Option, + #[doc = "List of alerts with the count of raised alerts"] + #[serde(rename = "mostPrevalentDeviceAlerts", default, skip_serializing_if = "Option::is_none")] + pub most_prevalent_device_alerts: Option, + #[doc = "List of recommendations with the count of devices"] + #[serde(rename = "mostPrevalentDeviceRecommendations", default, skip_serializing_if = "Option::is_none")] + pub most_prevalent_device_recommendations: Option, +} +impl IoTSecuritySolutionAnalyticsModelProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Solution"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecuritySolutionModel { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "The resource location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Security Solution setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecuritySolutionModel { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Solution setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecuritySolutionProperties { + #[doc = "Workspace resource ID"] + pub workspace: String, + #[doc = "Resource display name."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Security solution status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "List of additional export to workspace data options"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub export: Vec, + #[doc = "Disabled data sources. Disabling these data sources compromises the system."] + #[serde( + rename = "disabledDataSources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub disabled_data_sources: Vec, + #[doc = "IoT Hub resource IDs"] + #[serde(rename = "iotHubs")] + pub iot_hubs: Vec, + #[doc = "Properties of the solution's user defined resources."] + #[serde(rename = "userDefinedResources", default, skip_serializing_if = "Option::is_none")] + pub user_defined_resources: Option, + #[doc = "List of resources that were automatically discovered as relevant to the security solution."] + #[serde( + rename = "autoDiscoveredResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub auto_discovered_resources: Vec, + #[doc = "List of recommendation configuration"] + #[serde(rename = "recommendationsConfiguration", default, skip_serializing_if = "Option::is_none")] + pub recommendations_configuration: Option, +} +impl IoTSecuritySolutionProperties { + pub fn new(workspace: String, display_name: String, iot_hubs: Vec) -> Self { + Self { + workspace, + display_name, + status: None, + export: Vec::new(), + disabled_data_sources: Vec::new(), + iot_hubs, + user_defined_resources: None, + auto_discovered_resources: Vec::new(), + recommendations_configuration: None, + } + } +} +pub mod io_t_security_solution_properties { + use super::*; + #[doc = "Security solution status"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Status", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Status", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Status { + fn default() -> Self { + Self::Enabled + } + } +} +#[doc = "List of iot solutions"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecuritySolutionsList { + #[doc = "List of security solutions"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IoTSecuritySolutionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IoTSecuritySolutionsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Severity metrics"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSeverityMetrics { + #[doc = "count of high severity items"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub high: Option, + #[doc = "count of medium severity items"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub medium: Option, + #[doc = "count of low severity items"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub low: Option, +} +impl IoTSeverityMetrics { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JitNetworkAccessPoliciesList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for JitNetworkAccessPoliciesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl JitNetworkAccessPoliciesList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicy { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub kind: Kind, + #[serde(flatten)] + pub location: Location, + pub properties: JitNetworkAccessPolicyProperties, +} +impl JitNetworkAccessPolicy { + pub fn new(properties: JitNetworkAccessPolicyProperties) -> Self { + Self { + resource: Resource::default(), + kind: Kind::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiatePort { + pub number: PortNumber, + #[doc = "Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "The time to close the request in UTC"] + #[serde(rename = "endTimeUtc", with = "azure_core::date::rfc3339")] + pub end_time_utc: time::OffsetDateTime, +} +impl JitNetworkAccessPolicyInitiatePort { + pub fn new(number: PortNumber, end_time_utc: time::OffsetDateTime) -> Self { + Self { + number, + allowed_source_address_prefix: None, + end_time_utc, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiateRequest { + #[doc = "A list of virtual machines & ports to open access for"] + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[doc = "The justification for making the initiate request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub justification: Option, +} +impl JitNetworkAccessPolicyInitiateRequest { + pub fn new(virtual_machines: Vec) -> Self { + Self { + virtual_machines, + justification: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiateVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "The ports to open for the resource with the `id`"] + pub ports: Vec, +} +impl JitNetworkAccessPolicyInitiateVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { id, ports } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyProperties { + #[doc = "Configurations for Microsoft.Compute/virtualMachines resource type."] + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub requests: Vec, + #[doc = "Gets the provisioning state of the Just-in-Time policy."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl JitNetworkAccessPolicyProperties { + pub fn new(virtual_machines: Vec) -> Self { + Self { + virtual_machines, + requests: Vec::new(), + provisioning_state: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "Port configurations for the virtual machine"] + pub ports: Vec, + #[doc = "Public IP address of the Azure Firewall that is linked to this policy, if applicable"] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, +} +impl JitNetworkAccessPolicyVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { + id, + ports, + public_ip_address: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPortRule { + pub number: PortNumber, + pub protocol: jit_network_access_port_rule::Protocol, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefixes\" parameter. Should be an IP address or CIDR, for example \"192.168.0.3\" or \"192.168.0.0/16\"."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefix\" parameter."] + #[serde( + rename = "allowedSourceAddressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_source_address_prefixes: Vec, + #[doc = "Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day"] + #[serde(rename = "maxRequestAccessDuration")] + pub max_request_access_duration: String, +} +impl JitNetworkAccessPortRule { + pub fn new(number: PortNumber, protocol: jit_network_access_port_rule::Protocol, max_request_access_duration: String) -> Self { + Self { + number, + protocol, + allowed_source_address_prefix: None, + allowed_source_address_prefixes: Vec::new(), + max_request_access_duration, + } + } +} +pub mod jit_network_access_port_rule { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Protocol")] + pub enum Protocol { + #[serde(rename = "TCP")] + Tcp, + #[serde(rename = "UDP")] + Udp, + #[serde(rename = "*")] + U2a, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Protocol { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Protocol { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Protocol { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "TCP"), + Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "UDP"), + Self::U2a => serializer.serialize_unit_variant("Protocol", 2u32, "*"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequest { + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[doc = "The start time of the request in UTC"] + #[serde(rename = "startTimeUtc", with = "azure_core::date::rfc3339")] + pub start_time_utc: time::OffsetDateTime, + #[doc = "The identity of the person who made the request"] + pub requestor: String, + #[doc = "The justification for making the initiate request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub justification: Option, +} +impl JitNetworkAccessRequest { + pub fn new( + virtual_machines: Vec, + start_time_utc: time::OffsetDateTime, + requestor: String, + ) -> Self { + Self { + virtual_machines, + start_time_utc, + requestor, + justification: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequestPort { + pub number: PortNumber, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefixes\" parameter. Should be an IP address or CIDR, for example \"192.168.0.3\" or \"192.168.0.0/16\"."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefix\" parameter."] + #[serde( + rename = "allowedSourceAddressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_source_address_prefixes: Vec, + #[doc = "The date & time at which the request ends in UTC"] + #[serde(rename = "endTimeUtc", with = "azure_core::date::rfc3339")] + pub end_time_utc: time::OffsetDateTime, + #[doc = "The status of the port"] + pub status: jit_network_access_request_port::Status, + #[doc = "A description of why the `status` has its value"] + #[serde(rename = "statusReason")] + pub status_reason: jit_network_access_request_port::StatusReason, + #[doc = "The port which is mapped to this port's `number` in the Azure Firewall, if applicable"] + #[serde(rename = "mappedPort", default, skip_serializing_if = "Option::is_none")] + pub mapped_port: Option, +} +impl JitNetworkAccessRequestPort { + pub fn new( + number: PortNumber, + end_time_utc: time::OffsetDateTime, + status: jit_network_access_request_port::Status, + status_reason: jit_network_access_request_port::StatusReason, + ) -> Self { + Self { + number, + allowed_source_address_prefix: None, + allowed_source_address_prefixes: Vec::new(), + end_time_utc, + status, + status_reason, + mapped_port: None, + } + } +} +pub mod jit_network_access_request_port { + use super::*; + #[doc = "The status of the port"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Revoked, + Initiated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Revoked => serializer.serialize_unit_variant("Status", 0u32, "Revoked"), + Self::Initiated => serializer.serialize_unit_variant("Status", 1u32, "Initiated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A description of why the `status` has its value"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "StatusReason")] + pub enum StatusReason { + Expired, + UserRequested, + NewerRequestInitiated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for StatusReason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for StatusReason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for StatusReason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Expired => serializer.serialize_unit_variant("StatusReason", 0u32, "Expired"), + Self::UserRequested => serializer.serialize_unit_variant("StatusReason", 1u32, "UserRequested"), + Self::NewerRequestInitiated => serializer.serialize_unit_variant("StatusReason", 2u32, "NewerRequestInitiated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequestVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "The ports that were opened for the virtual machine"] + pub ports: Vec, +} +impl JitNetworkAccessRequestVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { id, ports } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Kind { + #[doc = "Kind of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl Kind { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A List custom alert rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListCustomAlertRule { + #[serde(flatten)] + pub custom_alert_rule: CustomAlertRule, + #[doc = "The value type of the items in the list."] + #[serde(rename = "valueType", default, skip_serializing_if = "Option::is_none")] + pub value_type: Option, +} +impl ListCustomAlertRule { + pub fn new(custom_alert_rule: CustomAlertRule) -> Self { + Self { + custom_alert_rule, + value_type: None, + } + } +} +pub mod list_custom_alert_rule { + use super::*; + #[doc = "The value type of the items in the list."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValueType")] + pub enum ValueType { + IpCidr, + String, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValueType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValueType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValueType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IpCidr => serializer.serialize_unit_variant("ValueType", 0u32, "IpCidr"), + Self::String => serializer.serialize_unit_variant("ValueType", 1u32, "String"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Login by a local user that isn't allowed. Allow list consists of login names to allow."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LocalUserNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl LocalUserNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "Describes an Azure resource with location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Location { + #[doc = "Location where the resource is stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl Location { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource of the configuration or data needed to onboard the machine to MDE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingData { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the MDE configuration or data parameter needed to onboard the machine to MDE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MdeOnboardingData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of all MDE onboarding data resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingDataList { + #[doc = "List of the resources of the configuration or data needed to onboard the machine to MDE"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl MdeOnboardingDataList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the MDE configuration or data parameter needed to onboard the machine to MDE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingDataProperties { + #[doc = "The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension"] + #[serde(rename = "onboardingPackageWindows", default, skip_serializing_if = "Option::is_none")] + pub onboarding_package_windows: Option, + #[doc = "The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension"] + #[serde(rename = "onboardingPackageLinux", default, skip_serializing_if = "Option::is_none")] + pub onboarding_package_linux: Option, +} +impl MdeOnboardingDataProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of cloud to device messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Possible operation in the REST API of Microsoft.Security"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Name of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Where the operation is originated"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Security operation display"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security operation display"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationDisplay { + #[doc = "The resource provider for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The display name of the resource the operation applies to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The display name of the security operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The description of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl OperationDisplay { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of possible operations for Microsoft.Security resource provider"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationList { + #[doc = "List of Security operations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a path that is recommended to be allowed and its properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PathRecommendation { + #[doc = "The full path to the application to allow"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "The recommendation action of the VM/server or rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option, + #[doc = "The type of the rule to be allowed"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Represents the publisher information of a process/rule"] + #[serde(rename = "publisherInfo", default, skip_serializing_if = "Option::is_none")] + pub publisher_info: Option, + #[doc = "Whether the path is commonly run on the machine"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub common: Option, + #[serde( + rename = "userSids", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub user_sids: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub usernames: Vec, + #[doc = "The type of the file (for Linux files - Executable is used)"] + #[serde(rename = "fileType", default, skip_serializing_if = "Option::is_none")] + pub file_type: Option, + #[doc = "The configuration status of the VM/server group or machine or rule on the machine"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, +} +impl PathRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub type PathRecommendations = Vec; +#[doc = "A permission detected in the cloud account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PermissionProperty")] +pub enum PermissionProperty { + #[serde(rename = "AWS::AWSSecurityHubReadOnlyAccess")] + AwsAwsSecurityHubReadOnlyAccess, + #[serde(rename = "AWS::SecurityAudit")] + AwsSecurityAudit, + #[serde(rename = "AWS::AmazonSSMAutomationRole")] + AwsAmazonSsmAutomationRole, + #[serde(rename = "GCP::Security Center Admin Viewer")] + GcpSecurityCenterAdminViewer, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PermissionProperty { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PermissionProperty { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PermissionProperty { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsAwsSecurityHubReadOnlyAccess => { + serializer.serialize_unit_variant("PermissionProperty", 0u32, "AWS::AWSSecurityHubReadOnlyAccess") + } + Self::AwsSecurityAudit => serializer.serialize_unit_variant("PermissionProperty", 1u32, "AWS::SecurityAudit"), + Self::AwsAmazonSsmAutomationRole => { + serializer.serialize_unit_variant("PermissionProperty", 2u32, "AWS::AmazonSSMAutomationRole") + } + Self::GcpSecurityCenterAdminViewer => { + serializer.serialize_unit_variant("PermissionProperty", 3u32, "GCP::Security Center Admin Viewer") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +pub type PortNumber = i64; +#[doc = "Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Pricing { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Pricing properties for the relevant scope"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Pricing { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of pricing configurations response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingList { + #[doc = "List of pricing configurations"] + pub value: Vec, +} +impl PricingList { + pub fn new(value: Vec) -> Self { + Self { value } + } +} +#[doc = "Pricing properties for the relevant scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingProperties { + #[doc = "The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] + #[serde(rename = "pricingTier")] + pub pricing_tier: pricing_properties::PricingTier, + #[doc = "The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S)."] + #[serde(rename = "freeTrialRemainingTime", default, skip_serializing_if = "Option::is_none")] + pub free_trial_remaining_time: Option, +} +impl PricingProperties { + pub fn new(pricing_tier: pricing_properties::PricingTier) -> Self { + Self { + pricing_tier, + free_trial_remaining_time: None, + } + } +} +pub mod pricing_properties { + use super::*; + #[doc = "The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PricingTier")] + pub enum PricingTier { + Free, + Standard, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PricingTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PricingTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PricingTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Free => serializer.serialize_unit_variant("PricingTier", 0u32, "Free"), + Self::Standard => serializer.serialize_unit_variant("PricingTier", 1u32, "Standard"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Execution of a process that isn't allowed. Allow list consists of process names to allow."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProcessNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ProcessNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProtectionMode { + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exe: Option, + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub msi: Option, + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub script: Option, + #[doc = "The application control policy enforcement/protection mode of the VM/server group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub executable: Option, +} +impl ProtectionMode { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyServerProperties { + #[doc = "Proxy server IP"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip: Option, + #[doc = "Proxy server port"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, +} +impl ProxyServerProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the publisher information of a process/rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PublisherInfo { + #[doc = "The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country"] + #[serde(rename = "publisherName", default, skip_serializing_if = "Option::is_none")] + pub publisher_name: Option, + #[doc = "The product name taken from the file's version resource"] + #[serde(rename = "productName", default, skip_serializing_if = "Option::is_none")] + pub product_name: Option, + #[doc = "The \"OriginalName\" field taken from the file's version resource"] + #[serde(rename = "binaryName", default, skip_serializing_if = "Option::is_none")] + pub binary_name: Option, + #[doc = "The binary file version taken from the file's version resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl PublisherInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule query details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryCheck { + #[doc = "The rule query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, + #[doc = "Expected result."] + #[serde( + rename = "expectedResult", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub expected_result: Vec>, + #[doc = "Column names of expected result."] + #[serde( + rename = "columnNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub column_names: Vec, +} +impl QueryCheck { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of device queue purges is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueuePurgesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl QueuePurgesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The recommendation action of the VM/server or rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationAction { + Recommended, + Add, + Remove, +} +pub type RecommendationConfigurationList = Vec; +#[doc = "Recommendation configuration"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecommendationConfigurationProperties { + #[doc = "The recommendation type."] + #[serde(rename = "recommendationType")] + pub recommendation_type: recommendation_configuration_properties::RecommendationType, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Recommendation status. The recommendation is not generated when the status is disabled"] + pub status: recommendation_configuration_properties::Status, +} +impl RecommendationConfigurationProperties { + pub fn new( + recommendation_type: recommendation_configuration_properties::RecommendationType, + status: recommendation_configuration_properties::Status, + ) -> Self { + Self { + recommendation_type, + name: None, + status, + } + } +} +pub mod recommendation_configuration_properties { + use super::*; + #[doc = "The recommendation type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "RecommendationType")] + pub enum RecommendationType { + #[serde(rename = "IoT_ACRAuthentication")] + IoTAcrAuthentication, + #[serde(rename = "IoT_AgentSendsUnutilizedMessages")] + IoTAgentSendsUnutilizedMessages, + #[serde(rename = "IoT_Baseline")] + IoTBaseline, + #[serde(rename = "IoT_EdgeHubMemOptimize")] + IoTEdgeHubMemOptimize, + #[serde(rename = "IoT_EdgeLoggingOptions")] + IoTEdgeLoggingOptions, + #[serde(rename = "IoT_InconsistentModuleSettings")] + IoTInconsistentModuleSettings, + #[serde(rename = "IoT_InstallAgent")] + IoTInstallAgent, + #[serde(rename = "IoT_IPFilter_DenyAll")] + IoTIpFilterDenyAll, + #[serde(rename = "IoT_IPFilter_PermissiveRule")] + IoTIpFilterPermissiveRule, + #[serde(rename = "IoT_OpenPorts")] + IoTOpenPorts, + #[serde(rename = "IoT_PermissiveFirewallPolicy")] + IoTPermissiveFirewallPolicy, + #[serde(rename = "IoT_PermissiveInputFirewallRules")] + IoTPermissiveInputFirewallRules, + #[serde(rename = "IoT_PermissiveOutputFirewallRules")] + IoTPermissiveOutputFirewallRules, + #[serde(rename = "IoT_PrivilegedDockerOptions")] + IoTPrivilegedDockerOptions, + #[serde(rename = "IoT_SharedCredentials")] + IoTSharedCredentials, + #[serde(rename = "IoT_VulnerableTLSCipherSuite")] + IoTVulnerableTlsCipherSuite, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for RecommendationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for RecommendationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for RecommendationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IoTAcrAuthentication => serializer.serialize_unit_variant("RecommendationType", 0u32, "IoT_ACRAuthentication"), + Self::IoTAgentSendsUnutilizedMessages => { + serializer.serialize_unit_variant("RecommendationType", 1u32, "IoT_AgentSendsUnutilizedMessages") + } + Self::IoTBaseline => serializer.serialize_unit_variant("RecommendationType", 2u32, "IoT_Baseline"), + Self::IoTEdgeHubMemOptimize => serializer.serialize_unit_variant("RecommendationType", 3u32, "IoT_EdgeHubMemOptimize"), + Self::IoTEdgeLoggingOptions => serializer.serialize_unit_variant("RecommendationType", 4u32, "IoT_EdgeLoggingOptions"), + Self::IoTInconsistentModuleSettings => { + serializer.serialize_unit_variant("RecommendationType", 5u32, "IoT_InconsistentModuleSettings") + } + Self::IoTInstallAgent => serializer.serialize_unit_variant("RecommendationType", 6u32, "IoT_InstallAgent"), + Self::IoTIpFilterDenyAll => serializer.serialize_unit_variant("RecommendationType", 7u32, "IoT_IPFilter_DenyAll"), + Self::IoTIpFilterPermissiveRule => { + serializer.serialize_unit_variant("RecommendationType", 8u32, "IoT_IPFilter_PermissiveRule") + } + Self::IoTOpenPorts => serializer.serialize_unit_variant("RecommendationType", 9u32, "IoT_OpenPorts"), + Self::IoTPermissiveFirewallPolicy => { + serializer.serialize_unit_variant("RecommendationType", 10u32, "IoT_PermissiveFirewallPolicy") + } + Self::IoTPermissiveInputFirewallRules => { + serializer.serialize_unit_variant("RecommendationType", 11u32, "IoT_PermissiveInputFirewallRules") + } + Self::IoTPermissiveOutputFirewallRules => { + serializer.serialize_unit_variant("RecommendationType", 12u32, "IoT_PermissiveOutputFirewallRules") + } + Self::IoTPrivilegedDockerOptions => { + serializer.serialize_unit_variant("RecommendationType", 13u32, "IoT_PrivilegedDockerOptions") + } + Self::IoTSharedCredentials => serializer.serialize_unit_variant("RecommendationType", 14u32, "IoT_SharedCredentials"), + Self::IoTVulnerableTlsCipherSuite => { + serializer.serialize_unit_variant("RecommendationType", 15u32, "IoT_VulnerableTLSCipherSuite") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Recommendation status. The recommendation is not generated when the status is disabled"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("Status", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("Status", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Status { + fn default() -> Self { + Self::Enabled + } + } +} +#[doc = "The recommendation status of the VM/server group or VM/server"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationStatus { + Recommended, + NotRecommended, + NotAvailable, + NoStatus, +} +#[doc = "The type of the rule to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationType { + File, + FileHash, + PublisherSignature, + ProductSignature, + BinarySignature, + VersionAndAboveSignature, +} +#[doc = "Regulatory compliance assessment details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance assessment data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance assessment response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceAssessmentList { + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceAssessmentList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance assessment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceAssessmentProperties { + #[doc = "The description of the regulatory compliance assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The expected type of assessment contained in the AssessmentDetailsLink"] + #[serde(rename = "assessmentType", default, skip_serializing_if = "Option::is_none")] + pub assessment_type: Option, + #[doc = "Link to more detailed assessment results data. The response type will be according to the assessmentType field"] + #[serde(rename = "assessmentDetailsLink", default, skip_serializing_if = "Option::is_none")] + pub assessment_details_link: Option, + #[doc = "Aggregative state based on the assessment's scanned resources states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The given assessment's related resources count with passed state."] + #[serde(rename = "passedResources", default, skip_serializing_if = "Option::is_none")] + pub passed_resources: Option, + #[doc = "The given assessment's related resources count with failed state."] + #[serde(rename = "failedResources", default, skip_serializing_if = "Option::is_none")] + pub failed_resources: Option, + #[doc = "The given assessment's related resources count with skipped state."] + #[serde(rename = "skippedResources", default, skip_serializing_if = "Option::is_none")] + pub skipped_resources: Option, + #[doc = "The given assessment's related resources count with unsupported state."] + #[serde(rename = "unsupportedResources", default, skip_serializing_if = "Option::is_none")] + pub unsupported_resources: Option, +} +impl RegulatoryComplianceAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_assessment_properties { + use super::*; + #[doc = "Aggregative state based on the assessment's scanned resources states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Regulatory compliance control details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceControl { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance control data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceControl { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance controls response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceControlList { + #[doc = "List of regulatory compliance controls"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceControlList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceControlList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance control data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceControlProperties { + #[doc = "The description of the regulatory compliance control"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Aggregative state based on the control's supported assessments states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a passed state"] + #[serde(rename = "passedAssessments", default, skip_serializing_if = "Option::is_none")] + pub passed_assessments: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a failed state"] + #[serde(rename = "failedAssessments", default, skip_serializing_if = "Option::is_none")] + pub failed_assessments: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a skipped state"] + #[serde(rename = "skippedAssessments", default, skip_serializing_if = "Option::is_none")] + pub skipped_assessments: Option, +} +impl RegulatoryComplianceControlProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_control_properties { + use super::*; + #[doc = "Aggregative state based on the control's supported assessments states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Regulatory compliance standard details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceStandard { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance standard data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceStandard { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance standards response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceStandardList { + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceStandardList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceStandardList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance standard data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceStandardProperties { + #[doc = "Aggregative state based on the standard's supported controls states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a passed state"] + #[serde(rename = "passedControls", default, skip_serializing_if = "Option::is_none")] + pub passed_controls: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a failed state"] + #[serde(rename = "failedControls", default, skip_serializing_if = "Option::is_none")] + pub failed_controls: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a skipped state"] + #[serde(rename = "skippedControls", default, skip_serializing_if = "Option::is_none")] + pub skipped_controls: Option, + #[doc = "The number of regulatory compliance controls of the given standard which are unsupported by automated assessments"] + #[serde(rename = "unsupportedControls", default, skip_serializing_if = "Option::is_none")] + pub unsupported_controls: Option, +} +impl RegulatoryComplianceStandardProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_standard_properties { + use super::*; + #[doc = "Aggregative state based on the standard's supported controls states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Remediation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Remediation { + #[doc = "Remediation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Remediation script."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub scripts: Vec, + #[doc = "Is remediation automated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub automated: Option, + #[doc = "Optional link to remediate in Azure Portal."] + #[serde(rename = "portalLink", default, skip_serializing_if = "Option::is_none")] + pub portal_link: Option, +} +impl Remediation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of the resource that was assessed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceDetails { + #[doc = "The platform where the assessed resource resides"] + pub source: resource_details::Source, +} +impl ResourceDetails { + pub fn new(source: resource_details::Source) -> Self { + Self { source } + } +} +pub mod resource_details { + use super::*; + #[doc = "The platform where the assessed resource resides"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Source")] + pub enum Source { + Azure, + OnPremise, + OnPremiseSql, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Source { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Source { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Source { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("Source", 0u32, "Azure"), + Self::OnPremise => serializer.serialize_unit_variant("Source", 1u32, "OnPremise"), + Self::OnPremiseSql => serializer.serialize_unit_variant("Source", 2u32, "OnPremiseSql"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Rule { + #[doc = "The name of the rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The rule's direction"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[serde(rename = "destinationPort", default, skip_serializing_if = "Option::is_none")] + pub destination_port: Option, + #[doc = "The rule's transport protocols"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub protocols: Vec, + #[doc = "The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol"] + #[serde( + rename = "ipAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ip_addresses: Vec, +} +impl Rule { + pub fn new() -> Self { + Self::default() + } +} +pub mod rule { + use super::*; + #[doc = "The rule's direction"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Direction")] + pub enum Direction { + Inbound, + Outbound, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Direction { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Direction { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Direction { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Inbound => serializer.serialize_unit_variant("Direction", 0u32, "Inbound"), + Self::Outbound => serializer.serialize_unit_variant("Direction", 1u32, "Outbound"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Rule results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResults { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Rule results properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RuleResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule results input."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResultsInput { + #[doc = "Take results from latest scan."] + #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] + pub latest_scan: Option, + #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results: Vec>, +} +impl RuleResultsInput { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule results properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResultsProperties { + #[doc = "Expected results in the baseline."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results: Vec>, +} +impl RuleResultsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule severity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleSeverity")] +pub enum RuleSeverity { + High, + Medium, + Low, + Informational, + Obsolete, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("RuleSeverity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("RuleSeverity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("RuleSeverity", 2u32, "Low"), + Self::Informational => serializer.serialize_unit_variant("RuleSeverity", 3u32, "Informational"), + Self::Obsolete => serializer.serialize_unit_variant("RuleSeverity", 4u32, "Obsolete"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The rule result status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleStatus")] +pub enum RuleStatus { + NonFinding, + Finding, + InternalError, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NonFinding => serializer.serialize_unit_variant("RuleStatus", 0u32, "NonFinding"), + Self::Finding => serializer.serialize_unit_variant("RuleStatus", 1u32, "Finding"), + Self::InternalError => serializer.serialize_unit_variant("RuleStatus", 2u32, "InternalError"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The rule type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleType")] +pub enum RuleType { + Binary, + BaselineExpected, + PositiveList, + NegativeList, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Binary => serializer.serialize_unit_variant("RuleType", 0u32, "Binary"), + Self::BaselineExpected => serializer.serialize_unit_variant("RuleType", 1u32, "BaselineExpected"), + Self::PositiveList => serializer.serialize_unit_variant("RuleType", 2u32, "PositiveList"), + Self::NegativeList => serializer.serialize_unit_variant("RuleType", 3u32, "NegativeList"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A list of rules results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RulesResults { + #[doc = "List of rule results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl RulesResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rules results input."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RulesResultsInput { + #[doc = "Take results from latest scan."] + #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] + pub latest_scan: Option, + #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option, +} +impl RulesResultsInput { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Scan { + #[serde(flatten)] + pub resource: Resource, + #[doc = "A vulnerability assessment scan record properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Scan { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan record properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanProperties { + #[doc = "The scan trigger type."] + #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] + pub trigger_type: Option, + #[doc = "The scan status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The server name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server: Option, + #[doc = "The database name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub database: Option, + #[doc = "The SQL version."] + #[serde(rename = "sqlVersion", default, skip_serializing_if = "Option::is_none")] + pub sql_version: Option, + #[doc = "The scan start time (UTC)."] + #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] + pub start_time: Option, + #[doc = "Scan results are valid until end time (UTC)."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "The number of failed rules with high severity."] + #[serde(rename = "highSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub high_severity_failed_rules_count: Option, + #[doc = "The number of failed rules with medium severity."] + #[serde(rename = "mediumSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub medium_severity_failed_rules_count: Option, + #[doc = "The number of failed rules with low severity."] + #[serde(rename = "lowSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub low_severity_failed_rules_count: Option, + #[doc = "The number of total passed rules."] + #[serde(rename = "totalPassedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_passed_rules_count: Option, + #[doc = "The number of total failed rules."] + #[serde(rename = "totalFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_failed_rules_count: Option, + #[doc = "The number of total rules assessed."] + #[serde(rename = "totalRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_rules_count: Option, + #[doc = "Baseline created for this database, and has one or more rules."] + #[serde(rename = "isBaselineApplied", default, skip_serializing_if = "Option::is_none")] + pub is_baseline_applied: Option, +} +impl ScanProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan result for a single rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResult { + #[serde(flatten)] + pub resource: Resource, + #[doc = "A vulnerability assessment scan result properties for a single rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ScanResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan result properties for a single rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResultProperties { + #[doc = "The rule Id."] + #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + #[doc = "The rule result status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Indicated whether the results specified here are trimmed."] + #[serde(rename = "isTrimmed", default, skip_serializing_if = "Option::is_none")] + pub is_trimmed: Option, + #[doc = "The results of the query that was run."] + #[serde( + rename = "queryResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub query_results: Vec>, + #[doc = "Remediation details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remediation: Option, + #[doc = "The rule result adjusted with baseline."] + #[serde(rename = "baselineAdjustedResult", default, skip_serializing_if = "Option::is_none")] + pub baseline_adjusted_result: Option, + #[doc = "vulnerability assessment rule metadata details."] + #[serde(rename = "ruleMetadata", default, skip_serializing_if = "Option::is_none")] + pub rule_metadata: Option, +} +impl ScanResultProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of vulnerability assessment scan results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResults { + #[doc = "List of vulnerability assessment scan results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ScanResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The scan status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScanState")] +pub enum ScanState { + Failed, + FailedToRun, + InProgress, + Passed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScanState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScanState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScanState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Failed => serializer.serialize_unit_variant("ScanState", 0u32, "Failed"), + Self::FailedToRun => serializer.serialize_unit_variant("ScanState", 1u32, "FailedToRun"), + Self::InProgress => serializer.serialize_unit_variant("ScanState", 2u32, "InProgress"), + Self::Passed => serializer.serialize_unit_variant("ScanState", 3u32, "Passed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The scan trigger type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScanTriggerType")] +pub enum ScanTriggerType { + OnDemand, + Recurring, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScanTriggerType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScanTriggerType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScanTriggerType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OnDemand => serializer.serialize_unit_variant("ScanTriggerType", 0u32, "OnDemand"), + Self::Recurring => serializer.serialize_unit_variant("ScanTriggerType", 1u32, "Recurring"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A list of vulnerability assessment scan records."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Scans { + #[doc = "List of vulnerability assessment scan records."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl Scans { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A more specific scope used to identify the alerts to suppress."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScopeElement { + #[doc = "The alert entity type to suppress by."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option, +} +impl ScopeElement { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScoreDetails { + #[doc = "Maximum score available"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, + #[doc = "Current score"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + #[doc = "Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl ScoreDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the security control."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionItem { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Security Control Definition Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreControlDefinitionItem { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Control Definition Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionItemProperties { + #[doc = "User friendly display name of the control"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "User friendly description of the control"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Maximum control score (0..10)"] + #[serde(rename = "maxScore", default, skip_serializing_if = "Option::is_none")] + pub max_score: Option, + #[doc = "The type of the security control (For example, BuiltIn)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "array of azure resource IDs"] + #[serde(rename = "assessmentDefinitions", default, skip_serializing_if = "Option::is_none")] + pub assessment_definitions: Option, +} +impl SecureScoreControlDefinitionItemProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The type of the security control (For example, BuiltIn)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionSource { + #[doc = "The type of security control (for example, BuiltIn)"] + #[serde(rename = "sourceType", default, skip_serializing_if = "Option::is_none")] + pub source_type: Option, +} +impl SecureScoreControlDefinitionSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod secure_score_control_definition_source { + use super::*; + #[doc = "The type of security control (for example, BuiltIn)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SourceType")] + pub enum SourceType { + BuiltIn, + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::BuiltIn => serializer.serialize_unit_variant("SourceType", 0u32, "BuiltIn"), + Self::Custom => serializer.serialize_unit_variant("SourceType", 1u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Details of the security control, its score, and the health status of the relevant resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDetails { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Calculation result data in control level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreControlDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security controls"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlList { + #[doc = "Collection of security controls in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoreControlList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoreControlList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlScore { + #[doc = "Maximum control score (0..10)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, + #[doc = "Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + #[doc = "Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl SecureScoreControlScore { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data in control level"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlScoreDetails { + #[doc = "User friendly display name of the control"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Calculation result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + #[doc = "Number of healthy resources in the control"] + #[serde(rename = "healthyResourceCount", default, skip_serializing_if = "Option::is_none")] + pub healthy_resource_count: Option, + #[doc = "Number of unhealthy resources in the control"] + #[serde(rename = "unhealthyResourceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_resource_count: Option, + #[doc = "Number of not applicable resources in the control"] + #[serde(rename = "notApplicableResourceCount", default, skip_serializing_if = "Option::is_none")] + pub not_applicable_resource_count: Option, + #[doc = "The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, + #[doc = "Information about the security control."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option, +} +impl SecureScoreControlScoreDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Secure score item data model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreItem { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a calculated secure score."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreItem { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a calculated secure score."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreItemProperties { + #[doc = "The initiative’s name"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Calculation result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + #[doc = "The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, +} +impl SecureScoreItemProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of secure scores"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoresList { + #[doc = "Collection of secure scores in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoresList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoresList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The security connector resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityConnector { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "A set of properties that defines the security connector configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityConnector { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A set of properties that defines the security connector configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityConnectorProperties { + #[doc = "The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector)."] + #[serde(rename = "hierarchyIdentifier", default, skip_serializing_if = "Option::is_none")] + pub hierarchy_identifier: Option, + #[doc = "The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings."] + #[serde(rename = "hierarchyIdentifierTrialEndDate", default, with = "azure_core::date::rfc3339::option")] + pub hierarchy_identifier_trial_end_date: Option, + #[doc = "The multi cloud resource's cloud name."] + #[serde(rename = "environmentName", default, skip_serializing_if = "Option::is_none")] + pub environment_name: Option, + #[doc = "A collection of offerings for the security connector."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub offerings: Vec, + #[doc = "The security connector environment data."] + #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] + pub environment_data: Option, +} +impl SecurityConnectorProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_connector_properties { + use super::*; + #[doc = "The multi cloud resource's cloud name."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EnvironmentName")] + pub enum EnvironmentName { + Azure, + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + Github, + AzureDevOps, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EnvironmentName { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EnvironmentName { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EnvironmentName { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("EnvironmentName", 0u32, "Azure"), + Self::Aws => serializer.serialize_unit_variant("EnvironmentName", 1u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("EnvironmentName", 2u32, "GCP"), + Self::Github => serializer.serialize_unit_variant("EnvironmentName", 3u32, "Github"), + Self::AzureDevOps => serializer.serialize_unit_variant("EnvironmentName", 4u32, "AzureDevOps"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of security connectors response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityConnectorsList { + #[doc = "The list of security connectors under the given scope."] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityConnectorsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityConnectorsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Contact details and configurations for notifications coming from Microsoft Defender for Cloud."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContact { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes security contact properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityContact { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security contacts response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContactList { + #[doc = "List of security contacts"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityContactList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityContactList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes security contact properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContactProperties { + #[doc = "List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations defined in this security contact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option, + #[doc = "The security contact's phone number"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[doc = "Defines whether to send email notifications about new security alerts"] + #[serde(rename = "alertNotifications", default, skip_serializing_if = "Option::is_none")] + pub alert_notifications: Option, + #[doc = "Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[serde(rename = "notificationsByRole", default, skip_serializing_if = "Option::is_none")] + pub notifications_by_role: Option, +} +impl SecurityContactProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_contact_properties { + use super::*; + #[doc = "Defines whether to send email notifications about new security alerts"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct AlertNotifications { + #[doc = "Defines if email notifications will be sent about new security alerts"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Defines the minimal alert severity which will be sent as email notifications"] + #[serde(rename = "minimalSeverity", default, skip_serializing_if = "Option::is_none")] + pub minimal_severity: Option, + } + impl AlertNotifications { + pub fn new() -> Self { + Self::default() + } + } + pub mod alert_notifications { + use super::*; + #[doc = "Defines if email notifications will be sent about new security alerts"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("State", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("State", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Defines the minimal alert severity which will be sent as email notifications"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimalSeverity")] + pub enum MinimalSeverity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimalSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimalSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimalSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("MinimalSeverity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("MinimalSeverity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("MinimalSeverity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NotificationsByRole { + #[doc = "Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC roles: "] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub roles: Vec, + } + impl NotificationsByRole { + pub fn new() -> Self { + Self::default() + } + } + pub mod notifications_by_role { + use super::*; + #[doc = "Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("State", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("State", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "A possible role to configure sending security notification alerts to"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "SecurityContactRole")] +pub enum SecurityContactRole { + AccountAdmin, + ServiceAdmin, + Owner, + Contributor, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for SecurityContactRole { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for SecurityContactRole { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for SecurityContactRole { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AccountAdmin => serializer.serialize_unit_variant("SecurityContactRole", 0u32, "AccountAdmin"), + Self::ServiceAdmin => serializer.serialize_unit_variant("SecurityContactRole", 1u32, "ServiceAdmin"), + Self::Owner => serializer.serialize_unit_variant("SecurityContactRole", 2u32, "Owner"), + Self::Contributor => serializer.serialize_unit_variant("SecurityContactRole", 3u32, "Contributor"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "Security sub-assessment on a resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an sub-assessment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecuritySubAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security sub-assessments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessmentList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecuritySubAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecuritySubAssessmentList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of an sub-assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessmentProperties { + #[doc = "Vulnerability ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "User friendly display name of the sub-assessment"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Status of the sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Information on how to remediate this sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remediation: Option, + #[doc = "Description of the impact of this sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub impact: Option, + #[doc = "Category of the sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The date and time the sub-assessment was generated"] + #[serde(rename = "timeGenerated", default, with = "azure_core::date::rfc3339::option")] + pub time_generated: Option, + #[doc = "Details of the resource that was assessed"] + #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] + pub resource_details: Option, + #[doc = "Details of the sub-assessment"] + #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] + pub additional_data: Option, +} +impl SecuritySubAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security task that we recommend to do in order to strengthen security"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTask { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityTask { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security task recommendations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityTaskList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityTaskList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties, depending on the task type that is derived from the name field"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskParameters { + #[doc = "Name of the task type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl SecurityTaskParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a task."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskProperties { + #[doc = "State of the task (Active, Resolved etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The time this task was discovered in UTC"] + #[serde(rename = "creationTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub creation_time_utc: Option, + #[doc = "Changing set of properties, depending on the task type that is derived from the name field"] + #[serde(rename = "securityTaskParameters", default, skip_serializing_if = "Option::is_none")] + pub security_task_parameters: Option, + #[doc = "The time this task's details were last changed in UTC"] + #[serde(rename = "lastStateChangeTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_state_change_time_utc: Option, + #[doc = "Additional data on the state of the task"] + #[serde(rename = "subState", default, skip_serializing_if = "Option::is_none")] + pub sub_state: Option, +} +impl SecurityTaskProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The sensitivity label."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SensitivityLabel { + #[doc = "The name of the sensitivity label."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rank of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + #[doc = "The order of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "Indicates whether the label is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl SensitivityLabel { + pub fn new() -> Self { + Self::default() + } +} +pub mod sensitivity_label { + use super::*; + #[doc = "The rank of the sensitivity label."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Rank { + None, + Low, + Medium, + High, + Critical, + } +} +#[doc = "Additional context fields for server vulnerability assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServerVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Dictionary from cvss version to cvss details object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cvss: Option, + #[doc = "Indicates whether a patch is available or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patchable: Option, + #[doc = "List of CVEs"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cve: Vec, + #[doc = "Threat name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub threat: Option, + #[doc = "Published time"] + #[serde(rename = "publishedTime", default, with = "azure_core::date::rfc3339::option")] + pub published_time: Option, + #[serde( + rename = "vendorReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vendor_references: Vec, +} +impl ServerVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + cvss: None, + patchable: None, + cve: Vec::new(), + threat: None, + published_time: None, + vendor_references: Vec::new(), + } + } +} +#[doc = "Details of the service principal."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServicePrincipalProperties { + #[doc = "Application ID of service principal."] + #[serde(rename = "applicationId", default, skip_serializing_if = "Option::is_none")] + pub application_id: Option, + #[doc = "A secret string that the application uses to prove its identity, also can be referred to as application password (write only)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option, +} +impl ServicePrincipalProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The kind of the security setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Setting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "the kind of the settings string (DataExportSetting)"] + pub kind: setting::Kind, +} +impl Setting { + pub fn new(kind: setting::Kind) -> Self { + Self { + resource: Resource::default(), + kind, + } + } +} +pub mod setting { + use super::*; + #[doc = "the kind of the settings string (DataExportSetting)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + DataExportSetting, + AlertSuppressionSetting, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::DataExportSetting => serializer.serialize_unit_variant("Kind", 0u32, "DataExportSetting"), + Self::AlertSuppressionSetting => serializer.serialize_unit_variant("Kind", 1u32, "AlertSuppressionSetting"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Subscription settings list."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SettingsList { + #[doc = "The settings list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SettingsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SettingsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a software data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Software { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Software Inventory resource properties"] + pub properties: SoftwareProperties, +} +impl Software { + pub fn new(properties: SoftwareProperties) -> Self { + Self { + resource: Resource::default(), + properties, + } + } +} +#[doc = "Software Inventory resource properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoftwareProperties { + #[doc = "Unique identifier for the virtual machine in the service."] + #[serde(rename = "deviceId", default, skip_serializing_if = "Option::is_none")] + pub device_id: Option, + #[doc = "Platform of the operating system running on the device."] + #[serde(rename = "osPlatform", default, skip_serializing_if = "Option::is_none")] + pub os_platform: Option, + #[doc = "Name of the software vendor."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vendor: Option, + #[doc = "Name of the software product."] + #[serde(rename = "softwareName", default, skip_serializing_if = "Option::is_none")] + pub software_name: Option, + #[doc = "Version number of the software product."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "End of support status."] + #[serde(rename = "endOfSupportStatus", default, skip_serializing_if = "Option::is_none")] + pub end_of_support_status: Option, + #[doc = "The end of support date in case the product is upcoming end of support."] + #[serde(rename = "endOfSupportDate", default, skip_serializing_if = "Option::is_none")] + pub end_of_support_date: Option, + #[doc = "Number of weaknesses."] + #[serde(rename = "numberOfKnownVulnerabilities", default, skip_serializing_if = "Option::is_none")] + pub number_of_known_vulnerabilities: Option, + #[doc = "First time that the software was seen in the device."] + #[serde(rename = "firstSeenAt", default, skip_serializing_if = "Option::is_none")] + pub first_seen_at: Option, +} +impl SoftwareProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod software_properties { + use super::*; + #[doc = "End of support status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndOfSupportStatus")] + pub enum EndOfSupportStatus { + None, + #[serde(rename = "noLongerSupported")] + NoLongerSupported, + #[serde(rename = "versionNoLongerSupported")] + VersionNoLongerSupported, + #[serde(rename = "upcomingNoLongerSupported")] + UpcomingNoLongerSupported, + #[serde(rename = "upcomingVersionNoLongerSupported")] + UpcomingVersionNoLongerSupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndOfSupportStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndOfSupportStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndOfSupportStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("EndOfSupportStatus", 0u32, "None"), + Self::NoLongerSupported => serializer.serialize_unit_variant("EndOfSupportStatus", 1u32, "noLongerSupported"), + Self::VersionNoLongerSupported => serializer.serialize_unit_variant("EndOfSupportStatus", 2u32, "versionNoLongerSupported"), + Self::UpcomingNoLongerSupported => { + serializer.serialize_unit_variant("EndOfSupportStatus", 3u32, "upcomingNoLongerSupported") + } + Self::UpcomingVersionNoLongerSupported => { + serializer.serialize_unit_variant("EndOfSupportStatus", 4u32, "upcomingVersionNoLongerSupported") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents the software inventory of the virtual machine."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoftwaresList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SoftwaresList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SoftwaresList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The source type of the VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum SourceSystem { + #[serde(rename = "Azure_AppLocker")] + AzureAppLocker, + #[serde(rename = "Azure_AuditD")] + AzureAuditD, + #[serde(rename = "NonAzure_AppLocker")] + NonAzureAppLocker, + #[serde(rename = "NonAzure_AuditD")] + NonAzureAuditD, + None, +} +#[doc = "Details of the resource that was assessed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlServerVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "The resource type the sub assessment refers to in its resource details"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The T-SQL query that runs on your SQL database to perform the particular check"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, +} +impl SqlServerVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + query: None, + } + } +} +#[doc = "Status of the sub-assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubAssessmentStatus { + #[doc = "Programmatic code for the status of the assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Programmatic code for the cause of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cause: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The sub-assessment severity level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, +} +impl SubAssessmentStatus { + pub fn new() -> Self { + Self::default() + } +} +pub mod sub_assessment_status { + use super::*; + #[doc = "Programmatic code for the status of the assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Code")] + pub enum Code { + Healthy, + Unhealthy, + NotApplicable, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Code { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Code { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Code { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Healthy => serializer.serialize_unit_variant("Code", 0u32, "Healthy"), + Self::Unhealthy => serializer.serialize_unit_variant("Code", 1u32, "Unhealthy"), + Self::NotApplicable => serializer.serialize_unit_variant("Code", 2u32, "NotApplicable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The sub-assessment severity level"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Low => serializer.serialize_unit_variant("Severity", 0u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::High => serializer.serialize_unit_variant("Severity", 2u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SuppressionAlertsScope { + #[doc = "All the conditions inside need to be true in order to suppress the alert"] + #[serde(rename = "allOf")] + pub all_of: Vec, +} +impl SuppressionAlertsScope { + pub fn new(all_of: Vec) -> Self { + Self { all_of } + } +} +#[doc = "A list of key value pairs that describe the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Tags { + #[doc = "A list of key value pairs that describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl Tags { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A container holding only the Tags for a resource, allowing the user to update the tags."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagsResource { + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl TagsResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is within the given range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ThresholdCustomAlertRule { + #[serde(flatten)] + pub custom_alert_rule: CustomAlertRule, + #[doc = "The minimum threshold."] + #[serde(rename = "minThreshold")] + pub min_threshold: i64, + #[doc = "The maximum threshold."] + #[serde(rename = "maxThreshold")] + pub max_threshold: i64, +} +impl ThresholdCustomAlertRule { + pub fn new(custom_alert_rule: CustomAlertRule, min_threshold: i64, max_threshold: i64) -> Self { + Self { + custom_alert_rule, + min_threshold, + max_threshold, + } + } +} +#[doc = "A custom alert rule that checks if the number of activities (depends on the custom alert type) in a time window is within the given range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TimeWindowCustomAlertRule { + #[serde(flatten)] + pub threshold_custom_alert_rule: ThresholdCustomAlertRule, + #[doc = "The time window size in iso8601 format."] + #[serde(rename = "timeWindowSize")] + pub time_window_size: String, +} +impl TimeWindowCustomAlertRule { + pub fn new(threshold_custom_alert_rule: ThresholdCustomAlertRule, time_window_size: String) -> Self { + Self { + threshold_custom_alert_rule, + time_window_size, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TopologyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TopologyList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TopologyResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyResourceProperties { + #[doc = "The UTC time on which the topology was calculated"] + #[serde(rename = "calculatedDateTime", default, with = "azure_core::date::rfc3339::option")] + pub calculated_date_time: Option, + #[doc = "Azure resources which are part of this topology resource"] + #[serde( + rename = "topologyResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub topology_resources: Vec, +} +impl TopologyResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResource { + #[doc = "Azure resource id"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The security severity of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "Indicates if the resource has security recommendations"] + #[serde(rename = "recommendationsExist", default, skip_serializing_if = "Option::is_none")] + pub recommendations_exist: Option, + #[doc = "Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.)"] + #[serde(rename = "networkZones", default, skip_serializing_if = "Option::is_none")] + pub network_zones: Option, + #[doc = "Score of the resource based on its security severity"] + #[serde(rename = "topologyScore", default, skip_serializing_if = "Option::is_none")] + pub topology_score: Option, + #[doc = "The location of this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Azure resources connected to this resource which are in higher level in the topology view"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub parents: Vec, + #[doc = "Azure resources connected to this resource which are in lower level in the topology view"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub children: Vec, +} +impl TopologySingleResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResourceChild { + #[doc = "Azure resource id which serves as child resource in topology view"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl TopologySingleResourceChild { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResourceParent { + #[doc = "Azure resource id which serves as parent resource in topology view"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl TopologySingleResourceParent { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure tracked resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub azure_tracked_resource_location: AzureTrackedResourceLocation, + #[serde(flatten)] + pub kind: Kind, + #[serde(flatten)] + pub e_tag: ETag, + #[serde(flatten)] + pub tags: Tags, +} +impl TrackedResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of twin updates is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TwinUpdatesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl TwinUpdatesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of unauthorized operations is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UnauthorizedOperationsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl UnauthorizedOperationsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateIotSecuritySolutionData { + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "Properties of the solution's user defined resources."] + #[serde(rename = "userDefinedResources", default, skip_serializing_if = "Option::is_none")] + pub user_defined_resources: Option, + #[doc = "List of recommendation configuration"] + #[serde(rename = "recommendationsConfiguration", default, skip_serializing_if = "Option::is_none")] + pub recommendations_configuration: Option, +} +impl UpdateIotSecuritySolutionData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the solution's user defined resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserDefinedResourcesProperties { + #[doc = "Azure Resource Graph query which represents the security solution's user defined resources. Required to start with \"where type != \"Microsoft.Devices/IotHubs\"\""] + pub query: String, + #[doc = "List of Azure subscription ids on which the user defined resources query should be executed."] + #[serde(rename = "querySubscriptions")] + pub query_subscriptions: Vec, +} +impl UserDefinedResourcesProperties { + pub fn new(query: String, query_subscriptions: Vec) -> Self { + Self { + query, + query_subscriptions, + } + } +} +#[doc = "Represents a user that is recommended to be allowed for a certain rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserRecommendation { + #[doc = "Represents a user that is recommended to be allowed for a certain rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The recommendation action of the VM/server or rule"] + #[serde(rename = "recommendationAction", default, skip_serializing_if = "Option::is_none")] + pub recommendation_action: Option, +} +impl UserRecommendation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "vulnerability assessment rule metadata details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VaRule { + #[doc = "The rule Id."] + #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + #[doc = "The rule severity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The rule category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The rule type."] + #[serde(rename = "ruleType", default, skip_serializing_if = "Option::is_none")] + pub rule_type: Option, + #[doc = "The rule title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "The rule description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rule rationale."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rationale: Option, + #[doc = "The rule query details."] + #[serde(rename = "queryCheck", default, skip_serializing_if = "Option::is_none")] + pub query_check: Option, + #[doc = "The benchmark references."] + #[serde( + rename = "benchmarkReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub benchmark_references: Vec, +} +impl VaRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Vendor reference"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VendorReference { + #[doc = "Link title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Link url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option, +} +impl VendorReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a machine that is part of a VM/server group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VmRecommendation { + #[doc = "The configuration status of the VM/server group or machine or rule on the machine"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, + #[doc = "The recommendation action of the VM/server or rule"] + #[serde(rename = "recommendationAction", default, skip_serializing_if = "Option::is_none")] + pub recommendation_action: Option, + #[doc = "The full azure resource id of the machine"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The VM/server supportability of Enforce feature"] + #[serde(rename = "enforcementSupport", default, skip_serializing_if = "Option::is_none")] + pub enforcement_support: Option, +} +impl VmRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub type VmRecommendations = Vec; +pub type VmResourceId = String; +#[doc = "Configures where to store the OMS agent data for workspaces under a scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Workspace setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of workspace settings response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceSettingList { + #[doc = "List of workspace settings"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WorkspaceSettingList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Workspace setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceSettingProperties { + #[doc = "The full Azure ID of the workspace to save the data in"] + #[serde(rename = "workspaceId")] + pub workspace_id: String, + #[doc = "All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope"] + pub scope: String, +} +impl WorkspaceSettingProperties { + pub fn new(workspace_id: String, scope: String) -> Self { + Self { workspace_id, scope } + } +} +#[doc = "The security offering details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudOffering { + #[doc = "The type of the security offering."] + #[serde(rename = "offeringType")] + pub offering_type: cloud_offering::OfferingType, + #[doc = "The offering description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl CloudOffering { + pub fn new(offering_type: cloud_offering::OfferingType) -> Self { + Self { + offering_type, + description: None, + } + } +} +pub mod cloud_offering { + use super::*; + #[doc = "The type of the security offering."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OfferingType")] + pub enum OfferingType { + CspmMonitorAws, + DefenderForContainersAws, + DefenderForServersAws, + DefenderForDatabasesAws, + InformationProtectionAws, + CspmMonitorGcp, + CspmMonitorGithub, + CspmMonitorAzureDevOps, + DefenderForServersGcp, + DefenderForContainersGcp, + DefenderForDatabasesGcp, + DefenderCspmAws, + DefenderCspmGcp, + DefenderForDevOpsGithub, + DefenderForDevOpsAzureDevOps, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OfferingType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OfferingType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OfferingType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CspmMonitorAws => serializer.serialize_unit_variant("OfferingType", 0u32, "CspmMonitorAws"), + Self::DefenderForContainersAws => serializer.serialize_unit_variant("OfferingType", 1u32, "DefenderForContainersAws"), + Self::DefenderForServersAws => serializer.serialize_unit_variant("OfferingType", 2u32, "DefenderForServersAws"), + Self::DefenderForDatabasesAws => serializer.serialize_unit_variant("OfferingType", 3u32, "DefenderForDatabasesAws"), + Self::InformationProtectionAws => serializer.serialize_unit_variant("OfferingType", 4u32, "InformationProtectionAws"), + Self::CspmMonitorGcp => serializer.serialize_unit_variant("OfferingType", 5u32, "CspmMonitorGcp"), + Self::CspmMonitorGithub => serializer.serialize_unit_variant("OfferingType", 6u32, "CspmMonitorGithub"), + Self::CspmMonitorAzureDevOps => serializer.serialize_unit_variant("OfferingType", 7u32, "CspmMonitorAzureDevOps"), + Self::DefenderForServersGcp => serializer.serialize_unit_variant("OfferingType", 8u32, "DefenderForServersGcp"), + Self::DefenderForContainersGcp => serializer.serialize_unit_variant("OfferingType", 9u32, "DefenderForContainersGcp"), + Self::DefenderForDatabasesGcp => serializer.serialize_unit_variant("OfferingType", 10u32, "DefenderForDatabasesGcp"), + Self::DefenderCspmAws => serializer.serialize_unit_variant("OfferingType", 11u32, "DefenderCspmAws"), + Self::DefenderCspmGcp => serializer.serialize_unit_variant("OfferingType", 12u32, "DefenderCspmGcp"), + Self::DefenderForDevOpsGithub => serializer.serialize_unit_variant("OfferingType", 13u32, "DefenderForDevOpsGithub"), + Self::DefenderForDevOpsAzureDevOps => { + serializer.serialize_unit_variant("OfferingType", 14u32, "DefenderForDevOpsAzureDevOps") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The CSPM monitoring for AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, +} +impl CspmMonitorAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + } + } +} +pub mod cspm_monitor_aws_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The CSPM monitoring for AzureDevOps offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorAzureDevOpsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl CspmMonitorAzureDevOpsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The CSPM monitoring for GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, +} +impl CspmMonitorGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + } + } +} +pub mod cspm_monitor_gcp_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The GCP workload identity provider id for the offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The CSPM monitoring for github offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorGithubOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl CspmMonitorGithubOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "Custom Assessment Automation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "describes the Custom Assessment Automation properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomAssessmentAutomation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the Custom Assessment Automation properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationProperties { + #[doc = "GZip encoded KQL query representing the assessment automation results required."] + #[serde(rename = "compressedQuery", default, skip_serializing_if = "Option::is_none")] + pub compressed_query: Option, + #[doc = "Relevant cloud for the custom assessment automation."] + #[serde(rename = "supportedCloud", default, skip_serializing_if = "Option::is_none")] + pub supported_cloud: Option, + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The display name of the assessments generated by this assessment automation."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The remediation description to relate to the assessments generated by this assessment automation."] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, + #[doc = "The assessment metadata key used when an assessment is generated for this assessment automation."] + #[serde(rename = "assessmentKey", default, skip_serializing_if = "Option::is_none")] + pub assessment_key: Option, +} +impl CustomAssessmentAutomationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod custom_assessment_automation_properties { + use super::*; + #[doc = "Relevant cloud for the custom assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SupportedCloud")] + pub enum SupportedCloud { + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SupportedCloud { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SupportedCloud { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SupportedCloud { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("SupportedCloud", 0u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("SupportedCloud", 1u32, "GCP"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("Severity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("Severity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Custom Assessment Automation request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationRequest { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes the Custom Assessment Automation properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomAssessmentAutomationRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the Custom Assessment Automation properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationRequestProperties { + #[doc = "Base 64 encoded KQL query representing the assessment automation results required."] + #[serde(rename = "compressedQuery", default, skip_serializing_if = "Option::is_none")] + pub compressed_query: Option, + #[doc = "Relevant cloud for the custom assessment automation."] + #[serde(rename = "supportedCloud", default, skip_serializing_if = "Option::is_none")] + pub supported_cloud: Option, + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The display name of the assessments generated by this assessment automation."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The remediation description to relate to the assessments generated by this assessment automation."] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, +} +impl CustomAssessmentAutomationRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod custom_assessment_automation_request_properties { + use super::*; + #[doc = "Relevant cloud for the custom assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SupportedCloud")] + pub enum SupportedCloud { + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SupportedCloud { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SupportedCloud { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SupportedCloud { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("SupportedCloud", 0u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("SupportedCloud", 1u32, "GCP"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("Severity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("Severity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of Custom Assessment Automations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationsListResult { + #[doc = "Collection of Custom Assessment Automations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CustomAssessmentAutomationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CustomAssessmentAutomationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The CSPM P1 for Aws offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderCspmAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] + pub vm_scanners: Option, +} +impl DefenderCspmAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + vm_scanners: None, + } + } +} +pub mod defender_cspm_aws_offering { + use super::*; + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VmScanners { + #[doc = "Is Microsoft Defender for Server VM scanning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VmScanners { + pub fn new() -> Self { + Self::default() + } + } + pub mod vm_scanners { + use super::*; + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + #[doc = "The scanning mode for the vm scan."] + #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] + pub scanning_mode: Option, + #[doc = "VM tags that indicates that VM should not be scanned"] + #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] + pub exclusion_tags: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The scanning mode for the vm scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ScanningMode")] + pub enum ScanningMode { + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ScanningMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ScanningMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ScanningMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "The CSPM P1 for GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderCspmGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderCspmGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for Databases AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderFoDatabasesAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The RDS configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rds: Option, +} +impl DefenderFoDatabasesAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + arc_auto_provisioning: None, + rds: None, + } + } +} +pub mod defender_fo_databases_aws_offering { + use super::*; + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The RDS configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Rds { + #[doc = "Is RDS protection enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl Rds { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for Containers AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForContainersAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The kubernetes service connection configuration"] + #[serde(rename = "kubernetesService", default, skip_serializing_if = "Option::is_none")] + pub kubernetes_service: Option, + #[doc = "The kubernetes to scuba connection configuration"] + #[serde(rename = "kubernetesScubaReader", default, skip_serializing_if = "Option::is_none")] + pub kubernetes_scuba_reader: Option, + #[doc = "The cloudwatch to kinesis connection configuration"] + #[serde(rename = "cloudWatchToKinesis", default, skip_serializing_if = "Option::is_none")] + pub cloud_watch_to_kinesis: Option, + #[doc = "The kinesis to s3 connection configuration"] + #[serde(rename = "kinesisToS3", default, skip_serializing_if = "Option::is_none")] + pub kinesis_to_s3: Option, + #[doc = "The container vulnerability assessment configuration"] + #[serde(rename = "containerVulnerabilityAssessment", default, skip_serializing_if = "Option::is_none")] + pub container_vulnerability_assessment: Option, + #[doc = "The container vulnerability assessment task configuration"] + #[serde(rename = "containerVulnerabilityAssessmentTask", default, skip_serializing_if = "Option::is_none")] + pub container_vulnerability_assessment_task: Option, + #[doc = "Enable container vulnerability assessment feature"] + #[serde( + rename = "enableContainerVulnerabilityAssessment", + default, + skip_serializing_if = "Option::is_none" + )] + pub enable_container_vulnerability_assessment: Option, + #[doc = "Is audit logs pipeline auto provisioning enabled"] + #[serde(rename = "autoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub auto_provisioning: Option, + #[doc = "The retention time in days of kube audit logs set on the CloudWatch log group"] + #[serde(rename = "kubeAuditRetentionTime", default, skip_serializing_if = "Option::is_none")] + pub kube_audit_retention_time: Option, + #[doc = "The externalId used by the data reader to prevent the confused deputy attack"] + #[serde(rename = "scubaExternalId", default, skip_serializing_if = "Option::is_none")] + pub scuba_external_id: Option, +} +impl DefenderForContainersAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + kubernetes_service: None, + kubernetes_scuba_reader: None, + cloud_watch_to_kinesis: None, + kinesis_to_s3: None, + container_vulnerability_assessment: None, + container_vulnerability_assessment_task: None, + enable_container_vulnerability_assessment: None, + auto_provisioning: None, + kube_audit_retention_time: None, + scuba_external_id: None, + } + } +} +pub mod defender_for_containers_aws_offering { + use super::*; + #[doc = "The kubernetes service connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KubernetesService { + #[doc = "The cloud role ARN in AWS for this feature used for provisioning resources"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KubernetesService { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The kubernetes to scuba connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KubernetesScubaReader { + #[doc = "The cloud role ARN in AWS for this feature used for reading data"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KubernetesScubaReader { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The cloudwatch to kinesis connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct CloudWatchToKinesis { + #[doc = "The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl CloudWatchToKinesis { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The kinesis to s3 connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KinesisToS3 { + #[doc = "The cloud role ARN in AWS used by Kinesis to transfer data into S3"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KinesisToS3 { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The container vulnerability assessment configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ContainerVulnerabilityAssessment { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ContainerVulnerabilityAssessment { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The container vulnerability assessment task configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ContainerVulnerabilityAssessmentTask { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ContainerVulnerabilityAssessmentTask { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The containers GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForContainersGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "dataPipelineNativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub data_pipeline_native_cloud_connection: Option, + #[doc = "Is audit logs data collection enabled"] + #[serde(rename = "auditLogsAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub audit_logs_auto_provisioning_flag: Option, + #[doc = "Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled"] + #[serde(rename = "defenderAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub defender_agent_auto_provisioning_flag: Option, + #[doc = "Is Policy Kubernetes agent auto provisioning enabled"] + #[serde(rename = "policyAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub policy_agent_auto_provisioning_flag: Option, +} +impl DefenderForContainersGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + data_pipeline_native_cloud_connection: None, + audit_logs_auto_provisioning_flag: None, + defender_agent_auto_provisioning_flag: None, + policy_agent_auto_provisioning_flag: None, + } + } +} +pub mod defender_for_containers_gcp_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DataPipelineNativeCloudConnection { + #[doc = "The data collection service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The data collection GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl DataPipelineNativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for Databases GCP offering configurations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDatabasesGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The native cloud connection configuration"] + #[serde( + rename = "defenderForDatabasesArcAutoProvisioning", + default, + skip_serializing_if = "Option::is_none" + )] + pub defender_for_databases_arc_auto_provisioning: Option, +} +impl DefenderForDatabasesGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + arc_auto_provisioning: None, + defender_for_databases_arc_auto_provisioning: None, + } + } +} +pub mod defender_for_databases_gcp_offering { + use super::*; + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForDatabasesArcAutoProvisioning { + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl DefenderForDatabasesArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for DevOps for Azure DevOps offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDevOpsAzureDevOpsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderForDevOpsAzureDevOpsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for DevOps for Github offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDevOpsGithubOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderForDevOpsGithubOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for Servers AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForServersAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Defender for servers connection configuration"] + #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] + pub defender_for_servers: Option, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub va_auto_provisioning: Option, + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub mde_auto_provisioning: Option, + #[doc = "configuration for the servers offering subPlan"] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] + pub vm_scanners: Option, +} +impl DefenderForServersAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + defender_for_servers: None, + arc_auto_provisioning: None, + va_auto_provisioning: None, + mde_auto_provisioning: None, + sub_plan: None, + vm_scanners: None, + } + } +} +pub mod defender_for_servers_aws_offering { + use super::*; + #[doc = "The Defender for servers connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForServers { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl DefenderForServers { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VaAutoProvisioning { + #[doc = "Is Vulnerability Assessment auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VaAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + pub mod va_auto_provisioning { + use super::*; + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Qualys, + #[serde(rename = "TVM")] + Tvm, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), + Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MdeAutoProvisioning { + #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl MdeAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "configuration for the servers offering subPlan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SubPlan { + #[doc = "The available sub plans"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SubPlan { + pub fn new() -> Self { + Self::default() + } + } + pub mod sub_plan { + use super::*; + #[doc = "The available sub plans"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + P1, + P2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VmScanners { + #[doc = "Is Microsoft Defender for Server VM scanning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VmScanners { + pub fn new() -> Self { + Self::default() + } + } + pub mod vm_scanners { + use super::*; + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + #[doc = "The scanning mode for the vm scan."] + #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] + pub scanning_mode: Option, + #[doc = "VM tags that indicates that VM should not be scanned"] + #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] + pub exclusion_tags: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The scanning mode for the vm scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ScanningMode")] + pub enum ScanningMode { + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ScanningMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ScanningMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ScanningMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "The Defender for Servers GCP offering configurations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForServersGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Defender for servers connection configuration"] + #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] + pub defender_for_servers: Option, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub va_auto_provisioning: Option, + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub mde_auto_provisioning: Option, + #[doc = "configuration for the servers offering subPlan"] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, +} +impl DefenderForServersGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + defender_for_servers: None, + arc_auto_provisioning: None, + va_auto_provisioning: None, + mde_auto_provisioning: None, + sub_plan: None, + } + } +} +pub mod defender_for_servers_gcp_offering { + use super::*; + #[doc = "The Defender for servers connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForServers { + #[doc = "The workload identity provider id in GCP for this feature"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + #[doc = "The service account email address in GCP for this feature"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + } + impl DefenderForServers { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VaAutoProvisioning { + #[doc = "Is Vulnerability Assessment auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VaAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + pub mod va_auto_provisioning { + use super::*; + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Qualys, + #[serde(rename = "TVM")] + Tvm, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), + Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MdeAutoProvisioning { + #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl MdeAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "configuration for the servers offering subPlan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SubPlan { + #[doc = "The available sub plans"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SubPlan { + pub fn new() -> Self { + Self::default() + } + } + pub mod sub_plan { + use super::*; + #[doc = "The available sub plans"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + P1, + P2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "The information protection for AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InformationProtectionAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "informationProtection", default, skip_serializing_if = "Option::is_none")] + pub information_protection: Option, +} +impl InformationProtectionAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + information_protection: None, + } + } +} +pub mod information_protection_aws_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct InformationProtection { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl InformationProtection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "List of security controls definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionList { + #[doc = "Collection of security controls definition in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoreControlDefinitionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoreControlDefinitionList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/security/src/package_dotnet_sdk/mod.rs b/services/mgmt/security/src/package_dotnet_sdk/mod.rs new file mode 100644 index 0000000000..9551852165 --- /dev/null +++ b/services/mgmt/security/src/package_dotnet_sdk/mod.rs @@ -0,0 +1,22016 @@ +#![allow(unused_mut)] +#![allow(unused_variables)] +#![allow(unused_imports)] +#![allow(clippy::redundant_clone)] +pub mod models; +#[derive(Clone)] +pub struct Client { + endpoint: String, + credential: std::sync::Arc, + scopes: Vec, + pipeline: azure_core::Pipeline, +} +#[derive(Clone)] +pub struct ClientBuilder { + credential: std::sync::Arc, + endpoint: Option, + scopes: Option>, + options: azure_core::ClientOptions, +} +pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; +impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`."] + #[must_use] + pub fn new(credential: std::sync::Arc) -> Self { + Self { + credential, + endpoint: None, + scopes: None, + options: azure_core::ClientOptions::default(), + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Set the scopes."] + #[must_use] + pub fn scopes(mut self, scopes: &[&str]) -> Self { + self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); + self + } + #[doc = "Set the retry options."] + #[must_use] + pub fn retry(mut self, retry: impl Into) -> Self { + self.options = self.options.retry(retry); + self + } + #[doc = "Set the transport options."] + #[must_use] + pub fn transport(mut self, transport: impl Into) -> Self { + self.options = self.options.transport(transport); + self + } + #[doc = "Convert the builder into a `Client` instance."] + #[must_use] + pub fn build(self) -> Client { + let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); + let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); + Client::new(endpoint, self.credential, scopes, self.options) + } +} +impl Client { + pub(crate) fn endpoint(&self) -> &str { + self.endpoint.as_str() + } + pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { + self.credential.as_ref() + } + pub(crate) fn scopes(&self) -> Vec<&str> { + self.scopes.iter().map(String::as_str).collect() + } + pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { + let mut context = azure_core::Context::default(); + self.pipeline.send(&mut context, request).await + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder(credential: std::sync::Arc) -> ClientBuilder { + ClientBuilder::new(credential) + } + #[doc = "Create a new `Client`."] + #[must_use] + pub fn new( + endpoint: impl Into, + credential: std::sync::Arc, + scopes: Vec, + options: azure_core::ClientOptions, + ) -> Self { + let endpoint = endpoint.into(); + let pipeline = azure_core::Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options, + Vec::new(), + Vec::new(), + ); + Self { + endpoint, + credential, + scopes, + pipeline, + } + } + pub fn adaptive_application_controls_client(&self) -> adaptive_application_controls::Client { + adaptive_application_controls::Client(self.clone()) + } + pub fn adaptive_network_hardenings_client(&self) -> adaptive_network_hardenings::Client { + adaptive_network_hardenings::Client(self.clone()) + } + pub fn advanced_threat_protection_client(&self) -> advanced_threat_protection::Client { + advanced_threat_protection::Client(self.clone()) + } + pub fn alerts_client(&self) -> alerts::Client { + alerts::Client(self.clone()) + } + pub fn alerts_suppression_rules_client(&self) -> alerts_suppression_rules::Client { + alerts_suppression_rules::Client(self.clone()) + } + pub fn allowed_connections_client(&self) -> allowed_connections::Client { + allowed_connections::Client(self.clone()) + } + pub fn application_client(&self) -> application::Client { + application::Client(self.clone()) + } + pub fn applications_client(&self) -> applications::Client { + applications::Client(self.clone()) + } + pub fn assessments_client(&self) -> assessments::Client { + assessments::Client(self.clone()) + } + pub fn assessments_metadata_client(&self) -> assessments_metadata::Client { + assessments_metadata::Client(self.clone()) + } + pub fn auto_provisioning_settings_client(&self) -> auto_provisioning_settings::Client { + auto_provisioning_settings::Client(self.clone()) + } + pub fn automations_client(&self) -> automations::Client { + automations::Client(self.clone()) + } + pub fn compliance_results_client(&self) -> compliance_results::Client { + compliance_results::Client(self.clone()) + } + pub fn compliances_client(&self) -> compliances::Client { + compliances::Client(self.clone()) + } + pub fn connectors_client(&self) -> connectors::Client { + connectors::Client(self.clone()) + } + pub fn custom_assessment_automations_client(&self) -> custom_assessment_automations::Client { + custom_assessment_automations::Client(self.clone()) + } + pub fn custom_entity_store_assignments_client(&self) -> custom_entity_store_assignments::Client { + custom_entity_store_assignments::Client(self.clone()) + } + pub fn device_security_groups_client(&self) -> device_security_groups::Client { + device_security_groups::Client(self.clone()) + } + pub fn discovered_security_solutions_client(&self) -> discovered_security_solutions::Client { + discovered_security_solutions::Client(self.clone()) + } + pub fn external_security_solutions_client(&self) -> external_security_solutions::Client { + external_security_solutions::Client(self.clone()) + } + pub fn governance_assignments_client(&self) -> governance_assignments::Client { + governance_assignments::Client(self.clone()) + } + pub fn governance_rules_client(&self) -> governance_rules::Client { + governance_rules::Client(self.clone()) + } + pub fn information_protection_policies_client(&self) -> information_protection_policies::Client { + information_protection_policies::Client(self.clone()) + } + pub fn ingestion_settings_client(&self) -> ingestion_settings::Client { + ingestion_settings::Client(self.clone()) + } + pub fn iot_security_solution_client(&self) -> iot_security_solution::Client { + iot_security_solution::Client(self.clone()) + } + pub fn iot_security_solution_analytics_client(&self) -> iot_security_solution_analytics::Client { + iot_security_solution_analytics::Client(self.clone()) + } + pub fn iot_security_solutions_analytics_aggregated_alert_client(&self) -> iot_security_solutions_analytics_aggregated_alert::Client { + iot_security_solutions_analytics_aggregated_alert::Client(self.clone()) + } + pub fn iot_security_solutions_analytics_recommendation_client(&self) -> iot_security_solutions_analytics_recommendation::Client { + iot_security_solutions_analytics_recommendation::Client(self.clone()) + } + pub fn jit_network_access_policies_client(&self) -> jit_network_access_policies::Client { + jit_network_access_policies::Client(self.clone()) + } + pub fn locations_client(&self) -> locations::Client { + locations::Client(self.clone()) + } + pub fn mde_onboardings_client(&self) -> mde_onboardings::Client { + mde_onboardings::Client(self.clone()) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + pub fn pricings_client(&self) -> pricings::Client { + pricings::Client(self.clone()) + } + pub fn regulatory_compliance_assessments_client(&self) -> regulatory_compliance_assessments::Client { + regulatory_compliance_assessments::Client(self.clone()) + } + pub fn regulatory_compliance_controls_client(&self) -> regulatory_compliance_controls::Client { + regulatory_compliance_controls::Client(self.clone()) + } + pub fn regulatory_compliance_standards_client(&self) -> regulatory_compliance_standards::Client { + regulatory_compliance_standards::Client(self.clone()) + } + pub fn secure_score_control_definitions_client(&self) -> secure_score_control_definitions::Client { + secure_score_control_definitions::Client(self.clone()) + } + pub fn secure_score_controls_client(&self) -> secure_score_controls::Client { + secure_score_controls::Client(self.clone()) + } + pub fn secure_scores_client(&self) -> secure_scores::Client { + secure_scores::Client(self.clone()) + } + pub fn security_connector_application_client(&self) -> security_connector_application::Client { + security_connector_application::Client(self.clone()) + } + pub fn security_connector_applications_client(&self) -> security_connector_applications::Client { + security_connector_applications::Client(self.clone()) + } + pub fn security_connectors_client(&self) -> security_connectors::Client { + security_connectors::Client(self.clone()) + } + pub fn security_contacts_client(&self) -> security_contacts::Client { + security_contacts::Client(self.clone()) + } + pub fn security_solutions_client(&self) -> security_solutions::Client { + security_solutions::Client(self.clone()) + } + pub fn security_solutions_reference_data_client(&self) -> security_solutions_reference_data::Client { + security_solutions_reference_data::Client(self.clone()) + } + pub fn server_vulnerability_assessment_client(&self) -> server_vulnerability_assessment::Client { + server_vulnerability_assessment::Client(self.clone()) + } + pub fn settings_client(&self) -> settings::Client { + settings::Client(self.clone()) + } + pub fn software_inventories_client(&self) -> software_inventories::Client { + software_inventories::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_baseline_rules_client(&self) -> sql_vulnerability_assessment_baseline_rules::Client { + sql_vulnerability_assessment_baseline_rules::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_scan_results_client(&self) -> sql_vulnerability_assessment_scan_results::Client { + sql_vulnerability_assessment_scan_results::Client(self.clone()) + } + pub fn sql_vulnerability_assessment_scans_client(&self) -> sql_vulnerability_assessment_scans::Client { + sql_vulnerability_assessment_scans::Client(self.clone()) + } + pub fn sub_assessments_client(&self) -> sub_assessments::Client { + sub_assessments::Client(self.clone()) + } + pub fn tasks_client(&self) -> tasks::Client { + tasks::Client(self.clone()) + } + pub fn topology_client(&self) -> topology::Client { + topology::Client(self.clone()) + } + pub fn workspace_settings_client(&self) -> workspace_settings::Client { + workspace_settings::Client(self.clone()) + } +} +pub mod mde_onboardings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The configuration or data needed to onboard the machine to MDE"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "The default configuration or data needed to onboard the machine to MDE"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn get(&self, subscription_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MdeOnboardingDataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/mdeOnboardings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MdeOnboardingData = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/mdeOnboardings/default", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-10-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod custom_assessment_automations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a custom assessment automation"] + #[doc = "Gets a single custom assessment automation by name for the provided subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + } + } + #[doc = "Creates a custom assessment automation"] + #[doc = "Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + #[doc = "* `custom_assessment_automation_body`: Custom Assessment Automation body"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + custom_assessment_automation_body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + custom_assessment_automation_body: custom_assessment_automation_body.into(), + } + } + #[doc = "Deletes a custom assessment automation"] + #[doc = "Deletes a custom assessment automation by name for a provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_assessment_automation_name`: Name of the Custom Assessment Automation."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_assessment_automation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_assessment_automation_name: custom_assessment_automation_name.into(), + } + } + #[doc = "List custom assessment automations in a subscription and a resource group"] + #[doc = "List custom assessment automations by provided subscription and resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List custom assessment automations in a subscription"] + #[doc = "List custom assessment automations by provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + pub(crate) custom_assessment_automation_body: models::CustomAssessmentAutomationRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.custom_assessment_automation_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_assessment_automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_assessment_automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customAssessmentAutomations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomAssessmentAutomationsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/customAssessmentAutomations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod custom_entity_store_assignments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a custom entity store assignment"] + #[doc = "Gets a single custom entity store assignment by name for the provided subscription and resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + } + } + #[doc = "Creates a custom entity store assignment"] + #[doc = "Creates a custom entity store assignment for the provided subscription, if not already exists."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + #[doc = "* `custom_entity_store_assignment_request_body`: Custom entity store assignment body"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + custom_entity_store_assignment_request_body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + custom_entity_store_assignment_request_body: custom_entity_store_assignment_request_body.into(), + } + } + #[doc = "Deleted a custom entity store assignment"] + #[doc = "Delete a custom entity store assignment by name for a provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `custom_entity_store_assignment_name`: Name of the custom entity store assignment. Generated name is GUID."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + custom_entity_store_assignment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + custom_entity_store_assignment_name: custom_entity_store_assignment_name.into(), + } + } + #[doc = "List custom entity store assignments in a subscription and a resource group"] + #[doc = "List custom entity store assignments by a provided subscription and resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List custom entity store assignments in a subscription"] + #[doc = "List custom entity store assignments by provided subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + pub(crate) custom_entity_store_assignment_request_body: models::CustomEntityStoreAssignmentRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.custom_entity_store_assignment_request_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) custom_entity_store_assignment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.custom_entity_store_assignment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignmentsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourcegroups/{}/providers/Microsoft.Security/customEntityStoreAssignments", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::CustomEntityStoreAssignmentsListResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/customEntityStoreAssignments", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod compliance_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Security compliance results in the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Security Compliance Result"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `compliance_result_name`: name of the desired assessment compliance result"] + pub fn get(&self, resource_id: impl Into, compliance_result_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + compliance_result_name: compliance_result_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComplianceResultList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/complianceResults", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComplianceResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) compliance_result_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/complianceResults/{}", + this.client.endpoint(), + &this.resource_id, + &this.compliance_result_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod pricings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists Microsoft Defender for Cloud pricing configurations in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + pub fn get(&self, subscription_id: impl Into, pricing_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + } + } + #[doc = "Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `pricing_name`: name of the pricing configuration"] + #[doc = "* `pricing`: Pricing object"] + pub fn update( + &self, + subscription_id: impl Into, + pricing_name: impl Into, + pricing: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + pricing_name: pricing_name.into(), + pricing: pricing.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::PricingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Pricing = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) pricing_name: String, + pub(crate) pricing: models::Pricing, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/pricings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.pricing_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-03-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.pricing)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod advanced_threat_protection { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the Advanced Threat Protection settings for the specified resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `setting_name`: Advanced Threat Protection setting name."] + pub fn get(&self, resource_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "Creates or updates the Advanced Threat Protection settings on a specified resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `setting_name`: Advanced Threat Protection setting name."] + #[doc = "* `advanced_threat_protection_setting`: Advanced Threat Protection Settings"] + pub fn create( + &self, + resource_id: impl Into, + setting_name: impl Into, + advanced_threat_protection_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + setting_name: setting_name.into(), + advanced_threat_protection_setting: advanced_threat_protection_setting.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdvancedThreatProtectionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/advancedThreatProtectionSettings/{}", + this.client.endpoint(), + &this.resource_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdvancedThreatProtectionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) setting_name: String, + pub(crate) advanced_threat_protection_setting: models::AdvancedThreatProtectionSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/advancedThreatProtectionSettings/{}", + this.client.endpoint(), + &this.resource_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.advanced_threat_protection_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod device_security_groups { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method get the list of device security groups for the specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + } + } + #[doc = "Use this method to get the device security group for the specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + pub fn get(&self, resource_id: impl Into, device_security_group_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + } + } + #[doc = "Use this method to creates or updates the device security group on a specified IoT Hub resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + #[doc = "* `device_security_group`: Security group object."] + pub fn create_or_update( + &self, + resource_id: impl Into, + device_security_group_name: impl Into, + device_security_group: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + device_security_group: device_security_group.into(), + } + } + #[doc = "User this method to deletes the device security group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `device_security_group_name`: The name of the device security group. Note that the name of the device security group is case insensitive."] + pub fn delete(&self, resource_id: impl Into, device_security_group_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + device_security_group_name: device_security_group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroupList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups", + this.client.endpoint(), + &this.resource_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DeviceSecurityGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + pub(crate) device_security_group: models::DeviceSecurityGroup, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.device_security_group)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) device_security_group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/deviceSecurityGroups/{}", + this.client.endpoint(), + &this.resource_id, + &this.device_security_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod iot_security_solution { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method to get the list of IoT Security solutions by subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Use this method to get the list IoT Security solutions organized by resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + filter: None, + } + } + #[doc = "User this method to get details of a specific IoT Security solution based on solution name"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + #[doc = "Use this method to create or update yours IoT Security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + #[doc = "* `iot_security_solution_data`: The security solution data"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + iot_security_solution_data: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + iot_security_solution_data: iot_security_solution_data.into(), + } + } + #[doc = "Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + #[doc = "* `update_iot_security_solution_data`: The security solution data"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + update_iot_security_solution_data: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + update_iot_security_solution_data: update_iot_security_solution_data.into(), + } + } + #[doc = "Use this method to delete yours IoT Security solution"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/iotSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) iot_security_solution_data: models::IoTSecuritySolutionModel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.iot_security_solution_data)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) update_iot_security_solution_data: models::UpdateIotSecuritySolutionData, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.update_iot_security_solution_data)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod iot_security_solution_analytics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method to get IoT security Analytics metrics in an array."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + #[doc = "Use this method to get IoT Security Analytics metrics."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionAnalyticsModelList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecuritySolutionAnalyticsModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod iot_security_solutions_analytics_aggregated_alert { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method to get the aggregated alert list of yours IoT Security solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + top: None, + } + } + #[doc = "Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + #[doc = "* `aggregated_alert_name`: Identifier of the aggregated alert."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + aggregated_alert_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + aggregated_alert_name: aggregated_alert_name.into(), + } + } + #[doc = "Use this method to dismiss an aggregated IoT Security Solution Alert."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + #[doc = "* `aggregated_alert_name`: Identifier of the aggregated alert."] + pub fn dismiss( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + aggregated_alert_name: impl Into, + ) -> dismiss::RequestBuilder { + dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + aggregated_alert_name: aggregated_alert_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedAlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "Number of results to retrieve."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedAlerts" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedAlert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) aggregated_alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedAlerts/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name , & this . aggregated_alert_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) aggregated_alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedAlerts/{}/dismiss" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name , & this . aggregated_alert_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod iot_security_solutions_analytics_recommendation { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + #[doc = "* `aggregated_recommendation_name`: Name of the recommendation aggregated for this query."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + aggregated_recommendation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + aggregated_recommendation_name: aggregated_recommendation_name.into(), + } + } + #[doc = "Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `solution_name`: The name of the IoT Security solution."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + solution_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + solution_name: solution_name.into(), + top: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedRecommendation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) aggregated_recommendation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedRecommendations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name , & this . aggregated_recommendation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IoTSecurityAggregatedRecommendationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) solution_name: String, + pub(crate) top: Option, + } + impl RequestBuilder { + #[doc = "Number of results to retrieve."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/iotSecuritySolutions/{}/analyticsModels/default/aggregatedRecommendations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . solution_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-08-01"); + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod locations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn get(&self, subscription_id: impl Into, asc_location: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AscLocationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AscLocation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod operations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Exposes all available operations for discovery purposes."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = + azure_core::Url::parse(&format!("{}/providers/Microsoft.Security/operations", this.client.endpoint(),))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod tasks { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + pub fn get_subscription_level_task( + &self, + subscription_id: impl Into, + asc_location: impl Into, + task_name: impl Into, + ) -> get_subscription_level_task::RequestBuilder { + get_subscription_level_task::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + #[doc = "* `task_update_action_type`: Type of the action to do on the task"] + pub fn update_subscription_level_task_state( + &self, + subscription_id: impl Into, + asc_location: impl Into, + task_name: impl Into, + task_update_action_type: impl Into, + ) -> update_subscription_level_task_state::RequestBuilder { + update_subscription_level_task_state::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + task_update_action_type: task_update_action_type.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + filter: None, + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + pub fn get_resource_group_level_task( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + task_name: impl Into, + ) -> get_resource_group_level_task::RequestBuilder { + get_resource_group_level_task::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + } + } + #[doc = "Recommended tasks that will help improve the security of the subscription proactively"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `task_name`: Name of the task object, will be a GUID"] + #[doc = "* `task_update_action_type`: Type of the action to do on the task"] + pub fn update_resource_group_level_task_state( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + task_name: impl Into, + task_update_action_type: impl Into, + ) -> update_resource_group_level_task_state::RequestBuilder { + update_resource_group_level_task_state::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + task_name: task_name.into(), + task_update_action_type: task_update_action_type.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/tasks", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_level_task { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.task_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_level_task_state { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + pub(crate) task_update_action_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/tasks/{}/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.task_name, + &this.task_update_action_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_resource_group_level_task { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.task_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_resource_group_level_task_state { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) task_name: String, + pub(crate) task_update_action_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/tasks/{}/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.task_name, + &this.task_update_action_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2015-06-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod auto_provisioning_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Exposes the auto provisioning settings of the subscriptions"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific setting"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Auto provisioning setting key"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "Details of a specific setting"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: Auto provisioning setting key"] + #[doc = "* `setting`: Auto provisioning setting key"] + pub fn create( + &self, + subscription_id: impl Into, + setting_name: impl Into, + setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutoProvisioningSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::AutoProvisioningSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/autoProvisioningSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod compliances { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The Compliance scores of the specific management group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Details of a specific Compliance."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `compliance_name`: name of the Compliance"] + pub fn get(&self, scope: impl Into, compliance_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + compliance_name: compliance_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ComplianceList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/compliances", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Compliance = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) compliance_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/compliances/{}", + this.client.endpoint(), + &this.scope, + &this.compliance_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod information_protection_policies { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details of the information protection policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `information_protection_policy_name`: Name of the information protection policy."] + pub fn get(&self, scope: impl Into, information_protection_policy_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + information_protection_policy_name: information_protection_policy_name.into(), + } + } + #[doc = "Details of the information protection policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `information_protection_policy_name`: Name of the information protection policy."] + #[doc = "* `information_protection_policy`: Information protection policy."] + pub fn create_or_update( + &self, + scope: impl Into, + information_protection_policy_name: impl Into, + information_protection_policy: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + information_protection_policy_name: information_protection_policy_name.into(), + information_protection_policy: information_protection_policy.into(), + } + } + #[doc = "Information protection policies of a specific management group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) information_protection_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies/{}", + this.client.endpoint(), + &this.scope, + &this.information_protection_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) information_protection_policy_name: String, + pub(crate) information_protection_policy: models::InformationProtectionPolicy, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies/{}", + this.client.endpoint(), + &this.scope, + &this.information_protection_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.information_protection_policy)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::InformationProtectionPolicyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/informationProtectionPolicies", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod security_contacts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get Default Security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + pub fn get(&self, subscription_id: impl Into, security_contact_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + } + } + #[doc = "Create security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + #[doc = "* `security_contact`: Security contact object"] + pub fn create( + &self, + subscription_id: impl Into, + security_contact_name: impl Into, + security_contact: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + security_contact: security_contact.into(), + } + } + #[doc = "Delete security contact configurations for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `security_contact_name`: Name of the security contact object"] + pub fn delete(&self, subscription_id: impl Into, security_contact_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + security_contact_name: security_contact_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContactList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContact = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityContact = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + pub(crate) security_contact: models::SecurityContact, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_contact)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) security_contact_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityContacts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.security_contact_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod workspace_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + pub fn get(&self, subscription_id: impl Into, workspace_setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + } + } + #[doc = "creating settings about where we should store your security data and logs"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + #[doc = "* `workspace_setting`: Security data setting object"] + pub fn create( + &self, + subscription_id: impl Into, + workspace_setting_name: impl Into, + workspace_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + workspace_setting: workspace_setting.into(), + } + } + #[doc = "Settings about where we should store your security data and logs"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + #[doc = "* `workspace_setting`: Security data setting object"] + pub fn update( + &self, + subscription_id: impl Into, + workspace_setting_name: impl Into, + workspace_setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + workspace_setting: workspace_setting.into(), + } + } + #[doc = "Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `workspace_setting_name`: Name of the security setting"] + pub fn delete(&self, subscription_id: impl Into, workspace_setting_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + workspace_setting_name: workspace_setting_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + pub(crate) workspace_setting: models::WorkspaceSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + pub(crate) workspace_setting: models::WorkspaceSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) workspace_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/workspaceSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.workspace_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2017-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod regulatory_compliance_standards { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Supported regulatory compliance standards details and state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + filter: None, + } + } + #[doc = "Supported regulatory compliance details state for selected standard"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceStandardList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceStandard = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}", + this.client.endpoint(), + &this.subscription_id, + &this.regulatory_compliance_standard_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "All supported regulatory compliance controls details and state for selected standard"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + pub fn list( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + filter: None, + } + } + #[doc = "Selected regulatory compliance control details and state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceControl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod regulatory_compliance_assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Details and state of assessments mapped to selected regulatory compliance control"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + pub fn list( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + filter: None, + } + } + #[doc = "Supported regulatory compliance details and state for selected assessment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `regulatory_compliance_standard_name`: Name of the regulatory compliance standard object"] + #[doc = "* `regulatory_compliance_control_name`: Name of the regulatory compliance control object"] + #[doc = "* `regulatory_compliance_assessment_name`: Name of the regulatory compliance assessment object"] + pub fn get( + &self, + subscription_id: impl Into, + regulatory_compliance_standard_name: impl Into, + regulatory_compliance_control_name: impl Into, + regulatory_compliance_assessment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + regulatory_compliance_standard_name: regulatory_compliance_standard_name.into(), + regulatory_compliance_control_name: regulatory_compliance_control_name.into(), + regulatory_compliance_assessment_name: regulatory_compliance_assessment_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + pub(crate) filter: Option, + } + impl RequestBuilder { + #[doc = "OData filter. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}/regulatoryComplianceAssessments" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RegulatoryComplianceAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) regulatory_compliance_standard_name: String, + pub(crate) regulatory_compliance_control_name: String, + pub(crate) regulatory_compliance_assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Security/regulatoryComplianceStandards/{}/regulatoryComplianceControls/{}/regulatoryComplianceAssessments/{}" , this . client . endpoint () , & this . subscription_id , & this . regulatory_compliance_standard_name , & this . regulatory_compliance_control_name , & this . regulatory_compliance_assessment_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sub_assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get security sub-assessments on all your scanned resources inside a subscription scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list_all(&self, scope: impl Into) -> list_all::RequestBuilder { + list_all::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Get security sub-assessments on all your scanned resources inside a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + pub fn list(&self, scope: impl Into, assessment_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + } + } + #[doc = "Get a security sub-assessment on your scanned resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `sub_assessment_name`: The Sub-Assessment Key - Unique key for the sub-assessment type"] + pub fn get( + &self, + scope: impl Into, + assessment_name: impl Into, + sub_assessment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + sub_assessment_name: sub_assessment_name.into(), + } + } + } + pub mod list_all { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/subAssessments", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/subAssessments", + this.client.endpoint(), + &this.scope, + &this.assessment_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySubAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + pub(crate) sub_assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/subAssessments/{}", + this.client.endpoint(), + &this.scope, + &this.assessment_name, + &this.sub_assessment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod automations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves information about the model of a security automation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + } + } + #[doc = "Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + #[doc = "* `automation`: The security automation resource"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + automation: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + automation: automation.into(), + } + } + #[doc = "Deletes a security automation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + } + } + #[doc = "Validates the security automation model before create or update. Any validation errors are returned to the client."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `automation_name`: The security automation name."] + #[doc = "* `automation`: The security automation resource"] + pub fn validate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + automation_name: impl Into, + automation: impl Into, + ) -> validate::RequestBuilder { + validate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + automation_name: automation_name.into(), + automation: automation.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/automations", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Automation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Automation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + pub(crate) automation: models::Automation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.automation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod validate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AutomationValidationStatus = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) automation_name: String, + pub(crate) automation: models::Automation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/automations/{}/validate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.automation_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.automation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod alerts_suppression_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of all the dismiss rules for the given subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alert_type: None, + } + } + #[doc = "Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + pub fn get(&self, subscription_id: impl Into, alerts_suppression_rule_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + } + } + #[doc = "Update existing rule or create new rule if it doesn't exist"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + #[doc = "* `alerts_suppression_rule`: Suppression rule object"] + pub fn update( + &self, + subscription_id: impl Into, + alerts_suppression_rule_name: impl Into, + alerts_suppression_rule: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + alerts_suppression_rule: alerts_suppression_rule.into(), + } + } + #[doc = "Delete dismiss alert rule for this subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `alerts_suppression_rule_name`: The unique name of the suppression alert rule"] + pub fn delete( + &self, + subscription_id: impl Into, + alerts_suppression_rule_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + alerts_suppression_rule_name: alerts_suppression_rule_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRulesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alert_type: Option, + } + impl RequestBuilder { + #[doc = "Type of the alert to get rules for"] + pub fn alert_type(mut self, alert_type: impl Into) -> Self { + self.alert_type = Some(alert_type.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + if let Some(alert_type) = &this.alert_type { + req.url_mut().query_pairs_mut().append_pair("AlertType", alert_type); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertsSuppressionRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + pub(crate) alerts_suppression_rule: models::AlertsSuppressionRule, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.alerts_suppression_rule)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) alerts_suppression_rule_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alertsSuppressionRules/{}", + this.client.endpoint(), + &this.subscription_id, + &this.alerts_suppression_rule_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2019-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod server_vulnerability_assessment { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of server vulnerability assessment onboarding statuses on a given resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets a server vulnerability assessment onboarding statuses on a given resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `server_vulnerability_assessment`: ServerVulnerabilityAssessment status. only a 'default' value is supported."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + server_vulnerability_assessment: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + server_vulnerability_assessment: server_vulnerability_assessment.into(), + } + } + #[doc = "Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `server_vulnerability_assessment`: ServerVulnerabilityAssessment status. only a 'default' value is supported."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + server_vulnerability_assessment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + server_vulnerability_assessment: server_vulnerability_assessment.into(), + } + } + #[doc = "Removing server vulnerability assessment from a resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `server_vulnerability_assessment`: ServerVulnerabilityAssessment status. only a 'default' value is supported."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + server_vulnerability_assessment: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + server_vulnerability_assessment: server_vulnerability_assessment.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerVulnerabilityAssessmentsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/serverVulnerabilityAssessments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerVulnerabilityAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) server_vulnerability_assessment: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/serverVulnerabilityAssessments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . server_vulnerability_assessment)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ServerVulnerabilityAssessment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) server_vulnerability_assessment: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/serverVulnerabilityAssessments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . server_vulnerability_assessment)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) server_vulnerability_assessment: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/serverVulnerabilityAssessments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . server_vulnerability_assessment)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod assessments_metadata { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get metadata information on all assessment types"] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "Get metadata information on an assessment type"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `assessment_metadata_name`: The Assessment Key - Unique key for the assessment type"] + pub fn get(&self, assessment_metadata_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + assessment_metadata_name: assessment_metadata_name.into(), + } + } + #[doc = "Get metadata information on all assessment types in a specific subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get metadata information on an assessment type in a specific subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `assessment_metadata_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn get_in_subscription( + &self, + assessment_metadata_name: impl Into, + subscription_id: impl Into, + ) -> get_in_subscription::RequestBuilder { + get_in_subscription::RequestBuilder { + client: self.0.clone(), + assessment_metadata_name: assessment_metadata_name.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Create metadata information on an assessment type in a specific subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `assessment_metadata_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `assessment_metadata`: AssessmentMetadata object"] + pub fn create_in_subscription( + &self, + assessment_metadata_name: impl Into, + subscription_id: impl Into, + assessment_metadata: impl Into, + ) -> create_in_subscription::RequestBuilder { + create_in_subscription::RequestBuilder { + client: self.0.clone(), + assessment_metadata_name: assessment_metadata_name.into(), + subscription_id: subscription_id.into(), + assessment_metadata: assessment_metadata.into(), + } + } + #[doc = "Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `assessment_metadata_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn delete_in_subscription( + &self, + assessment_metadata_name: impl Into, + subscription_id: impl Into, + ) -> delete_in_subscription::RequestBuilder { + delete_in_subscription::RequestBuilder { + client: self.0.clone(), + assessment_metadata_name: assessment_metadata_name.into(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentMetadataResponseList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.Security/assessmentMetadata", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentMetadataResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) assessment_metadata_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.Security/assessmentMetadata/{}", + this.client.endpoint(), + &this.assessment_metadata_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentMetadataResponseList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/assessmentMetadata", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_in_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentMetadataResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) assessment_metadata_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/assessmentMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.assessment_metadata_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_in_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentMetadataResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) assessment_metadata_name: String, + pub(crate) subscription_id: String, + pub(crate) assessment_metadata: models::SecurityAssessmentMetadataResponse, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/assessmentMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.assessment_metadata_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.assessment_metadata)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete_in_subscription { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) assessment_metadata_name: String, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/assessmentMetadata/{}", + this.client.endpoint(), + &this.subscription_id, + &this.assessment_metadata_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod assessments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get security assessments on all your scanned resources inside a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName)."] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Get a security assessment on your scanned resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + pub fn get(&self, resource_id: impl Into, assessment_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + assessment_name: assessment_name.into(), + expand: None, + } + } + #[doc = "Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + #[doc = "* `assessment`: Calculated assessment on a pre-defined assessment metadata"] + pub fn create_or_update( + &self, + resource_id: impl Into, + assessment_name: impl Into, + assessment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + assessment_name: assessment_name.into(), + assessment: assessment.into(), + } + } + #[doc = "Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `resource_id`: The identifier of the resource."] + #[doc = "* `assessment_name`: The Assessment Key - Unique key for the assessment type"] + pub fn delete(&self, resource_id: impl Into, assessment_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + resource_id: resource_id.into(), + assessment_name: assessment_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) assessment_name: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}", + this.client.endpoint(), + &this.resource_id, + &this.assessment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityAssessmentResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) assessment_name: String, + pub(crate) assessment: models::SecurityAssessment, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}", + this.client.endpoint(), + &this.resource_id, + &this.assessment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.assessment)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) resource_id: String, + pub(crate) assessment_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}", + this.client.endpoint(), + &this.resource_id, + &this.assessment_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-06-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod adaptive_application_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of application control machine groups for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + include_path_recommendations: None, + summary: None, + } + } + #[doc = "Gets an application control VM/server group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control machine group"] + pub fn get( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + } + } + #[doc = "Update an application control machine group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control machine group"] + pub fn put( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + body: impl Into, + ) -> put::RequestBuilder { + put::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + body: body.into(), + } + } + #[doc = "Delete an application control machine group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `group_name`: Name of an application control machine group"] + pub fn delete( + &self, + subscription_id: impl Into, + asc_location: impl Into, + group_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + group_name: group_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveApplicationControlGroups = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) include_path_recommendations: Option, + pub(crate) summary: Option, + } + impl RequestBuilder { + #[doc = "Include the policy rules"] + pub fn include_path_recommendations(mut self, include_path_recommendations: bool) -> Self { + self.include_path_recommendations = Some(include_path_recommendations); + self + } + #[doc = "Return output in a summarized form"] + pub fn summary(mut self, summary: bool) -> Self { + self.summary = Some(summary); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applicationWhitelistings", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + if let Some(include_path_recommendations) = &this.include_path_recommendations { + req.url_mut() + .query_pairs_mut() + .append_pair("includePathRecommendations", &include_path_recommendations.to_string()); + } + if let Some(summary) = &this.summary { + req.url_mut().query_pairs_mut().append_pair("summary", &summary.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveApplicationControlGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod put { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveApplicationControlGroup = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + pub(crate) body: models::AdaptiveApplicationControlGroup, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) group_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/applicationWhitelistings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod adaptive_network_hardenings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of Adaptive Network Hardenings resources in scope of an extended resource."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets a single Adaptive Network Hardening resource"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `adaptive_network_hardening_resource_name`: The name of the Adaptive Network Hardening resource."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + adaptive_network_hardening_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + adaptive_network_hardening_resource_name: adaptive_network_hardening_resource_name.into(), + } + } + #[doc = "Enforces the given rules on the NSG(s) listed in the request"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The Namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `adaptive_network_hardening_resource_name`: The name of the Adaptive Network Hardening resource."] + #[doc = "* `adaptive_network_hardening_enforce_action`: Enforces the given rules on the NSG(s) listed in the request"] + pub fn enforce( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + adaptive_network_hardening_resource_name: impl Into, + adaptive_network_hardening_enforce_action: impl Into, + body: impl Into, + ) -> enforce::RequestBuilder { + enforce::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + adaptive_network_hardening_resource_name: adaptive_network_hardening_resource_name.into(), + adaptive_network_hardening_enforce_action: adaptive_network_hardening_enforce_action.into(), + body: body.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveNetworkHardeningsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AdaptiveNetworkHardening = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) adaptive_network_hardening_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . adaptive_network_hardening_resource_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod enforce { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) adaptive_network_hardening_resource_name: String, + pub(crate) adaptive_network_hardening_enforce_action: String, + pub(crate) body: models::AdaptiveNetworkHardeningEnforceRequest, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/adaptiveNetworkHardenings/{}/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . resource_namespace , & this . resource_type , & this . resource_name , & this . adaptive_network_hardening_resource_name , & this . adaptive_network_hardening_enforce_action)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod allowed_connections { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of all possible traffic between resources for the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets the list of all possible traffic between resources for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets the list of all possible traffic between resources for the subscription and location, based on connection type."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `connection_type`: The type of allowed connections (Internal, External)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + connection_type: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + connection_type: connection_type.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/allowedConnections", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/allowedConnections", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AllowedConnectionsResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) connection_type: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/allowedConnections/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.connection_type + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod topology { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list that allows to build a topology view of a subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list that allows to build a topology view of a subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific topology component."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `topology_resource_name`: Name of a topology resources collection."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + topology_resource_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + topology_resource_name: topology_resource_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/topologies", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/topologies", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TopologyResource = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) topology_resource_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/topologies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.topology_resource_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod jit_network_access_policies { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Policies for protecting resources using Just-in-Time access control."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_region::RequestBuilder { + list_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_resource_group_and_region( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + ) -> list_by_resource_group_and_region::RequestBuilder { + list_by_resource_group_and_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Policies for protecting resources using Just-in-Time access control for the subscription, location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + } + } + #[doc = "Create a policy for protecting resources using Just-in-Time access control"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + body: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + body: body.into(), + } + } + #[doc = "Delete a Just-in-Time access control policy."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + } + } + #[doc = "Initiate a JIT access from a specific Just-in-Time policy configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `jit_network_access_policy_name`: Name of a Just-in-Time access configuration policy."] + #[doc = "* `jit_network_access_policy_initiate_type`: Type of the action to do on the Just-in-Time access policy."] + pub fn initiate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + jit_network_access_policy_name: impl Into, + jit_network_access_policy_initiate_type: impl Into, + body: impl Into, + ) -> initiate::RequestBuilder { + initiate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + jit_network_access_policy_name: jit_network_access_policy_name.into(), + jit_network_access_policy_initiate_type: jit_network_access_policy_initiate_type.into(), + body: body.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group_and_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPoliciesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessPolicy = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + pub(crate) body: models::JitNetworkAccessPolicy, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.jit_network_access_policy_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod initiate { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::JitNetworkAccessRequest = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) jit_network_access_policy_name: String, + pub(crate) jit_network_access_policy_initiate_type: String, + pub(crate) body: models::JitNetworkAccessPolicyInitiateRequest, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/jitNetworkAccessPolicies/{}/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . asc_location , & this . jit_network_access_policy_name , & this . jit_network_access_policy_initiate_type)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod discovered_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of discovered Security Solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of discovered Security Solutions for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific discovered Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `discovered_security_solution_name`: Name of a discovered security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + discovered_security_solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + discovered_security_solution_name: discovered_security_solution_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/discoveredSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/discoveredSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::DiscoveredSecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) discovered_security_solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/discoveredSecuritySolutions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . asc_location , & this . discovered_security_solution_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod security_solutions_reference_data { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of all supported Security Solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets list of all supported Security Solutions for subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySolutionsReferenceDataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securitySolutionsReferenceData", + this.client.endpoint(), + &this.subscription_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySolutionsReferenceDataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/securitySolutionsReferenceData", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod external_security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of external security solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a list of external Security Solutions for the subscription and location."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_by_home_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_by_home_region::RequestBuilder { + list_by_home_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "Gets a specific external Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `external_security_solutions_name`: Name of an external security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + external_security_solutions_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + external_security_solutions_name: external_security_solutions_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/externalSecuritySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_home_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/ExternalSecuritySolutions", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ExternalSecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) external_security_solutions_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/ExternalSecuritySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.external_security_solutions_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod secure_scores { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `secure_score_name`: The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below."] + pub fn get(&self, subscription_id: impl Into, secure_score_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + secure_score_name: secure_score_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreItem = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) secure_score_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores/{}", + this.client.endpoint(), + &this.subscription_id, + &this.secure_score_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod secure_score_controls { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all security controls for a specific initiative within a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `secure_score_name`: The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below."] + pub fn list_by_secure_score( + &self, + subscription_id: impl Into, + secure_score_name: impl Into, + ) -> list_by_secure_score::RequestBuilder { + list_by_secure_score::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + secure_score_name: secure_score_name.into(), + expand: None, + } + } + #[doc = "Get all security controls within a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + expand: None, + } + } + } + pub mod list_by_secure_score { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) secure_score_name: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScores/{}/secureScoreControls", + this.client.endpoint(), + &this.subscription_id, + &this.secure_score_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) expand: Option, + } + impl RequestBuilder { + #[doc = "OData expand. Optional."] + pub fn expand(mut self, expand: impl Into) -> Self { + self.expand = Some(expand.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScoreControls", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + if let Some(expand) = &this.expand { + req.url_mut().query_pairs_mut().append_pair("$expand", expand); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod secure_score_control_definitions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the available security controls, their assessments, and the max score"] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone() } + } + #[doc = "For a specified subscription, list the available security controls, their assessments, and the max score"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlDefinitionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/providers/Microsoft.Security/secureScoreControlDefinitions", + this.client.endpoint(), + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecureScoreControlDefinitionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/secureScoreControlDefinitions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod security_solutions { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of Security Solutions for the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a specific Security Solution."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `security_solution_name`: Name of security solution."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + security_solution_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + security_solution_name: security_solution_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySolutionList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securitySolutions", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecuritySolution = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) security_solution_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/securitySolutions/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.security_solution_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Cloud accounts connectors of a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Details of a specific cloud account connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + pub fn get(&self, subscription_id: impl Into, connector_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + } + } + #[doc = "Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + #[doc = "* `connector_setting`: Settings for the cloud account connector"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + connector_name: impl Into, + connector_setting: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + connector_setting: connector_setting.into(), + } + } + #[doc = "Delete a cloud account connector from a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `connector_name`: Name of the cloud account connector"] + pub fn delete(&self, subscription_id: impl Into, connector_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + connector_name: connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectorSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + pub(crate) connector_setting: models::ConnectorSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.connector_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/connectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2020-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod alerts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all the alerts that are associated with the subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "List all the alerts that are associated with the resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "List all the alerts that are associated with the subscription that are stored in a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + pub fn list_subscription_level_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + ) -> list_subscription_level_by_region::RequestBuilder { + list_subscription_level_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + } + } + #[doc = "List all the alerts that are associated with the resource group that are stored in a specific location"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_resource_group_level_by_region( + &self, + subscription_id: impl Into, + asc_location: impl Into, + resource_group_name: impl Into, + ) -> list_resource_group_level_by_region::RequestBuilder { + list_resource_group_level_by_region::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Get an alert that is associated with a subscription"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn get_subscription_level( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> get_subscription_level::RequestBuilder { + get_subscription_level::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Get an alert that is associated a resource group or a resource in a resource group"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn get_resource_group_level( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> get_resource_group_level::RequestBuilder { + get_resource_group_level::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_state_to_dismiss( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_state_to_dismiss::RequestBuilder { + update_subscription_level_state_to_dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_state_to_resolve( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_state_to_resolve::RequestBuilder { + update_subscription_level_state_to_resolve::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_state_to_activate( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_state_to_activate::RequestBuilder { + update_subscription_level_state_to_activate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_subscription_level_state_to_in_progress( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_subscription_level_state_to_in_progress::RequestBuilder { + update_subscription_level_state_to_in_progress::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_resource_group_level_state_to_resolve( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_resource_group_level_state_to_resolve::RequestBuilder { + update_resource_group_level_state_to_resolve::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_resource_group_level_state_to_dismiss( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_resource_group_level_state_to_dismiss::RequestBuilder { + update_resource_group_level_state_to_dismiss::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_resource_group_level_state_to_activate( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_resource_group_level_state_to_activate::RequestBuilder { + update_resource_group_level_state_to_activate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Update the alert's state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_name`: Name of the alert object"] + pub fn update_resource_group_level_state_to_in_progress( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + asc_location: impl Into, + alert_name: impl Into, + ) -> update_resource_group_level_state_to_in_progress::RequestBuilder { + update_resource_group_level_state_to_in_progress::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + asc_location: asc_location.into(), + alert_name: alert_name.into(), + } + } + #[doc = "Simulate security alerts"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `asc_location`: The location where ASC stores the data of the subscription. can be retrieved from Get locations"] + #[doc = "* `alert_simulator_request_body`: Alert Simulator Request Properties"] + pub fn simulate( + &self, + subscription_id: impl Into, + asc_location: impl Into, + alert_simulator_request_body: impl Into, + ) -> simulate::RequestBuilder { + simulate::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + asc_location: asc_location.into(), + alert_simulator_request_body: alert_simulator_request_body.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/alerts", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_subscription_level_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_resource_group_level_by_region { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::AlertList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get_subscription_level { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod get_resource_group_level { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Alert = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update_subscription_level_state_to_dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/dismiss", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_subscription_level_state_to_resolve { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/resolve", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_subscription_level_state_to_activate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/activate", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_subscription_level_state_to_in_progress { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/{}/inProgress", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_state_to_resolve { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/resolve", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_state_to_dismiss { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/dismiss", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_state_to_activate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/activate", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod update_resource_group_level_state_to_in_progress { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) asc_location: String, + pub(crate) alert_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/locations/{}/alerts/{}/inProgress", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.asc_location, + &this.alert_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod simulate { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) asc_location: String, + pub(crate) alert_simulator_request_body: models::AlertSimulatorRequestBody, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/locations/{}/alerts/default/simulate", + this.client.endpoint(), + &this.subscription_id, + &this.asc_location + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.alert_simulator_request_body)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings about different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings of different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: The name of the setting"] + pub fn get(&self, subscription_id: impl Into, setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + } + } + #[doc = "updating settings about different configurations in Microsoft Defender for Cloud"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `setting_name`: The name of the setting"] + #[doc = "* `setting`: Setting object"] + pub fn update( + &self, + subscription_id: impl Into, + setting_name: impl Into, + setting: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + setting_name: setting_name.into(), + setting: setting.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SettingsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Setting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Setting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) setting_name: String, + pub(crate) setting: models::Setting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/settings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-05-01"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod ingestion_settings { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Settings for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Settings for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn get(&self, subscription_id: impl Into, ingestion_setting_name: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Create setting for ingesting security data and logs to correlate with resources associated with the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + #[doc = "* `ingestion_setting`: Ingestion setting object"] + pub fn create( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ingestion_setting: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + ingestion_setting: ingestion_setting.into(), + } + } + #[doc = "Deletes the ingestion settings for this subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn delete(&self, subscription_id: impl Into, ingestion_setting_name: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Returns the token that is used for correlating ingested telemetry with the resources in the subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn list_tokens( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ) -> list_tokens::RequestBuilder { + list_tokens::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + #[doc = "Connection strings for ingesting security scan logs and data."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `ingestion_setting_name`: Name of the ingestion setting"] + pub fn list_connection_strings( + &self, + subscription_id: impl Into, + ingestion_setting_name: impl Into, + ) -> list_connection_strings::RequestBuilder { + list_connection_strings::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + ingestion_setting_name: ingestion_setting_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSetting = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + pub(crate) ingestion_setting: models::IngestionSetting, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.ingestion_setting)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list_tokens { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IngestionSettingToken = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}/listTokens", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list_connection_strings { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ConnectionStrings = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) ingestion_setting_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/ingestionSettings/{}/listConnectionStrings", + this.client.endpoint(), + &this.subscription_id, + &this.ingestion_setting_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-01-15-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod software_inventories { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the software inventory of the virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + pub fn list_by_extended_resource( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + ) -> list_by_extended_resource::RequestBuilder { + list_by_extended_resource::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + } + } + #[doc = "Gets the software inventory of all virtual machines in the subscriptions."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list_by_subscription(&self, subscription_id: impl Into) -> list_by_subscription::RequestBuilder { + list_by_subscription::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Gets a single software data of the virtual machine."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `resource_namespace`: The namespace of the resource."] + #[doc = "* `resource_type`: The type of the resource."] + #[doc = "* `resource_name`: Name of the resource."] + #[doc = "* `software_name`: Name of the installed software."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + resource_namespace: impl Into, + resource_type: impl Into, + resource_name: impl Into, + software_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + resource_namespace: resource_namespace.into(), + resource_type: resource_type.into(), + resource_name: resource_name.into(), + software_name: software_name.into(), + } + } + } + pub mod list_by_extended_resource { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SoftwaresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/softwareInventories", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_namespace, + &this.resource_type, + &this.resource_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_subscription { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SoftwaresList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/softwareInventories", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Software = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) resource_namespace: String, + pub(crate) resource_type: String, + pub(crate) resource_name: String, + pub(crate) software_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/{}/{}/{}/providers/Microsoft.Security/softwareInventories/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.resource_namespace, + &this.resource_type, + &this.resource_name, + &this.software_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2021-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod security_connectors { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + pub fn list_by_resource_group( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ) -> list_by_resource_group::RequestBuilder { + list_by_resource_group::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + } + } + #[doc = "Retrieves details of a specific security connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + #[doc = "Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `security_connector`: The security connector resource"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + security_connector: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + security_connector: security_connector.into(), + } + } + #[doc = "Updates a security connector"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `security_connector`: The security connector resource"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + security_connector: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + security_connector: security_connector.into(), + } + } + #[doc = "Deletes a security connector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/securityConnectors", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod list_by_resource_group { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnectorsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) security_connector: models::SecurityConnector, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_connector)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SecurityConnector = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) security_connector: models::SecurityConnector, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.security_connector)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name, + &this.security_connector_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-08-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod governance_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all relevant governance rules over a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + pub fn list(&self, scope: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + } + } + #[doc = "Get a specific governance rule for the requested scope by ruleId"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `rule_id`: The governance rule key - unique key for the standard governance rule (GUID)"] + pub fn get(&self, scope: impl Into, rule_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + rule_id: rule_id.into(), + } + } + #[doc = "Creates or updates a governance rule over a given scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `rule_id`: The governance rule key - unique key for the standard governance rule (GUID)"] + #[doc = "* `governance_rule`: Governance rule over a given scope"] + pub fn create_or_update( + &self, + scope: impl Into, + rule_id: impl Into, + governance_rule: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + rule_id: rule_id.into(), + governance_rule: governance_rule.into(), + } + } + #[doc = "Delete a Governance rule over a given scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `rule_id`: The governance rule key - unique key for the standard governance rule (GUID)"] + pub fn delete(&self, scope: impl Into, rule_id: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + rule_id: rule_id.into(), + } + } + #[doc = "Execute a governance rule"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `rule_id`: The governance rule key - unique key for the standard governance rule (GUID)"] + pub fn execute(&self, scope: impl Into, rule_id: impl Into) -> execute::RequestBuilder { + execute::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + rule_id: rule_id.into(), + execute_governance_rule_params: None, + } + } + #[doc = "Get governance rules long run operation result for the requested scope by ruleId and operationId"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `rule_id`: The governance rule key - unique key for the standard governance rule (GUID)"] + #[doc = "* `operation_id`: The governance rule long running operation unique key"] + pub fn operation_results( + &self, + scope: impl Into, + rule_id: impl Into, + operation_id: impl Into, + ) -> operation_results::RequestBuilder { + operation_results::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + rule_id: rule_id.into(), + operation_id: operation_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GovernanceRuleList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/governanceRules", + this.client.endpoint(), + &this.scope + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GovernanceRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) rule_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/governanceRules/{}", + this.client.endpoint(), + &this.scope, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GovernanceRule = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) rule_id: String, + pub(crate) governance_rule: models::GovernanceRule, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/governanceRules/{}", + this.client.endpoint(), + &this.scope, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.governance_rule)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) rule_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/governanceRules/{}", + this.client.endpoint(), + &this.scope, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod execute { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) rule_id: String, + pub(crate) execute_governance_rule_params: Option, + } + impl RequestBuilder { + #[doc = "Execute governance rule over a given scope"] + pub fn execute_governance_rule_params( + mut self, + execute_governance_rule_params: impl Into, + ) -> Self { + self.execute_governance_rule_params = Some(execute_governance_rule_params.into()); + self + } + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/governanceRules/{}/execute", + this.client.endpoint(), + &this.scope, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = if let Some(execute_governance_rule_params) = &this.execute_governance_rule_params { + req.insert_header("content-type", "application/json"); + azure_core::to_json(execute_governance_rule_params)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod operation_results { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OperationResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Location URL for the execution status"] + pub fn location(&self) -> azure_core::Result<&str> { + self.0.get_str(&azure_core::headers::HeaderName::from_static("location")) + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) rule_id: String, + pub(crate) operation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/governanceRules/{}/operationResults/{}", + this.client.endpoint(), + &this.scope, + &this.rule_id, + &this.operation_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod governance_assignments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get governance assignments on all of your resources inside a scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `assessment_name`: The Assessment Key - A unique key for the assessment type"] + pub fn list(&self, scope: impl Into, assessment_name: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + } + } + #[doc = "Get a specific governanceAssignment for the requested scope by AssignmentKey"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `assessment_name`: The Assessment Key - A unique key for the assessment type"] + #[doc = "* `assignment_key`: The governance assignment key - the assessment key of the required governance assignment"] + pub fn get( + &self, + scope: impl Into, + assessment_name: impl Into, + assignment_key: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + assignment_key: assignment_key.into(), + } + } + #[doc = "Creates or updates a governance assignment on the given subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `assessment_name`: The Assessment Key - A unique key for the assessment type"] + #[doc = "* `assignment_key`: The governance assignment key - the assessment key of the required governance assignment"] + #[doc = "* `governance_assignment`: Governance assignment over a subscription scope"] + pub fn create_or_update( + &self, + scope: impl Into, + assessment_name: impl Into, + assignment_key: impl Into, + governance_assignment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + assignment_key: assignment_key.into(), + governance_assignment: governance_assignment.into(), + } + } + #[doc = "Delete a GovernanceAssignment over a given scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scope`: The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] + #[doc = "* `assessment_name`: The Assessment Key - A unique key for the assessment type"] + #[doc = "* `assignment_key`: The governance assignment key - the assessment key of the required governance assignment"] + pub fn delete( + &self, + scope: impl Into, + assessment_name: impl Into, + assignment_key: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + scope: scope.into(), + assessment_name: assessment_name.into(), + assignment_key: assignment_key.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GovernanceAssignmentsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/governanceAssignments", + this.client.endpoint(), + &this.scope, + &this.assessment_name + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GovernanceAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + pub(crate) assignment_key: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/governanceAssignments/{}", + this.client.endpoint(), + &this.scope, + &this.assessment_name, + &this.assignment_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::GovernanceAssignment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + pub(crate) assignment_key: String, + pub(crate) governance_assignment: models::GovernanceAssignment, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/governanceAssignments/{}", + this.client.endpoint(), + &this.scope, + &this.assessment_name, + &this.assignment_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.governance_assignment)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scope: String, + pub(crate) assessment_name: String, + pub(crate) assignment_key: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/assessments/{}/governanceAssignments/{}", + this.client.endpoint(), + &this.scope, + &this.assessment_name, + &this.assignment_key + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-01-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod applications { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all relevant applications over a subscription level scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + pub fn list(&self, subscription_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApplicationsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applications", + this.client.endpoint(), + &this.subscription_id + ))?; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod application { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a specific application for the requested scope by applicationId"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `application_id`: The security Application key - unique key for the standard application"] + pub fn get(&self, subscription_id: impl Into, application_id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + application_id: application_id.into(), + } + } + #[doc = "Creates or update a security application on the given subscription."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `application_id`: The security Application key - unique key for the standard application"] + #[doc = "* `application`: Application over a subscription scope"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + application_id: impl Into, + application: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + application_id: application_id.into(), + application: application.into(), + } + } + #[doc = "Delete an Application over a given scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `application_id`: The security Application key - unique key for the standard application"] + pub fn delete(&self, subscription_id: impl Into, application_id: impl Into) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + application_id: application_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Application = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) application_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.application_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Application = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) application_id: String, + pub(crate) application: models::Application, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.application_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.application)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) application_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/providers/Microsoft.Security/applications/{}", + this.client.endpoint(), + &this.subscription_id, + &this.application_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod security_connector_applications { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all relevant applications over a security connector level scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ApplicationsList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod security_connector_application { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a specific application for the requested scope by applicationId"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `application_id`: The security Application key - unique key for the standard application"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + application_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + application_id: application_id.into(), + } + } + #[doc = "Creates or update a security Application on the given security connector."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `application_id`: The security Application key - unique key for the standard application"] + #[doc = "* `application`: Application over a subscription scope"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + application_id: impl Into, + application: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + application_id: application_id.into(), + application: application.into(), + } + } + #[doc = "Delete an Application over a given scope"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: Azure subscription ID"] + #[doc = "* `resource_group_name`: The name of the resource group within the user's subscription. The name is case insensitive."] + #[doc = "* `security_connector_name`: The security connector name."] + #[doc = "* `application_id`: The security Application key - unique key for the standard application"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + security_connector_name: impl Into, + application_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + security_connector_name: security_connector_name.into(), + application_id: application_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Application = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) application_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name , & this . application_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Application = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) application_id: String, + pub(crate) application: models::Application, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name , & this . application_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.application)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) security_connector_name: String, + pub(crate) application_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Security/securityConnectors/{}/providers/Microsoft.Security/applications/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . security_connector_name , & this . application_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2022-07-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod sql_vulnerability_assessment_scans { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the scan details of a single scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan record for the latest scan."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + scan_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets a list of scan records."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Scan = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}", + this.client.endpoint(), + &this.resource_id, + &this.scan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Scans = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_scan_results { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the scan results of a single rule in a scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] + #[doc = "* `scan_result_id`: The rule Id of the results."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + scan_id: impl Into, + scan_result_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + scan_result_id: scan_result_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets a list of scan results for a single scan record."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list( + &self, + scan_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scan_id: scan_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScanResult = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) scan_result_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults/{}", + this.client.endpoint(), + &this.resource_id, + &this.scan_id, + &this.scan_result_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ScanResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) scan_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults", + this.client.endpoint(), + &this.resource_id, + &this.scan_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod sql_vulnerability_assessment_baseline_rules { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the results for a given rule in the Baseline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn get( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Creates a Baseline for a rule in a database. Will overwrite any previously existing results."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn create_or_update( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + body: None, + } + } + #[doc = "Deletes a rule from the Baseline of a given database."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `rule_id`: The rule Id."] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn delete( + &self, + rule_id: impl Into, + workspace_id: impl Into, + resource_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + rule_id: rule_id.into(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Gets the results for all rules in the Baseline."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Add a list of baseline rules. Will overwrite any previously existing results (for all rules)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `workspace_id`: The workspace Id."] + #[doc = "* `resource_id`: The identifier of the resource."] + pub fn add(&self, workspace_id: impl Into, resource_id: impl Into) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + workspace_id: workspace_id.into(), + resource_id: resource_id.into(), + body: None, + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuleResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RuleResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + pub(crate) body: Option, + } + impl RequestBuilder { + #[doc = "The baseline results for this rule."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) rule_id: String, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", + this.client.endpoint(), + &this.resource_id, + &this.rule_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RulesResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod add { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RulesResults = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) workspace_id: String, + pub(crate) resource_id: String, + pub(crate) body: Option, + } + impl RequestBuilder { + #[doc = "The baseline rules."] + pub fn body(mut self, body: impl Into) -> Self { + self.body = Some(body.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", + this.client.endpoint(), + &this.resource_id + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); + let workspace_id = &this.workspace_id; + req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); + let req_body = if let Some(body) = &this.body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(body)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} diff --git a/services/mgmt/security/src/package_dotnet_sdk/models.rs b/services/mgmt/security/src/package_dotnet_sdk/models.rs new file mode 100644 index 0000000000..056f307b7b --- /dev/null +++ b/services/mgmt/security/src/package_dotnet_sdk/models.rs @@ -0,0 +1,11365 @@ +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::de::{value, Deserializer, IntoDeserializer}; +use serde::{Deserialize, Serialize, Serializer}; +use std::str::FromStr; +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadConnectivityState { + #[serde(rename = "connectivityState", default, skip_serializing_if = "Option::is_none")] + pub connectivity_state: Option, +} +impl AadConnectivityState { + pub fn new() -> Self { + Self::default() + } +} +pub mod aad_connectivity_state { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ConnectivityState")] + pub enum ConnectivityState { + Discovered, + NotLicensed, + Connected, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ConnectivityState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ConnectivityState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ConnectivityState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Discovered => serializer.serialize_unit_variant("ConnectivityState", 0u32, "Discovered"), + Self::NotLicensed => serializer.serialize_unit_variant("ConnectivityState", 1u32, "NotLicensed"), + Self::Connected => serializer.serialize_unit_variant("ConnectivityState", 2u32, "Connected"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents an AAD identity protection solution which sends logs to an OMS workspace."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AadExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AadExternalSecuritySolution { + pub fn new(external_security_solution: ExternalSecuritySolution) -> Self { + Self { + external_security_solution, + properties: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AadSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(flatten)] + pub aad_connectivity_state: AadConnectivityState, +} +impl AadSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of active connections is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ActiveConnectionsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl ActiveConnectionsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdaptiveApplicationControlGroup { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[doc = "Represents a machines group and set of rules to be allowed running on a machine"] + pub properties: AdaptiveApplicationControlGroupData, +} +impl AdaptiveApplicationControlGroup { + pub fn new(properties: AdaptiveApplicationControlGroupData) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[doc = "Represents a machines group and set of rules to be allowed running on a machine"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveApplicationControlGroupData { + #[doc = "The application control policy enforcement/protection mode of the machine group"] + #[serde(rename = "enforcementMode", default, skip_serializing_if = "Option::is_none")] + pub enforcement_mode: Option, + #[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] + #[serde(rename = "protectionMode", default, skip_serializing_if = "Option::is_none")] + pub protection_mode: Option, + #[doc = "The configuration status of the machines group or machine or rule"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, + #[doc = "The initial recommendation status of the machine group or machine"] + #[serde(rename = "recommendationStatus", default, skip_serializing_if = "Option::is_none")] + pub recommendation_status: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issues: Option, + #[doc = "The source type of the machine group"] + #[serde(rename = "sourceSystem", default, skip_serializing_if = "Option::is_none")] + pub source_system: Option, + #[serde(rename = "vmRecommendations", default, skip_serializing_if = "Option::is_none")] + pub vm_recommendations: Option, + #[serde(rename = "pathRecommendations", default, skip_serializing_if = "Option::is_none")] + pub path_recommendations: Option, +} +impl AdaptiveApplicationControlGroupData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveApplicationControlGroups { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl AdaptiveApplicationControlGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An alert that machines within a group can have"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum AdaptiveApplicationControlIssue { + ViolationsAudited, + ViolationsBlocked, + MsiAndScriptViolationsAudited, + MsiAndScriptViolationsBlocked, + ExecutableViolationsAudited, + RulesViolatedManually, +} +#[doc = "Represents a summary of the alerts of the machine group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveApplicationControlIssueSummary { + #[doc = "An alert that machines within a group can have"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issue: Option, + #[doc = "The number of machines in the group that have this alert"] + #[serde(rename = "numberOfVms", default, skip_serializing_if = "Option::is_none")] + pub number_of_vms: Option, +} +impl AdaptiveApplicationControlIssueSummary { + pub fn new() -> Self { + Self::default() + } +} +pub type AdaptiveApplicationControlIssuesSummaries = Vec; +#[doc = "The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardening { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Adaptive Network Hardening resource properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AdaptiveNetworkHardening { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdaptiveNetworkHardeningEnforceRequest { + #[doc = "The rules to enforce"] + pub rules: Vec, + #[doc = "The Azure resource IDs of the effective network security groups that will be updated with the created security rules from the Adaptive Network Hardening rules"] + #[serde(rename = "networkSecurityGroups")] + pub network_security_groups: Vec, +} +impl AdaptiveNetworkHardeningEnforceRequest { + pub fn new(rules: Vec, network_security_groups: Vec) -> Self { + Self { + rules, + network_security_groups, + } + } +} +#[doc = "Adaptive Network Hardening resource properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardeningProperties { + #[doc = "The security rules which are recommended to be effective on the VM"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, + #[doc = "The UTC time on which the rules were calculated"] + #[serde(rename = "rulesCalculationTime", default, with = "azure_core::date::rfc3339::option")] + pub rules_calculation_time: Option, + #[doc = "The Network Security Groups effective on the network interfaces of the protected resource"] + #[serde( + rename = "effectiveNetworkSecurityGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub effective_network_security_groups: Vec, +} +impl AdaptiveNetworkHardeningProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Response for ListAdaptiveNetworkHardenings API service call"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdaptiveNetworkHardeningsList { + #[doc = "A list of Adaptive Network Hardenings resources"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URL to get the next set of results"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AdaptiveNetworkHardeningsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AdaptiveNetworkHardeningsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of the sub-assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AdditionalData { + #[doc = "Sub-assessment resource type"] + #[serde(rename = "assessedResourceType")] + pub assessed_resource_type: additional_data::AssessedResourceType, +} +impl AdditionalData { + pub fn new(assessed_resource_type: additional_data::AssessedResourceType) -> Self { + Self { assessed_resource_type } + } +} +pub mod additional_data { + use super::*; + #[doc = "Sub-assessment resource type"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AssessedResourceType")] + pub enum AssessedResourceType { + SqlServerVulnerability, + ContainerRegistryVulnerability, + ServerVulnerability, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AssessedResourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AssessedResourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AssessedResourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SqlServerVulnerability => serializer.serialize_unit_variant("AssessedResourceType", 0u32, "SqlServerVulnerability"), + Self::ContainerRegistryVulnerability => { + serializer.serialize_unit_variant("AssessedResourceType", 1u32, "ContainerRegistryVulnerability") + } + Self::ServerVulnerability => serializer.serialize_unit_variant("AssessedResourceType", 2u32, "ServerVulnerability"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Properties of the additional workspaces."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdditionalWorkspacesProperties { + #[doc = "Workspace resource id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option, + #[doc = "Workspace type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "List of data types sent to workspace"] + #[serde( + rename = "dataTypes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub data_types: Vec, +} +impl AdditionalWorkspacesProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod additional_workspaces_properties { + use super::*; + #[doc = "Workspace type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Sentinel, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Sentinel => serializer.serialize_unit_variant("Type", 0u32, "Sentinel"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Type { + fn default() -> Self { + Self::Sentinel + } + } +} +#[doc = "The Advanced Threat Protection settings."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdvancedThreatProtectionProperties { + #[doc = "Indicates whether Advanced Threat Protection is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option, +} +impl AdvancedThreatProtectionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Advanced Threat Protection resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AdvancedThreatProtectionSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The Advanced Threat Protection settings."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AdvancedThreatProtectionSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security alert"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Alert { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes security alert properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Alert { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties depending on the entity type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertEntity { + #[doc = "Type of entity"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl AlertEntity { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Links related to the alert"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertExtendedLinks {} +impl AlertExtendedLinks { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Custom properties for the alert."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertExtendedProperties {} +impl AlertExtendedProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security alerts"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertList { + #[doc = "describes security alert properties."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AlertList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AlertList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes security alert properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertProperties { + #[doc = "Schema version."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Unique identifier for the detection logic (all alert instances from the same detection logic will have the same alertType)."] + #[serde(rename = "alertType", default, skip_serializing_if = "Option::is_none")] + pub alert_type: Option, + #[doc = "Unique identifier for the alert."] + #[serde(rename = "systemAlertId", default, skip_serializing_if = "Option::is_none")] + pub system_alert_id: Option, + #[doc = "The name of Azure Security Center pricing tier which powering this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing"] + #[serde(rename = "productComponentName", default, skip_serializing_if = "Option::is_none")] + pub product_component_name: Option, + #[doc = "The display name of the alert."] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "Description of the suspicious activity that was detected."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The risk level of the threat that was detected. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub intent: Option, + #[doc = "The UTC time of the first event or activity included in the alert in ISO8601 format."] + #[serde(rename = "startTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub start_time_utc: Option, + #[doc = "The UTC time of the last event or activity included in the alert in ISO8601 format."] + #[serde(rename = "endTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub end_time_utc: Option, + #[doc = "The resource identifiers that can be used to direct the alert to the right product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different type per alert."] + #[serde( + rename = "resourceIdentifiers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub resource_identifiers: Vec, + #[doc = "Manual action items to take to remediate the alert."] + #[serde( + rename = "remediationSteps", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub remediation_steps: Vec, + #[doc = "The name of the vendor that raises the alert."] + #[serde(rename = "vendorName", default, skip_serializing_if = "Option::is_none")] + pub vendor_name: Option, + #[doc = "The life cycle status of the alert."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Links related to the alert"] + #[serde( + rename = "extendedLinks", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub extended_links: Vec, + #[doc = "A direct link to the alert page in Azure Portal."] + #[serde(rename = "alertUri", default, skip_serializing_if = "Option::is_none")] + pub alert_uri: Option, + #[doc = "The UTC time the alert was generated in ISO8601 format."] + #[serde(rename = "timeGeneratedUtc", default, with = "azure_core::date::rfc3339::option")] + pub time_generated_utc: Option, + #[doc = "The name of the product which published this alert (Microsoft Sentinel, Microsoft Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for Cloud Apps, and so on)."] + #[serde(rename = "productName", default, skip_serializing_if = "Option::is_none")] + pub product_name: Option, + #[doc = "The UTC processing end time of the alert in ISO8601 format."] + #[serde(rename = "processingEndTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub processing_end_time_utc: Option, + #[doc = "A list of entities related to the alert."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub entities: Vec, + #[doc = "This field determines whether the alert is an incident (a compound grouping of several alerts) or a single alert."] + #[serde(rename = "isIncident", default, skip_serializing_if = "Option::is_none")] + pub is_incident: Option, + #[doc = "Key for corelating related alerts. Alerts with the same correlation key considered to be related."] + #[serde(rename = "correlationKey", default, skip_serializing_if = "Option::is_none")] + pub correlation_key: Option, + #[doc = "Custom properties for the alert."] + #[serde(rename = "extendedProperties", default, skip_serializing_if = "Option::is_none")] + pub extended_properties: Option, + #[doc = "The display name of the resource most related to this alert."] + #[serde(rename = "compromisedEntity", default, skip_serializing_if = "Option::is_none")] + pub compromised_entity: Option, + #[doc = "kill chain related techniques behind the alert."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub techniques: Vec, + #[doc = "Kill chain related sub-techniques behind the alert."] + #[serde( + rename = "subTechniques", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub sub_techniques: Vec, + #[doc = "Changing set of properties depending on the supportingEvidence type."] + #[serde(rename = "supportingEvidence", default, skip_serializing_if = "Option::is_none")] + pub supporting_evidence: Option, +} +impl AlertProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod alert_properties { + use super::*; + #[doc = "The risk level of the threat that was detected. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("Severity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("Severity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("Severity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("Severity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Intent")] + pub enum Intent { + Unknown, + PreAttack, + InitialAccess, + Persistence, + PrivilegeEscalation, + DefenseEvasion, + CredentialAccess, + Discovery, + LateralMovement, + Execution, + Collection, + Exfiltration, + CommandAndControl, + Impact, + Probing, + Exploitation, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Intent { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Intent { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Intent { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Unknown => serializer.serialize_unit_variant("Intent", 0u32, "Unknown"), + Self::PreAttack => serializer.serialize_unit_variant("Intent", 1u32, "PreAttack"), + Self::InitialAccess => serializer.serialize_unit_variant("Intent", 2u32, "InitialAccess"), + Self::Persistence => serializer.serialize_unit_variant("Intent", 3u32, "Persistence"), + Self::PrivilegeEscalation => serializer.serialize_unit_variant("Intent", 4u32, "PrivilegeEscalation"), + Self::DefenseEvasion => serializer.serialize_unit_variant("Intent", 5u32, "DefenseEvasion"), + Self::CredentialAccess => serializer.serialize_unit_variant("Intent", 6u32, "CredentialAccess"), + Self::Discovery => serializer.serialize_unit_variant("Intent", 7u32, "Discovery"), + Self::LateralMovement => serializer.serialize_unit_variant("Intent", 8u32, "LateralMovement"), + Self::Execution => serializer.serialize_unit_variant("Intent", 9u32, "Execution"), + Self::Collection => serializer.serialize_unit_variant("Intent", 10u32, "Collection"), + Self::Exfiltration => serializer.serialize_unit_variant("Intent", 11u32, "Exfiltration"), + Self::CommandAndControl => serializer.serialize_unit_variant("Intent", 12u32, "CommandAndControl"), + Self::Impact => serializer.serialize_unit_variant("Intent", 13u32, "Impact"), + Self::Probing => serializer.serialize_unit_variant("Intent", 14u32, "Probing"), + Self::Exploitation => serializer.serialize_unit_variant("Intent", 15u32, "Exploitation"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The life cycle status of the alert."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Active, + InProgress, + Resolved, + Dismissed, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Active => serializer.serialize_unit_variant("Status", 0u32, "Active"), + Self::InProgress => serializer.serialize_unit_variant("Status", 1u32, "InProgress"), + Self::Resolved => serializer.serialize_unit_variant("Status", 2u32, "Resolved"), + Self::Dismissed => serializer.serialize_unit_variant("Status", 3u32, "Dismissed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Changing set of properties depending on the supportingEvidence type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SupportingEvidence { + #[doc = "Type of the supportingEvidence"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SupportingEvidence { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "Simulate alerts according to this bundles."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertSimulatorBundlesRequestProperties { + #[serde(flatten)] + pub alert_simulator_request_properties: AlertSimulatorRequestProperties, + #[doc = "Bundles list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub bundles: Vec, +} +impl AlertSimulatorBundlesRequestProperties { + pub fn new(alert_simulator_request_properties: AlertSimulatorRequestProperties) -> Self { + Self { + alert_simulator_request_properties, + bundles: Vec::new(), + } + } +} +#[doc = "Alert Simulator request body."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertSimulatorRequestBody { + #[doc = "Describes properties of an alert simulation request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AlertSimulatorRequestBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of an alert simulation request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertSimulatorRequestProperties { + #[doc = "The kind of alert simulation."] + pub kind: alert_simulator_request_properties::Kind, +} +impl AlertSimulatorRequestProperties { + pub fn new(kind: alert_simulator_request_properties::Kind) -> Self { + Self { kind } + } +} +pub mod alert_simulator_request_properties { + use super::*; + #[doc = "The kind of alert simulation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + Bundles, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Bundles => serializer.serialize_unit_variant("Kind", 0u32, "Bundles"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The alert sync setting properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertSyncSettingProperties { + #[doc = "Is the alert sync setting enabled"] + pub enabled: bool, +} +impl AlertSyncSettingProperties { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +#[doc = "Represents an alert sync setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertSyncSettings { + #[serde(flatten)] + pub setting: Setting, + #[doc = "The alert sync setting properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AlertSyncSettings { + pub fn new(setting: Setting) -> Self { + Self { setting, properties: None } + } +} +#[doc = "Describes the suppression rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AlertsSuppressionRule { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes AlertsSuppressionRule properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AlertsSuppressionRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes AlertsSuppressionRule properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertsSuppressionRuleProperties { + #[doc = "Type of the alert to automatically suppress. For all alert types, use '*'"] + #[serde(rename = "alertType")] + pub alert_type: String, + #[doc = "The last time this rule was modified"] + #[serde(rename = "lastModifiedUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_utc: Option, + #[doc = "Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date."] + #[serde(rename = "expirationDateUtc", default, with = "azure_core::date::rfc3339::option")] + pub expiration_date_utc: Option, + #[doc = "The reason for dismissing the alert"] + pub reason: String, + #[doc = "Possible states of the rule"] + pub state: alerts_suppression_rule_properties::State, + #[doc = "Any comment regarding the rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comment: Option, + #[serde(rename = "suppressionAlertsScope", default, skip_serializing_if = "Option::is_none")] + pub suppression_alerts_scope: Option, +} +impl AlertsSuppressionRuleProperties { + pub fn new(alert_type: String, reason: String, state: alerts_suppression_rule_properties::State) -> Self { + Self { + alert_type, + last_modified_utc: None, + expiration_date_utc: None, + reason, + state, + comment: None, + suppression_alerts_scope: None, + } + } +} +pub mod alerts_suppression_rule_properties { + use super::*; + #[doc = "Possible states of the rule"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum State { + Enabled, + Disabled, + Expired, + } +} +#[doc = "Suppression rules list for subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AlertsSuppressionRulesList { + pub value: Vec, + #[doc = "URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AlertsSuppressionRulesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AlertsSuppressionRulesList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "List of all possible traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AllowedConnectionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AllowedConnectionsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The resource whose properties describes the allowed traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[doc = "Describes the allowed traffic between Azure resources"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AllowedConnectionsResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the allowed traffic between Azure resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AllowedConnectionsResourceProperties { + #[doc = "The UTC time on which the allowed connections resource was calculated"] + #[serde(rename = "calculatedDateTime", default, with = "azure_core::date::rfc3339::option")] + pub calculated_date_time: Option, + #[doc = "List of connectable resources"] + #[serde( + rename = "connectableResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub connectable_resources: Vec, +} +impl AllowedConnectionsResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is allowed."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AllowlistCustomAlertRule { + #[serde(flatten)] + pub list_custom_alert_rule: ListCustomAlertRule, + #[doc = "The values to allow. The format of the values depends on the rule type."] + #[serde(rename = "allowlistValues")] + pub allowlist_values: Vec, +} +impl AllowlistCustomAlertRule { + pub fn new(list_custom_alert_rule: ListCustomAlertRule, allowlist_values: Vec) -> Self { + Self { + list_custom_alert_rule, + allowlist_values, + } + } +} +#[doc = "Number of cloud to device messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (AMQP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AmqpD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl AmqpD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Security Application over a given scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Application { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an application"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Application { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Application's condition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationCondition { + #[doc = "The application Condition's Property, e.g. ID, see examples"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub property: Option, + #[doc = "The application Condition's Value like IDs that contain some string, see examples"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The application Condition's Operator, for example Contains for id or In for list of possible IDs, see examples"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, +} +impl ApplicationCondition { + pub fn new() -> Self { + Self::default() + } +} +pub mod application_condition { + use super::*; + #[doc = "The application Condition's Operator, for example Contains for id or In for list of possible IDs, see examples"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + Contains, + Equals, + In, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Contains => serializer.serialize_unit_variant("Operator", 0u32, "Contains"), + Self::Equals => serializer.serialize_unit_variant("Operator", 1u32, "Equals"), + Self::In => serializer.serialize_unit_variant("Operator", 2u32, "In"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of application's condition sets - OR between ConditionSets, AND between conditions in a set"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationConditionSets {} +impl ApplicationConditionSets { + pub fn new() -> Self { + Self::default() + } +} +pub type ApplicationConditions = Vec; +#[doc = "Describes properties of an application"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApplicationProperties { + #[doc = "display name of the application"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "description of the application"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The application source, what it affects, e.g. Assessments"] + #[serde(rename = "sourceResourceType")] + pub source_resource_type: application_properties::SourceResourceType, + #[doc = "The application conditionSets - see examples"] + #[serde(rename = "conditionSets")] + pub condition_sets: Vec, +} +impl ApplicationProperties { + pub fn new(source_resource_type: application_properties::SourceResourceType, condition_sets: Vec) -> Self { + Self { + display_name: None, + description: None, + source_resource_type, + condition_sets, + } + } +} +pub mod application_properties { + use super::*; + #[doc = "The application source, what it affects, e.g. Assessments"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SourceResourceType")] + pub enum SourceResourceType { + Assessments, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SourceResourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SourceResourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SourceResourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Assessments => serializer.serialize_unit_variant("SourceResourceType", 0u32, "Assessments"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Page of a security applications list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ApplicationsList { + #[doc = "Collection of applications in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ApplicationsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ApplicationsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The ASC location of the subscription is in the \"name\" field"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "An empty set of properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AscLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of locations where ASC saves your data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocationList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AscLocationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AscLocationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "An empty set of properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AscLocationProperties {} +impl AscLocationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Links relevant to the assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AssessmentLinks { + #[doc = "Link to assessment in Azure Portal"] + #[serde(rename = "azurePortalUri", default, skip_serializing_if = "Option::is_none")] + pub azure_portal_uri: Option, +} +impl AssessmentLinks { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The result of the assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssessmentStatus { + #[doc = "Programmatic code for the status of the assessment"] + pub code: assessment_status::Code, + #[doc = "Programmatic code for the cause of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cause: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl AssessmentStatus { + pub fn new(code: assessment_status::Code) -> Self { + Self { + code, + cause: None, + description: None, + } + } +} +pub mod assessment_status { + use super::*; + #[doc = "Programmatic code for the status of the assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Code")] + pub enum Code { + Healthy, + Unhealthy, + NotApplicable, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Code { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Code { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Code { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Healthy => serializer.serialize_unit_variant("Code", 0u32, "Healthy"), + Self::Unhealthy => serializer.serialize_unit_variant("Code", 1u32, "Unhealthy"), + Self::NotApplicable => serializer.serialize_unit_variant("Code", 2u32, "NotApplicable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The result of the assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssessmentStatusResponse { + #[serde(flatten)] + pub assessment_status: AssessmentStatus, + #[doc = "The time that the assessment was created and first evaluated. Returned as UTC time in ISO 8601 format"] + #[serde(rename = "firstEvaluationDate", default, with = "azure_core::date::rfc3339::option")] + pub first_evaluation_date: Option, + #[doc = "The time that the status of the assessment last changed. Returned as UTC time in ISO 8601 format"] + #[serde(rename = "statusChangeDate", default, with = "azure_core::date::rfc3339::option")] + pub status_change_date: Option, +} +impl AssessmentStatusResponse { + pub fn new(assessment_status: AssessmentStatus) -> Self { + Self { + assessment_status, + first_evaluation_date: None, + status_change_date: None, + } + } +} +#[doc = "Represents an ATA security solution which sends logs to an OMS workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AtaExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AtaExternalSecuritySolution { + pub fn new(external_security_solution: ExternalSecuritySolution) -> Self { + Self { + external_security_solution, + properties: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AtaSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(rename = "lastEventReceived", default, skip_serializing_if = "Option::is_none")] + pub last_event_received: Option, +} +impl AtaSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Settings for cloud authentication management"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationDetailsProperties { + #[doc = "State of the multi-cloud connector"] + #[serde(rename = "authenticationProvisioningState", default, skip_serializing_if = "Option::is_none")] + pub authentication_provisioning_state: Option, + #[doc = "The permissions detected in the cloud account."] + #[serde( + rename = "grantedPermissions", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub granted_permissions: Vec, + #[doc = "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials."] + #[serde(rename = "authenticationType")] + pub authentication_type: authentication_details_properties::AuthenticationType, +} +impl AuthenticationDetailsProperties { + pub fn new(authentication_type: authentication_details_properties::AuthenticationType) -> Self { + Self { + authentication_provisioning_state: None, + granted_permissions: Vec::new(), + authentication_type, + } + } +} +pub mod authentication_details_properties { + use super::*; + #[doc = "State of the multi-cloud connector"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthenticationProvisioningState")] + pub enum AuthenticationProvisioningState { + Valid, + Invalid, + Expired, + IncorrectPolicy, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AuthenticationProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthenticationProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthenticationProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("AuthenticationProvisioningState", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("AuthenticationProvisioningState", 1u32, "Invalid"), + Self::Expired => serializer.serialize_unit_variant("AuthenticationProvisioningState", 2u32, "Expired"), + Self::IncorrectPolicy => serializer.serialize_unit_variant("AuthenticationProvisioningState", 3u32, "IncorrectPolicy"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AuthenticationType")] + pub enum AuthenticationType { + #[serde(rename = "awsCreds")] + AwsCreds, + #[serde(rename = "awsAssumeRole")] + AwsAssumeRole, + #[serde(rename = "gcpCredentials")] + GcpCredentials, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AuthenticationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AuthenticationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AuthenticationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsCreds => serializer.serialize_unit_variant("AuthenticationType", 0u32, "awsCreds"), + Self::AwsAssumeRole => serializer.serialize_unit_variant("AuthenticationType", 1u32, "awsAssumeRole"), + Self::GcpCredentials => serializer.serialize_unit_variant("AuthenticationType", 2u32, "gcpCredentials"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Auto provisioning setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoProvisioningSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of an auto provisioning setting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl AutoProvisioningSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of all the auto provisioning settings response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutoProvisioningSettingList { + #[doc = "List of all the auto provisioning settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AutoProvisioningSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AutoProvisioningSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of an auto provisioning setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutoProvisioningSettingProperties { + #[doc = "Describes what kind of security agent provisioning action to take"] + #[serde(rename = "autoProvision")] + pub auto_provision: auto_provisioning_setting_properties::AutoProvision, +} +impl AutoProvisioningSettingProperties { + pub fn new(auto_provision: auto_provisioning_setting_properties::AutoProvision) -> Self { + Self { auto_provision } + } +} +pub mod auto_provisioning_setting_properties { + use super::*; + #[doc = "Describes what kind of security agent provisioning action to take"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoProvision")] + pub enum AutoProvision { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoProvision { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoProvision { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoProvision { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("AutoProvision", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("AutoProvision", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The security automation resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Automation { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "A set of properties that defines the behavior of the automation configuration. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Automation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The action that should be triggered."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationAction { + #[doc = "The type of the action that will be triggered by the Automation"] + #[serde(rename = "actionType")] + pub action_type: automation_action::ActionType, +} +impl AutomationAction { + pub fn new(action_type: automation_action::ActionType) -> Self { + Self { action_type } + } +} +pub mod automation_action { + use super::*; + #[doc = "The type of the action that will be triggered by the Automation"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ActionType")] + pub enum ActionType { + LogicApp, + EventHub, + Workspace, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ActionType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ActionType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ActionType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::LogicApp => serializer.serialize_unit_variant("ActionType", 0u32, "LogicApp"), + Self::EventHub => serializer.serialize_unit_variant("ActionType", 1u32, "EventHub"), + Self::Workspace => serializer.serialize_unit_variant("ActionType", 2u32, "Workspace"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionEventHub { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The target Event Hub Azure Resource ID."] + #[serde(rename = "eventHubResourceId", default, skip_serializing_if = "Option::is_none")] + pub event_hub_resource_id: Option, + #[doc = "The target Event Hub SAS policy name."] + #[serde(rename = "sasPolicyName", default, skip_serializing_if = "Option::is_none")] + pub sas_policy_name: Option, + #[doc = "The target Event Hub connection string (it will not be included in any response)."] + #[serde(rename = "connectionString", default, skip_serializing_if = "Option::is_none")] + pub connection_string: Option, +} +impl AutomationActionEventHub { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + event_hub_resource_id: None, + sas_policy_name: None, + connection_string: None, + } + } +} +#[doc = "The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionLogicApp { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App"] + #[serde(rename = "logicAppResourceId", default, skip_serializing_if = "Option::is_none")] + pub logic_app_resource_id: Option, + #[doc = "The Logic App trigger URI endpoint (it will not be included in any response)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uri: Option, +} +impl AutomationActionLogicApp { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + logic_app_resource_id: None, + uri: None, + } + } +} +#[doc = "The\u{a0}Log\u{a0}Analytics\u{a0}Workspace\u{a0}to\u{a0}which\u{a0}event data will be exported. Security alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationActionWorkspace { + #[serde(flatten)] + pub automation_action: AutomationAction, + #[doc = "The fully qualified Log Analytics Workspace Azure Resource ID."] + #[serde(rename = "workspaceResourceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_resource_id: Option, +} +impl AutomationActionWorkspace { + pub fn new(automation_action: AutomationAction) -> Self { + Self { + automation_action, + workspace_resource_id: None, + } + } +} +#[doc = "List of security automations response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationList { + #[doc = "The list of security automations under the given scope."] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for AutomationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl AutomationList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "A set of properties that defines the behavior of the automation configuration. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationProperties { + #[doc = "The security automation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Indicates whether the security automation is enabled."] + #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")] + pub is_enabled: Option, + #[doc = "A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub scopes: Vec, + #[doc = "A collection of the source event types which evaluate the security automation set of rules."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub sources: Vec, + #[doc = "A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub actions: Vec, +} +impl AutomationProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationRuleSet { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rules: Vec, +} +impl AutomationRuleSet { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A single automation scope."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationScope { + #[doc = "The resources scope description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs)."] + #[serde(rename = "scopePath", default, skip_serializing_if = "Option::is_none")] + pub scope_path: Option, +} +impl AutomationScope { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The source event types which evaluate the security automation set of rules. For example - security alerts and security assessments. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationSource { + #[doc = "A valid event source type."] + #[serde(rename = "eventSource", default, skip_serializing_if = "Option::is_none")] + pub event_source: Option, + #[doc = "A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or')."] + #[serde( + rename = "ruleSets", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub rule_sets: Vec, +} +impl AutomationSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod automation_source { + use super::*; + #[doc = "A valid event source type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EventSource")] + pub enum EventSource { + Assessments, + AssessmentsSnapshot, + SubAssessments, + SubAssessmentsSnapshot, + Alerts, + SecureScores, + SecureScoresSnapshot, + SecureScoreControls, + SecureScoreControlsSnapshot, + RegulatoryComplianceAssessment, + RegulatoryComplianceAssessmentSnapshot, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EventSource { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EventSource { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EventSource { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Assessments => serializer.serialize_unit_variant("EventSource", 0u32, "Assessments"), + Self::AssessmentsSnapshot => serializer.serialize_unit_variant("EventSource", 1u32, "AssessmentsSnapshot"), + Self::SubAssessments => serializer.serialize_unit_variant("EventSource", 2u32, "SubAssessments"), + Self::SubAssessmentsSnapshot => serializer.serialize_unit_variant("EventSource", 3u32, "SubAssessmentsSnapshot"), + Self::Alerts => serializer.serialize_unit_variant("EventSource", 4u32, "Alerts"), + Self::SecureScores => serializer.serialize_unit_variant("EventSource", 5u32, "SecureScores"), + Self::SecureScoresSnapshot => serializer.serialize_unit_variant("EventSource", 6u32, "SecureScoresSnapshot"), + Self::SecureScoreControls => serializer.serialize_unit_variant("EventSource", 7u32, "SecureScoreControls"), + Self::SecureScoreControlsSnapshot => serializer.serialize_unit_variant("EventSource", 8u32, "SecureScoreControlsSnapshot"), + Self::RegulatoryComplianceAssessment => { + serializer.serialize_unit_variant("EventSource", 9u32, "RegulatoryComplianceAssessment") + } + Self::RegulatoryComplianceAssessmentSnapshot => { + serializer.serialize_unit_variant("EventSource", 10u32, "RegulatoryComplianceAssessmentSnapshot") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the event model to an expected value. This comparison is done by using one of the supported operators set."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationTriggeringRule { + #[doc = "The JPath of the entity model property that should be checked."] + #[serde(rename = "propertyJPath", default, skip_serializing_if = "Option::is_none")] + pub property_j_path: Option, + #[doc = "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]"] + #[serde(rename = "propertyType", default, skip_serializing_if = "Option::is_none")] + pub property_type: Option, + #[doc = "The expected value."] + #[serde(rename = "expectedValue", default, skip_serializing_if = "Option::is_none")] + pub expected_value: Option, + #[doc = "A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, +} +impl AutomationTriggeringRule { + pub fn new() -> Self { + Self::default() + } +} +pub mod automation_triggering_rule { + use super::*; + #[doc = "The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PropertyType")] + pub enum PropertyType { + String, + Integer, + Number, + Boolean, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PropertyType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PropertyType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PropertyType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::String => serializer.serialize_unit_variant("PropertyType", 0u32, "String"), + Self::Integer => serializer.serialize_unit_variant("PropertyType", 1u32, "Integer"), + Self::Number => serializer.serialize_unit_variant("PropertyType", 2u32, "Number"), + Self::Boolean => serializer.serialize_unit_variant("PropertyType", 3u32, "Boolean"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + Equals, + GreaterThan, + GreaterThanOrEqualTo, + LesserThan, + LesserThanOrEqualTo, + NotEquals, + Contains, + StartsWith, + EndsWith, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Equals => serializer.serialize_unit_variant("Operator", 0u32, "Equals"), + Self::GreaterThan => serializer.serialize_unit_variant("Operator", 1u32, "GreaterThan"), + Self::GreaterThanOrEqualTo => serializer.serialize_unit_variant("Operator", 2u32, "GreaterThanOrEqualTo"), + Self::LesserThan => serializer.serialize_unit_variant("Operator", 3u32, "LesserThan"), + Self::LesserThanOrEqualTo => serializer.serialize_unit_variant("Operator", 4u32, "LesserThanOrEqualTo"), + Self::NotEquals => serializer.serialize_unit_variant("Operator", 5u32, "NotEquals"), + Self::Contains => serializer.serialize_unit_variant("Operator", 6u32, "Contains"), + Self::StartsWith => serializer.serialize_unit_variant("Operator", 7u32, "StartsWith"), + Self::EndsWith => serializer.serialize_unit_variant("Operator", 8u32, "EndsWith"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The security automation model state property bag."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AutomationValidationStatus { + #[doc = "Indicates whether the model is valid or not."] + #[serde(rename = "isValid", default, skip_serializing_if = "Option::is_none")] + pub is_valid: Option, + #[doc = "The validation message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} +impl AutomationValidationStatus { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "AWS cloud account connector based assume role, the role enables delegating access to your AWS resources. The role is composed of role Amazon Resource Name (ARN) and external ID. For more details, refer to Creating a Role to Delegate Permissions to an IAM User (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwAssumeRoleAuthenticationDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The ID of the cloud account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "Assumed role ID is an identifier that you can use to create temporary security credentials."] + #[serde(rename = "awsAssumeRoleArn")] + pub aws_assume_role_arn: String, + #[doc = "A unique identifier that is required when you assume a role in another account."] + #[serde(rename = "awsExternalId")] + pub aws_external_id: String, +} +impl AwAssumeRoleAuthenticationDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + aws_assume_role_arn: String, + aws_external_id: String, + ) -> Self { + Self { + authentication_details_properties, + account_id: None, + aws_assume_role_arn, + aws_external_id, + } + } +} +#[doc = "AWS cloud account connector based credentials, the credentials is composed of access key ID and secret key, for more details, refer to Creating an IAM User in Your AWS Account (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsCredsAuthenticationDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The ID of the cloud account"] + #[serde(rename = "accountId", default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[doc = "Public key element of the AWS credential object (write only)"] + #[serde(rename = "awsAccessKeyId")] + pub aws_access_key_id: String, + #[doc = "Secret key element of the AWS credential object (write only)"] + #[serde(rename = "awsSecretAccessKey")] + pub aws_secret_access_key: String, +} +impl AwsCredsAuthenticationDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + aws_access_key_id: String, + aws_secret_access_key: String, + ) -> Self { + Self { + authentication_details_properties, + account_id: None, + aws_access_key_id, + aws_secret_access_key, + } + } +} +#[doc = "The aws connector environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, + #[doc = "The awsOrganization data "] + #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] + pub organizational_data: Option, +} +impl AwsEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { + environment_data, + organizational_data: None, + } + } +} +#[doc = "The awsOrganization data "] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalData { + #[doc = "The multi cloud account's membership type in the organization"] + #[serde(rename = "organizationMembershipType")] + pub organization_membership_type: aws_organizational_data::OrganizationMembershipType, +} +impl AwsOrganizationalData { + pub fn new(organization_membership_type: aws_organizational_data::OrganizationMembershipType) -> Self { + Self { + organization_membership_type, + } + } +} +pub mod aws_organizational_data { + use super::*; + #[doc = "The multi cloud account's membership type in the organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OrganizationMembershipType")] + pub enum OrganizationMembershipType { + Member, + Organization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OrganizationMembershipType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OrganizationMembershipType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OrganizationMembershipType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), + Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The awsOrganization data for the master account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalDataMaster { + #[serde(flatten)] + pub aws_organizational_data: AwsOrganizationalData, + #[doc = "If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset"] + #[serde(rename = "stacksetName", default, skip_serializing_if = "Option::is_none")] + pub stackset_name: Option, + #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] + #[serde( + rename = "excludedAccountIds", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_account_ids: Vec, +} +impl AwsOrganizationalDataMaster { + pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { + Self { + aws_organizational_data, + stackset_name: None, + excluded_account_ids: Vec::new(), + } + } +} +#[doc = "The awsOrganization data for the member account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AwsOrganizationalDataMember { + #[serde(flatten)] + pub aws_organizational_data: AwsOrganizationalData, + #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the account's parent"] + #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] + pub parent_hierarchy_id: Option, +} +impl AwsOrganizationalDataMember { + pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { + Self { + aws_organizational_data, + parent_hierarchy_id: None, + } + } +} +#[doc = "The AzureDevOps scope connector's environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureDevOpsScopeEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, +} +impl AzureDevOpsScopeEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { environment_data } + } +} +#[doc = "Azure resource identifier."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AzureResourceIdentifier { + #[serde(flatten)] + pub resource_identifier: ResourceIdentifier, + #[doc = "ARM resource identifier for the cloud resource being alerted on"] + #[serde(rename = "azureResourceId", default, skip_serializing_if = "Option::is_none")] + pub azure_resource_id: Option, +} +impl AzureResourceIdentifier { + pub fn new(resource_identifier: ResourceIdentifier) -> Self { + Self { + resource_identifier, + azure_resource_id: None, + } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureResourceLink { + #[doc = "Azure resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl AzureResourceLink { + pub fn new() -> Self { + Self::default() + } +} +pub type AzureResourceLinks = Vec; +#[doc = "Describes an Azure resource with location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureTrackedResourceLocation { + #[doc = "Location where the resource is stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl AzureTrackedResourceLocation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Baseline details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Baseline { + #[doc = "Expected results."] + #[serde( + rename = "expectedResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub expected_results: Vec>, + #[doc = "Baseline update time (UTC)."] + #[serde(rename = "updatedTime", default, with = "azure_core::date::rfc3339::option")] + pub updated_time: Option, +} +impl Baseline { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule result adjusted with baseline."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BaselineAdjustedResult { + #[doc = "Baseline details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub baseline: Option, + #[doc = "The rule result status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Results the are not in baseline."] + #[serde( + rename = "resultsNotInBaseline", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results_not_in_baseline: Vec>, + #[doc = "Results the are in baseline."] + #[serde( + rename = "resultsOnlyInBaseline", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results_only_in_baseline: Vec>, +} +impl BaselineAdjustedResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The benchmark references."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct BenchmarkReference { + #[doc = "The benchmark name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub benchmark: Option, + #[doc = "The benchmark reference."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reference: Option, +} +impl BenchmarkReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Alert Simulator supported bundles."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "BundleType")] +pub enum BundleType { + AppServices, + #[serde(rename = "DNS")] + Dns, + KeyVaults, + KubernetesService, + ResourceManager, + SqlServers, + StorageAccounts, + VirtualMachines, + CosmosDbs, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for BundleType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for BundleType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for BundleType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AppServices => serializer.serialize_unit_variant("BundleType", 0u32, "AppServices"), + Self::Dns => serializer.serialize_unit_variant("BundleType", 1u32, "DNS"), + Self::KeyVaults => serializer.serialize_unit_variant("BundleType", 2u32, "KeyVaults"), + Self::KubernetesService => serializer.serialize_unit_variant("BundleType", 3u32, "KubernetesService"), + Self::ResourceManager => serializer.serialize_unit_variant("BundleType", 4u32, "ResourceManager"), + Self::SqlServers => serializer.serialize_unit_variant("BundleType", 5u32, "SqlServers"), + Self::StorageAccounts => serializer.serialize_unit_variant("BundleType", 6u32, "StorageAccounts"), + Self::VirtualMachines => serializer.serialize_unit_variant("BundleType", 7u32, "VirtualMachines"), + Self::CosmosDbs => serializer.serialize_unit_variant("BundleType", 8u32, "CosmosDbs"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "CVE details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cve { + #[doc = "CVE title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Link url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option, +} +impl Cve { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "CVSS details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Cvss { + #[doc = "CVSS base"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub base: Option, +} +impl Cvss { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a security solution which sends CEF logs to an OMS workspace"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CefExternalSecuritySolution { + #[serde(flatten)] + pub external_security_solution: ExternalSecuritySolution, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CefExternalSecuritySolution { + pub fn new(external_security_solution: ExternalSecuritySolution) -> Self { + Self { + external_security_solution, + properties: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CefSolutionProperties { + #[serde(flatten)] + pub external_security_solution_properties: ExternalSecuritySolutionProperties, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option, + #[serde(rename = "lastEventReceived", default, skip_serializing_if = "Option::is_none")] + pub last_event_received: Option, +} +impl CefSolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudError { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for CloudError { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl CloudError { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CloudErrorBody { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl CloudErrorBody { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Compliance of a scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Compliance { + #[serde(flatten)] + pub resource: Resource, + #[doc = "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Compliance { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of Compliance objects response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceList { + #[doc = "List of Compliance objects"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ComplianceList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ComplianceList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy Definitions applicable to a given resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceProperties { + #[doc = "The timestamp when the Compliance calculation was conducted."] + #[serde(rename = "assessmentTimestampUtcDate", default, with = "azure_core::date::rfc3339::option")] + pub assessment_timestamp_utc_date: Option, + #[doc = "The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation)."] + #[serde(rename = "resourceCount", default, skip_serializing_if = "Option::is_none")] + pub resource_count: Option, + #[doc = "An array of segment, which is the actually the compliance assessment."] + #[serde( + rename = "assessmentResult", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub assessment_result: Vec, +} +impl ComplianceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "a compliance result"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceResult { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Compliance result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ComplianceResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of compliance results response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ComplianceResultList { + #[doc = "List of compliance results"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ComplianceResultList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ComplianceResultList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Compliance result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceResultProperties { + #[doc = "The status of the resource regarding a single assessment"] + #[serde(rename = "resourceStatus", default, skip_serializing_if = "Option::is_none")] + pub resource_status: Option, +} +impl ComplianceResultProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod compliance_result_properties { + use super::*; + #[doc = "The status of the resource regarding a single assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ResourceStatus")] + pub enum ResourceStatus { + Healthy, + NotApplicable, + OffByPolicy, + NotHealthy, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ResourceStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ResourceStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ResourceStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Healthy => serializer.serialize_unit_variant("ResourceStatus", 0u32, "Healthy"), + Self::NotApplicable => serializer.serialize_unit_variant("ResourceStatus", 1u32, "NotApplicable"), + Self::OffByPolicy => serializer.serialize_unit_variant("ResourceStatus", 2u32, "OffByPolicy"), + Self::NotHealthy => serializer.serialize_unit_variant("ResourceStatus", 3u32, "NotHealthy"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A segment of a compliance assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ComplianceSegment { + #[doc = "The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc."] + #[serde(rename = "segmentType", default, skip_serializing_if = "Option::is_none")] + pub segment_type: Option, + #[doc = "The size (%) of the segment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl ComplianceSegment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Governance rule's condition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Condition { + #[doc = "The governance rule Condition's Property, e.g. Severity or AssessmentKey, see examples"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub property: Option, + #[doc = "The governance rule Condition's Value like severity Low, High or assessments keys, see examples"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The governance rule Condition's Operator, for example Equals for severity or In for list of assessments, see examples"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, +} +impl Condition { + pub fn new() -> Self { + Self::default() + } +} +pub mod condition { + use super::*; + #[doc = "The governance rule Condition's Operator, for example Equals for severity or In for list of assessments, see examples"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Operator")] + pub enum Operator { + Equals, + In, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Operator { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Operator { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Operator { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Equals => serializer.serialize_unit_variant("Operator", 0u32, "Equals"), + Self::In => serializer.serialize_unit_variant("Operator", 1u32, "In"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +pub type Conditions = Vec; +#[doc = "The configuration status of the machines group or machine or rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum ConfigurationStatus { + Configured, + NotConfigured, + InProgress, + Failed, + NoStatus, +} +#[doc = "Describes the allowed inbound and outbound traffic of an Azure resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectableResource { + #[doc = "The Azure resource id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The list of Azure resources that the resource has inbound allowed connection from"] + #[serde( + rename = "inboundConnectedResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub inbound_connected_resources: Vec, + #[doc = "The list of Azure resources that the resource has outbound allowed connection to"] + #[serde( + rename = "outboundConnectedResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub outbound_connected_resources: Vec, +} +impl ConnectableResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a connected resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectedResource { + #[doc = "The Azure resource id of the connected resource"] + #[serde(rename = "connectedResourceId", default, skip_serializing_if = "Option::is_none")] + pub connected_resource_id: Option, + #[doc = "The allowed tcp ports"] + #[serde(rename = "tcpPorts", default, skip_serializing_if = "Option::is_none")] + pub tcp_ports: Option, + #[doc = "The allowed udp ports"] + #[serde(rename = "udpPorts", default, skip_serializing_if = "Option::is_none")] + pub udp_ports: Option, +} +impl ConnectedResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectedWorkspace { + #[doc = "Azure resource ID of the connected OMS workspace"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, +} +impl ConnectedWorkspace { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionFromIpNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ConnectionFromIpNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "Connection string for ingesting security data and logs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionStrings { + #[doc = "Connection strings"] + pub value: Vec, +} +impl ConnectionStrings { + pub fn new(value: Vec) -> Self { + Self { value } + } +} +#[doc = "Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionToIpNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ConnectionToIpNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "The connector setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a connector setting"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ConnectorSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "For a subscription, list of all cloud account connectors and their settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSettingList { + #[doc = "List of all the cloud account connector settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ConnectorSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ConnectorSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a connector setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ConnectorSettingProperties { + #[doc = "Settings for hybrid compute management"] + #[serde(rename = "hybridComputeSettings", default, skip_serializing_if = "Option::is_none")] + pub hybrid_compute_settings: Option, + #[doc = "Settings for cloud authentication management"] + #[serde(rename = "authenticationDetails", default, skip_serializing_if = "Option::is_none")] + pub authentication_details: Option, +} +impl ConnectorSettingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Additional context fields for container registry Vulnerability assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ContainerRegistryVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Dictionary from cvss version to cvss details object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cvss: Option, + #[doc = "Indicates whether a patch is available or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patchable: Option, + #[doc = "List of CVEs"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cve: Vec, + #[doc = "Published time"] + #[serde(rename = "publishedTime", default, with = "azure_core::date::rfc3339::option")] + pub published_time: Option, + #[serde( + rename = "vendorReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vendor_references: Vec, + #[doc = "Name of the repository which the vulnerable image belongs to"] + #[serde(rename = "repositoryName", default, skip_serializing_if = "Option::is_none")] + pub repository_name: Option, + #[doc = "Digest of the vulnerable image"] + #[serde(rename = "imageDigest", default, skip_serializing_if = "Option::is_none")] + pub image_digest: Option, +} +impl ContainerRegistryVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + cvss: None, + patchable: None, + cve: Vec::new(), + published_time: None, + vendor_references: Vec::new(), + repository_name: None, + image_digest: None, + } + } +} +#[doc = "A custom alert rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CustomAlertRule { + #[doc = "The display name of the custom alert."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the custom alert."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Status of the custom alert."] + #[serde(rename = "isEnabled")] + pub is_enabled: bool, + #[doc = "The type of the custom alert rule."] + #[serde(rename = "ruleType")] + pub rule_type: String, +} +impl CustomAlertRule { + pub fn new(is_enabled: bool, rule_type: String) -> Self { + Self { + display_name: None, + description: None, + is_enabled, + rule_type, + } + } +} +#[doc = "Custom entity store assignment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "describes the custom entity store assignment properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomEntityStoreAssignment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the custom entity store assignment properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentProperties { + #[doc = "The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub principal: Option, + #[doc = "The link to entity store database."] + #[serde(rename = "entityStoreDatabaseLink", default, skip_serializing_if = "Option::is_none")] + pub entity_store_database_link: Option, +} +impl CustomEntityStoreAssignmentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the custom entity store assignment request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentRequest { + #[doc = "describes properties of custom entity store assignment request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomEntityStoreAssignmentRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of custom entity store assignment request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentRequestProperties { + #[doc = "The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub principal: Option, +} +impl CustomEntityStoreAssignmentRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of custom entity store assignments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomEntityStoreAssignmentsListResult { + #[doc = "Collection of custom entity store assignments"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CustomEntityStoreAssignmentsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CustomEntityStoreAssignmentsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The data export setting properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSettingProperties { + #[doc = "Is the data export setting enabled"] + pub enabled: bool, +} +impl DataExportSettingProperties { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +#[doc = "Represents a data export setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExportSettings { + #[serde(flatten)] + pub setting: Setting, + #[doc = "The data export setting properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DataExportSettings { + pub fn new(setting: Setting) -> Self { + Self { setting, properties: None } + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is denied."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DenylistCustomAlertRule { + #[serde(flatten)] + pub list_custom_alert_rule: ListCustomAlertRule, + #[doc = "The values to deny. The format of the values depends on the rule type."] + #[serde(rename = "denylistValues")] + pub denylist_values: Vec, +} +impl DenylistCustomAlertRule { + pub fn new(list_custom_alert_rule: ListCustomAlertRule, denylist_values: Vec) -> Self { + Self { + list_custom_alert_rule, + denylist_values, + } + } +} +#[doc = "The device security group resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroup { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of a security group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl DeviceSecurityGroup { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of device security groups"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroupList { + #[doc = "List of device security group objects"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DeviceSecurityGroupList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DeviceSecurityGroupList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of a security group."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DeviceSecurityGroupProperties { + #[doc = "The list of custom alert threshold rules."] + #[serde( + rename = "thresholdRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub threshold_rules: Vec, + #[doc = "The list of custom alert time-window rules."] + #[serde( + rename = "timeWindowRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub time_window_rules: Vec, + #[doc = "The allow-list custom alert rules."] + #[serde( + rename = "allowlistRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowlist_rules: Vec, + #[doc = "The deny-list custom alert rules."] + #[serde( + rename = "denylistRules", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub denylist_rules: Vec, +} +impl DeviceSecurityGroupProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of direct method invokes is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DirectMethodInvokesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl DirectMethodInvokesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiscoveredSecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + pub properties: DiscoveredSecuritySolutionProperties, +} +impl DiscoveredSecuritySolution { + pub fn new(properties: DiscoveredSecuritySolutionProperties) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct DiscoveredSecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for DiscoveredSecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl DiscoveredSecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiscoveredSecuritySolutionProperties { + #[doc = "The security family of the discovered solution"] + #[serde(rename = "securityFamily")] + pub security_family: discovered_security_solution_properties::SecurityFamily, + #[doc = "The security solutions' image offer"] + pub offer: String, + #[doc = "The security solutions' image publisher"] + pub publisher: String, + #[doc = "The security solutions' image sku"] + pub sku: String, +} +impl DiscoveredSecuritySolutionProperties { + pub fn new( + security_family: discovered_security_solution_properties::SecurityFamily, + offer: String, + publisher: String, + sku: String, + ) -> Self { + Self { + security_family, + offer, + publisher, + sku, + } + } +} +pub mod discovered_security_solution_properties { + use super::*; + #[doc = "The security family of the discovered solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SecurityFamily")] + pub enum SecurityFamily { + Waf, + Ngfw, + SaasWaf, + Va, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SecurityFamily { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SecurityFamily { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SecurityFamily { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Waf => serializer.serialize_unit_variant("SecurityFamily", 0u32, "Waf"), + Self::Ngfw => serializer.serialize_unit_variant("SecurityFamily", 1u32, "Ngfw"), + Self::SaasWaf => serializer.serialize_unit_variant("SecurityFamily", 2u32, "SaasWaf"), + Self::Va => serializer.serialize_unit_variant("SecurityFamily", 3u32, "Va"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ETag { + #[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl ETag { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the Network Security Groups effective on a network interface"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct EffectiveNetworkSecurityGroups { + #[doc = "The Azure resource ID of the network interface"] + #[serde(rename = "networkInterface", default, skip_serializing_if = "Option::is_none")] + pub network_interface: Option, + #[doc = "The Network Security Groups effective on the network interface"] + #[serde( + rename = "networkSecurityGroups", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub network_security_groups: Vec, +} +impl EffectiveNetworkSecurityGroups { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The application control policy enforcement/protection mode of the machine group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum EnforcementMode { + Audit, + Enforce, + None, +} +#[doc = "The machine supportability of Enforce feature"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum EnforcementSupport { + Supported, + NotSupported, + Unknown, +} +#[doc = "The security connector environment data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnvironmentData { + #[doc = "The type of the environment data."] + #[serde(rename = "environmentType")] + pub environment_type: environment_data::EnvironmentType, +} +impl EnvironmentData { + pub fn new(environment_type: environment_data::EnvironmentType) -> Self { + Self { environment_type } + } +} +pub mod environment_data { + use super::*; + #[doc = "The type of the environment data."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EnvironmentType")] + pub enum EnvironmentType { + AwsAccount, + GcpProject, + GithubScope, + AzureDevOpsScope, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EnvironmentType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EnvironmentType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EnvironmentType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsAccount => serializer.serialize_unit_variant("EnvironmentType", 0u32, "AwsAccount"), + Self::GcpProject => serializer.serialize_unit_variant("EnvironmentType", 1u32, "GcpProject"), + Self::GithubScope => serializer.serialize_unit_variant("EnvironmentType", 2u32, "GithubScope"), + Self::AzureDevOpsScope => serializer.serialize_unit_variant("EnvironmentType", 3u32, "AzureDevOpsScope"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Governance rule execution parameters"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExecuteGovernanceRuleParams { + #[doc = "Describe if governance rule should be override"] + #[serde(rename = "override", default, skip_serializing_if = "Option::is_none")] + pub override_: Option, +} +impl ExecuteGovernanceRuleParams { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExternalSecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub external_security_solution_kind: ExternalSecuritySolutionKind, + #[serde(flatten)] + pub location: Location, +} +impl ExternalSecuritySolution { + pub fn new() -> Self { + Self { + resource: Resource::default(), + external_security_solution_kind: ExternalSecuritySolutionKind::default(), + location: Location::default(), + } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionKind { + #[doc = "The kind of the external solution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl ExternalSecuritySolutionKind { + pub fn new() -> Self { + Self::default() + } +} +pub mod external_security_solution_kind { + use super::*; + #[doc = "The kind of the external solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + #[serde(rename = "CEF")] + Cef, + #[serde(rename = "ATA")] + Ata, + #[serde(rename = "AAD")] + Aad, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Cef => serializer.serialize_unit_variant("Kind", 0u32, "CEF"), + Self::Ata => serializer.serialize_unit_variant("Kind", 1u32, "ATA"), + Self::Aad => serializer.serialize_unit_variant("Kind", 2u32, "AAD"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for ExternalSecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl ExternalSecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The solution properties (correspond to the solution kind)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ExternalSecuritySolutionProperties { + #[serde(rename = "deviceVendor", default, skip_serializing_if = "Option::is_none")] + pub device_vendor: Option, + #[serde(rename = "deviceType", default, skip_serializing_if = "Option::is_none")] + pub device_type: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option, +} +impl ExternalSecuritySolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of failed local logins is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FailedLocalLoginsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl FailedLocalLoginsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The type of the file (for Linux files - Executable is used)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum FileType { + Exe, + Dll, + Msi, + Script, + Executable, + Unknown, +} +#[doc = "Number of file uploads is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileUploadsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl FileUploadsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID and a JSON API key (write only)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpCredentialsDetailsProperties { + #[serde(flatten)] + pub authentication_details_properties: AuthenticationDetailsProperties, + #[doc = "The organization ID of the GCP cloud account"] + #[serde(rename = "organizationId")] + pub organization_id: String, + #[doc = "Type field of the API key (write only)"] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Project ID field of the API key (write only)"] + #[serde(rename = "projectId")] + pub project_id: String, + #[doc = "Private key ID field of the API key (write only)"] + #[serde(rename = "privateKeyId")] + pub private_key_id: String, + #[doc = "Private key field of the API key (write only)"] + #[serde(rename = "privateKey")] + pub private_key: String, + #[doc = "Client email field of the API key (write only)"] + #[serde(rename = "clientEmail")] + pub client_email: String, + #[doc = "Client ID field of the API key (write only)"] + #[serde(rename = "clientId")] + pub client_id: String, + #[doc = "Auth URI field of the API key (write only)"] + #[serde(rename = "authUri")] + pub auth_uri: String, + #[doc = "Token URI field of the API key (write only)"] + #[serde(rename = "tokenUri")] + pub token_uri: String, + #[doc = "Auth provider x509 certificate URL field of the API key (write only)"] + #[serde(rename = "authProviderX509CertUrl")] + pub auth_provider_x509_cert_url: String, + #[doc = "Client x509 certificate URL field of the API key (write only)"] + #[serde(rename = "clientX509CertUrl")] + pub client_x509_cert_url: String, +} +impl GcpCredentialsDetailsProperties { + pub fn new( + authentication_details_properties: AuthenticationDetailsProperties, + organization_id: String, + type_: String, + project_id: String, + private_key_id: String, + private_key: String, + client_email: String, + client_id: String, + auth_uri: String, + token_uri: String, + auth_provider_x509_cert_url: String, + client_x509_cert_url: String, + ) -> Self { + Self { + authentication_details_properties, + organization_id, + type_, + project_id, + private_key_id, + private_key, + client_email, + client_id, + auth_uri, + token_uri, + auth_provider_x509_cert_url, + client_x509_cert_url, + } + } +} +#[doc = "The gcpOrganization data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalData { + #[doc = "The multi cloud account's membership type in the organization"] + #[serde(rename = "organizationMembershipType")] + pub organization_membership_type: gcp_organizational_data::OrganizationMembershipType, +} +impl GcpOrganizationalData { + pub fn new(organization_membership_type: gcp_organizational_data::OrganizationMembershipType) -> Self { + Self { + organization_membership_type, + } + } +} +pub mod gcp_organizational_data { + use super::*; + #[doc = "The multi cloud account's membership type in the organization"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OrganizationMembershipType")] + pub enum OrganizationMembershipType { + Member, + Organization, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OrganizationMembershipType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OrganizationMembershipType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OrganizationMembershipType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), + Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The gcpOrganization data for the member account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalDataMember { + #[serde(flatten)] + pub gcp_organizational_data: GcpOrganizationalData, + #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the project's parent"] + #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] + pub parent_hierarchy_id: Option, + #[doc = "The GCP management project number from organizational onboarding"] + #[serde(rename = "managementProjectNumber", default, skip_serializing_if = "Option::is_none")] + pub management_project_number: Option, +} +impl GcpOrganizationalDataMember { + pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { + Self { + gcp_organizational_data, + parent_hierarchy_id: None, + management_project_number: None, + } + } +} +#[doc = "The gcpOrganization data for the parent account"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpOrganizationalDataOrganization { + #[serde(flatten)] + pub gcp_organizational_data: GcpOrganizationalData, + #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] + #[serde( + rename = "excludedProjectNumbers", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_project_numbers: Vec, + #[doc = "The service account email address which represents the organization level permissions container."] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id which represents the permissions required to auto provision security connectors"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, +} +impl GcpOrganizationalDataOrganization { + pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { + Self { + gcp_organizational_data, + excluded_project_numbers: Vec::new(), + service_account_email_address: None, + workload_identity_provider_id: None, + } + } +} +#[doc = "The details about the project represented by the security connector"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GcpProjectDetails { + #[doc = "The unique GCP Project number"] + #[serde(rename = "projectNumber", default, skip_serializing_if = "Option::is_none")] + pub project_number: Option, + #[doc = "The GCP Project id"] + #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] + pub project_id: Option, + #[doc = "The GCP workload identity federation pool id"] + #[serde(rename = "workloadIdentityPoolId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_pool_id: Option, +} +impl GcpProjectDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The GCP project connector environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpProjectEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, + #[doc = "The gcpOrganization data"] + #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] + pub organizational_data: Option, + #[doc = "The details about the project represented by the security connector"] + #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] + pub project_details: Option, +} +impl GcpProjectEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { + environment_data, + organizational_data: None, + project_details: None, + } + } +} +#[doc = "The github scope connector's environment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GithubScopeEnvironmentData { + #[serde(flatten)] + pub environment_data: EnvironmentData, +} +impl GithubScopeEnvironmentData { + pub fn new(environment_data: EnvironmentData) -> Self { + Self { environment_data } + } +} +#[doc = "Governance assignment over a given scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceAssignment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an governance assignment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl GovernanceAssignment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describe the additional data of governance assignment - optional"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceAssignmentAdditionalData { + #[doc = "Ticket number associated with this governance assignment"] + #[serde(rename = "ticketNumber", default, skip_serializing_if = "Option::is_none")] + pub ticket_number: Option, + #[doc = "Ticket link associated with this governance assignment - for example: https://snow.com"] + #[serde(rename = "ticketLink", default, skip_serializing_if = "Option::is_none")] + pub ticket_link: Option, + #[doc = "The ticket status associated with this governance assignment - for example: Active"] + #[serde(rename = "ticketStatus", default, skip_serializing_if = "Option::is_none")] + pub ticket_status: Option, +} +impl GovernanceAssignmentAdditionalData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of an governance assignment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GovernanceAssignmentProperties { + #[doc = "The Owner for the governance assignment - e.g. user@contoso.com - see example"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owner: Option, + #[doc = "The remediation due-date - after this date Secure Score will be affected (in case of active grace-period)"] + #[serde(rename = "remediationDueDate", with = "azure_core::date::rfc3339")] + pub remediation_due_date: time::OffsetDateTime, + #[doc = "The ETA (estimated time of arrival) for remediation"] + #[serde(rename = "remediationEta", default, skip_serializing_if = "Option::is_none")] + pub remediation_eta: Option, + #[doc = "Defines whether there is a grace period on the governance assignment"] + #[serde(rename = "isGracePeriod", default, skip_serializing_if = "Option::is_none")] + pub is_grace_period: Option, + #[doc = "The governance email weekly notification configuration."] + #[serde(rename = "governanceEmailNotification", default, skip_serializing_if = "Option::is_none")] + pub governance_email_notification: Option, + #[doc = "Describe the additional data of governance assignment - optional"] + #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] + pub additional_data: Option, +} +impl GovernanceAssignmentProperties { + pub fn new(remediation_due_date: time::OffsetDateTime) -> Self { + Self { + owner: None, + remediation_due_date, + remediation_eta: None, + is_grace_period: None, + governance_email_notification: None, + additional_data: None, + } + } +} +#[doc = "Page of a governance assignments list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceAssignmentsList { + #[doc = "Collection of governance assignments in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for GovernanceAssignmentsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl GovernanceAssignmentsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The governance email weekly notification configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceEmailNotification { + #[doc = "Exclude manager from weekly email notification."] + #[serde(rename = "disableManagerEmailNotification", default, skip_serializing_if = "Option::is_none")] + pub disable_manager_email_notification: Option, + #[doc = "Exclude owner from weekly email notification."] + #[serde(rename = "disableOwnerEmailNotification", default, skip_serializing_if = "Option::is_none")] + pub disable_owner_email_notification: Option, +} +impl GovernanceEmailNotification { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Governance rule over a given scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceRule { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an governance rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl GovernanceRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of governance rule's condition sets - OR between ConditionSets, AND between conditions in a set"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceRuleConditionSets {} +impl GovernanceRuleConditionSets { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The governance email weekly notification configuration"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceRuleEmailNotification { + #[doc = "Defines whether manager email notifications are disabled"] + #[serde(rename = "disableManagerEmailNotification", default, skip_serializing_if = "Option::is_none")] + pub disable_manager_email_notification: Option, + #[doc = "Defines whether owner email notifications are disabled"] + #[serde(rename = "disableOwnerEmailNotification", default, skip_serializing_if = "Option::is_none")] + pub disable_owner_email_notification: Option, +} +impl GovernanceRuleEmailNotification { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Page of a governance rules list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceRuleList { + #[doc = "Collection of governance rules in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page"] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for GovernanceRuleList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl GovernanceRuleList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The governance rule metadata"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceRuleMetadata { + #[doc = "Governance rule Created by object id (GUID)"] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "Governance rule creation date"] + #[serde(rename = "createdOn", default, with = "azure_core::date::rfc3339::option")] + pub created_on: Option, + #[doc = "Governance rule last updated by object id (GUID)"] + #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")] + pub updated_by: Option, + #[doc = "Governance rule last update date"] + #[serde(rename = "updatedOn", default, with = "azure_core::date::rfc3339::option")] + pub updated_on: Option, +} +impl GovernanceRuleMetadata { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describe the owner source of governance rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct GovernanceRuleOwnerSource { + #[doc = "The owner type for the governance rule owner source"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The source value e.g. tag key like owner name or email address"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl GovernanceRuleOwnerSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod governance_rule_owner_source { + use super::*; + #[doc = "The owner type for the governance rule owner source"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + ByTag, + Manually, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::ByTag => serializer.serialize_unit_variant("Type", 0u32, "ByTag"), + Self::Manually => serializer.serialize_unit_variant("Type", 1u32, "Manually"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes properties of an governance rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GovernanceRuleProperties { + #[doc = "The tenantId (GUID)"] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "Display name of the governance rule"] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Description of the governance rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days"] + #[serde(rename = "remediationTimeframe", default, skip_serializing_if = "Option::is_none")] + pub remediation_timeframe: Option, + #[doc = "Defines whether there is a grace period on the governance rule"] + #[serde(rename = "isGracePeriod", default, skip_serializing_if = "Option::is_none")] + pub is_grace_period: Option, + #[doc = "The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will not be allowed"] + #[serde(rename = "rulePriority")] + pub rule_priority: i32, + #[doc = "Defines whether the rule is active/inactive"] + #[serde(rename = "isDisabled", default, skip_serializing_if = "Option::is_none")] + pub is_disabled: Option, + #[doc = "The rule type of the governance rule, defines the source of the rule e.g. Integrated"] + #[serde(rename = "ruleType")] + pub rule_type: governance_rule_properties::RuleType, + #[doc = "The governance rule source, what the rule affects, e.g. Assessments"] + #[serde(rename = "sourceResourceType")] + pub source_resource_type: governance_rule_properties::SourceResourceType, + #[doc = "Excluded scopes, filter out the descendants of the scope (on management scopes)"] + #[serde( + rename = "excludedScopes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub excluded_scopes: Vec, + #[doc = "The governance rule conditionSets - see examples"] + #[serde(rename = "conditionSets")] + pub condition_sets: Vec, + #[doc = "Defines whether the rule is management scope rule (master connector as a single scope or management scope)"] + #[serde(rename = "includeMemberScopes", default, skip_serializing_if = "Option::is_none")] + pub include_member_scopes: Option, + #[doc = "Describe the owner source of governance rule"] + #[serde(rename = "ownerSource")] + pub owner_source: GovernanceRuleOwnerSource, + #[doc = "The governance email weekly notification configuration"] + #[serde(rename = "governanceEmailNotification", default, skip_serializing_if = "Option::is_none")] + pub governance_email_notification: Option, + #[doc = "The governance rule metadata"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} +impl GovernanceRuleProperties { + pub fn new( + display_name: String, + rule_priority: i32, + rule_type: governance_rule_properties::RuleType, + source_resource_type: governance_rule_properties::SourceResourceType, + condition_sets: Vec, + owner_source: GovernanceRuleOwnerSource, + ) -> Self { + Self { + tenant_id: None, + display_name, + description: None, + remediation_timeframe: None, + is_grace_period: None, + rule_priority, + is_disabled: None, + rule_type, + source_resource_type, + excluded_scopes: Vec::new(), + condition_sets, + include_member_scopes: None, + owner_source, + governance_email_notification: None, + metadata: None, + } + } +} +pub mod governance_rule_properties { + use super::*; + #[doc = "The rule type of the governance rule, defines the source of the rule e.g. Integrated"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "RuleType")] + pub enum RuleType { + Integrated, + ServiceNow, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for RuleType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for RuleType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for RuleType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Integrated => serializer.serialize_unit_variant("RuleType", 0u32, "Integrated"), + Self::ServiceNow => serializer.serialize_unit_variant("RuleType", 1u32, "ServiceNow"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The governance rule source, what the rule affects, e.g. Assessments"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SourceResourceType")] + pub enum SourceResourceType { + Assessments, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SourceResourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SourceResourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SourceResourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Assessments => serializer.serialize_unit_variant("SourceResourceType", 0u32, "Assessments"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +pub type GroupResourceId = String; +#[doc = "Number of cloud to device messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (HTTP protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HttpD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl HttpD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Settings for hybrid compute management"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HybridComputeSettingsProperties { + #[doc = "State of the service principal and its secret"] + #[serde(rename = "hybridComputeProvisioningState", default, skip_serializing_if = "Option::is_none")] + pub hybrid_compute_provisioning_state: Option, + #[doc = "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines"] + #[serde(rename = "autoProvision")] + pub auto_provision: hybrid_compute_settings_properties::AutoProvision, + #[doc = "The name of the resource group where Arc (Hybrid Compute) connectors are connected."] + #[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")] + pub resource_group_name: Option, + #[doc = "The location where the metadata of machines will be stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use."] + #[serde(rename = "proxyServer", default, skip_serializing_if = "Option::is_none")] + pub proxy_server: Option, + #[doc = "Details of the service principal."] + #[serde(rename = "servicePrincipal", default, skip_serializing_if = "Option::is_none")] + pub service_principal: Option, +} +impl HybridComputeSettingsProperties { + pub fn new(auto_provision: hybrid_compute_settings_properties::AutoProvision) -> Self { + Self { + hybrid_compute_provisioning_state: None, + auto_provision, + resource_group_name: None, + region: None, + proxy_server: None, + service_principal: None, + } + } +} +pub mod hybrid_compute_settings_properties { + use super::*; + #[doc = "State of the service principal and its secret"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "HybridComputeProvisioningState")] + pub enum HybridComputeProvisioningState { + Valid, + Invalid, + Expired, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for HybridComputeProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for HybridComputeProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for HybridComputeProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Valid => serializer.serialize_unit_variant("HybridComputeProvisioningState", 0u32, "Valid"), + Self::Invalid => serializer.serialize_unit_variant("HybridComputeProvisioningState", 1u32, "Invalid"), + Self::Expired => serializer.serialize_unit_variant("HybridComputeProvisioningState", 2u32, "Expired"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Whether or not to automatically install Azure Arc (hybrid compute) agents on machines"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AutoProvision")] + pub enum AutoProvision { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AutoProvision { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AutoProvision { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AutoProvision { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("AutoProvision", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("AutoProvision", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The information type keyword."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionKeyword { + #[doc = "The keyword pattern."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pattern: Option, + #[doc = "Indicates whether the keyword is custom or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[doc = "Indicates whether the keyword can be applied on numeric types or not."] + #[serde(rename = "canBeNumeric", default, skip_serializing_if = "Option::is_none")] + pub can_be_numeric: Option, + #[doc = "Indicates whether the keyword is excluded or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub excluded: Option, +} +impl InformationProtectionKeyword { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information protection policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicy { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes properties of an information protection policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl InformationProtectionPolicy { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information protection policies response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicyList { + #[doc = "List of information protection policies."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for InformationProtectionPolicyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl InformationProtectionPolicyList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes properties of an information protection policy."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationProtectionPolicyProperties { + #[doc = "Describes the last UTC time the policy was modified."] + #[serde(rename = "lastModifiedUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_utc: Option, + #[doc = "Describes the version of the policy."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "Dictionary of sensitivity labels."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub labels: Option, + #[doc = "The sensitivity information types."] + #[serde(rename = "informationTypes", default, skip_serializing_if = "Option::is_none")] + pub information_types: Option, +} +impl InformationProtectionPolicyProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The information type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct InformationType { + #[doc = "The name of the information type."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the information type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The order of the information type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "The recommended label id to be associated with this information type."] + #[serde(rename = "recommendedLabelId", default, skip_serializing_if = "Option::is_none")] + pub recommended_label_id: Option, + #[doc = "Indicates whether the information type is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "Indicates whether the information type is custom or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[doc = "The information type keywords."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub keywords: Vec, +} +impl InformationType { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Connection string for ingesting security data and logs"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionConnectionString { + #[doc = "The region where ingested logs and data resides"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Connection string value"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} +impl IngestionConnectionString { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Configures how to correlate scan data and logs with resources associated with the subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Ingestion setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IngestionSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of ingestion settings"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingList { + #[doc = "List of ingestion settings"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IngestionSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IngestionSettingList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Ingestion setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingProperties {} +impl IngestionSettingProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Configures how to correlate scan data and logs with resources associated with the subscription."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IngestionSettingToken { + #[doc = "The token is used for correlating security data and logs with the resources in the subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub token: Option, +} +impl IngestionSettingToken { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Solution Aggregated Alert information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedAlert { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "IoT Security solution aggregated alert details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecurityAggregatedAlert { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of IoT Security solution aggregated alert data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityAggregatedAlertList { + #[doc = "List of aggregated alerts data."] + pub value: Vec, + #[doc = "When there is too much alert data for one page, use this URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IoTSecurityAggregatedAlertList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IoTSecurityAggregatedAlertList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "IoT Security solution aggregated alert details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedAlertProperties { + #[doc = "Name of the alert type."] + #[serde(rename = "alertType", default, skip_serializing_if = "Option::is_none")] + pub alert_type: Option, + #[doc = "Display name of the alert type."] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "Date of detection."] + #[serde(rename = "aggregatedDateUtc", default, skip_serializing_if = "Option::is_none")] + pub aggregated_date_utc: Option, + #[doc = "Name of the organization that raised the alert."] + #[serde(rename = "vendorName", default, skip_serializing_if = "Option::is_none")] + pub vendor_name: Option, + #[doc = "Assessed alert severity."] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "Recommended steps for remediation."] + #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] + pub remediation_steps: Option, + #[doc = "Description of the suspected vulnerability and meaning."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Number of alerts occurrences within the aggregated time window."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub count: Option, + #[doc = "Azure resource ID of the resource that received the alerts."] + #[serde(rename = "effectedResourceType", default, skip_serializing_if = "Option::is_none")] + pub effected_resource_type: Option, + #[doc = "The type of the alerted resource (Azure, Non-Azure)."] + #[serde(rename = "systemSource", default, skip_serializing_if = "Option::is_none")] + pub system_source: Option, + #[doc = "IoT Security solution alert response."] + #[serde(rename = "actionTaken", default, skip_serializing_if = "Option::is_none")] + pub action_taken: Option, + #[doc = "Log analytics query for getting the list of affected devices/alerts."] + #[serde(rename = "logAnalyticsQuery", default, skip_serializing_if = "Option::is_none")] + pub log_analytics_query: Option, + #[doc = "10 devices with the highest number of occurrences of this alert type, on this day."] + #[serde( + rename = "topDevicesList", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub top_devices_list: Vec, +} +impl IoTSecurityAggregatedAlertProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_aggregated_alert_properties { + use super::*; + #[doc = "Assessed alert severity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "IoT Security solution recommendation information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedRecommendation { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "IoT Security solution aggregated recommendation information"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecurityAggregatedRecommendation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of IoT Security solution aggregated recommendations."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecurityAggregatedRecommendationList { + #[doc = "List of aggregated recommendations data."] + pub value: Vec, + #[doc = "When there is too much alert data for one page, use this URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IoTSecurityAggregatedRecommendationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IoTSecurityAggregatedRecommendationList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "IoT Security solution aggregated recommendation information"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAggregatedRecommendationProperties { + #[doc = "Name of the recommendation."] + #[serde(rename = "recommendationName", default, skip_serializing_if = "Option::is_none")] + pub recommendation_name: Option, + #[doc = "Display name of the recommendation type."] + #[serde(rename = "recommendationDisplayName", default, skip_serializing_if = "Option::is_none")] + pub recommendation_display_name: Option, + #[doc = "Description of the suspected vulnerability and meaning."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Recommendation-type GUID."] + #[serde(rename = "recommendationTypeId", default, skip_serializing_if = "Option::is_none")] + pub recommendation_type_id: Option, + #[doc = "Name of the organization that made the recommendation."] + #[serde(rename = "detectedBy", default, skip_serializing_if = "Option::is_none")] + pub detected_by: Option, + #[doc = "Recommended steps for remediation"] + #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] + pub remediation_steps: Option, + #[doc = "Assessed recommendation severity."] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "Number of healthy devices within the IoT Security solution."] + #[serde(rename = "healthyDevices", default, skip_serializing_if = "Option::is_none")] + pub healthy_devices: Option, + #[doc = "Number of unhealthy devices within the IoT Security solution."] + #[serde(rename = "unhealthyDeviceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_device_count: Option, + #[doc = "Log analytics query for getting the list of affected devices/alerts."] + #[serde(rename = "logAnalyticsQuery", default, skip_serializing_if = "Option::is_none")] + pub log_analytics_query: Option, +} +impl IoTSecurityAggregatedRecommendationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_aggregated_recommendation_properties { + use super::*; + #[doc = "Assessed recommendation severity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Statistical information about the number of alerts per device during last set number of days."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityAlertedDevice { + #[doc = "Device identifier."] + #[serde(rename = "deviceId", default, skip_serializing_if = "Option::is_none")] + pub device_id: Option, + #[doc = "Number of alerts raised for this device."] + #[serde(rename = "alertsCount", default, skip_serializing_if = "Option::is_none")] + pub alerts_count: Option, +} +impl IoTSecurityAlertedDevice { + pub fn new() -> Self { + Self::default() + } +} +pub type IoTSecurityAlertedDevicesList = Vec; +#[doc = "Statistical information about the number of alerts per alert type during last set number of days"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityDeviceAlert { + #[doc = "Display name of the alert"] + #[serde(rename = "alertDisplayName", default, skip_serializing_if = "Option::is_none")] + pub alert_display_name: Option, + #[doc = "Assessed Alert severity."] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "Number of alerts raised for this alert type."] + #[serde(rename = "alertsCount", default, skip_serializing_if = "Option::is_none")] + pub alerts_count: Option, +} +impl IoTSecurityDeviceAlert { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_device_alert { + use super::*; + #[doc = "Assessed Alert severity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +pub type IoTSecurityDeviceAlertsList = Vec; +#[doc = "Statistical information about the number of recommendations per device, per recommendation type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecurityDeviceRecommendation { + #[doc = "Display name of the recommendation."] + #[serde(rename = "recommendationDisplayName", default, skip_serializing_if = "Option::is_none")] + pub recommendation_display_name: Option, + #[doc = "Assessed recommendation severity."] + #[serde(rename = "reportedSeverity", default, skip_serializing_if = "Option::is_none")] + pub reported_severity: Option, + #[doc = "Number of devices with this recommendation."] + #[serde(rename = "devicesCount", default, skip_serializing_if = "Option::is_none")] + pub devices_count: Option, +} +impl IoTSecurityDeviceRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub mod io_t_security_device_recommendation { + use super::*; + #[doc = "Assessed recommendation severity."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ReportedSeverity")] + pub enum ReportedSeverity { + Informational, + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ReportedSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ReportedSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ReportedSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Informational => serializer.serialize_unit_variant("ReportedSeverity", 0u32, "Informational"), + Self::Low => serializer.serialize_unit_variant("ReportedSeverity", 1u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("ReportedSeverity", 2u32, "Medium"), + Self::High => serializer.serialize_unit_variant("ReportedSeverity", 3u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +pub type IoTSecurityDeviceRecommendationsList = Vec; +#[doc = "Security analytics of your IoT Security solution"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecuritySolutionAnalyticsModel { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Security analytics properties of your IoT Security solution"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl IoTSecuritySolutionAnalyticsModel { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of Security analytics of your IoT Security solution"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecuritySolutionAnalyticsModelList { + #[doc = "List of Security analytics of your IoT Security solution"] + pub value: Vec, + #[doc = "When there is too much alert data for one page, use this URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl IoTSecuritySolutionAnalyticsModelList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Security analytics properties of your IoT Security solution"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecuritySolutionAnalyticsModelProperties { + #[doc = "IoT Security solution analytics severity metrics."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metrics: Option, + #[doc = "Number of unhealthy devices within your IoT Security solution."] + #[serde(rename = "unhealthyDeviceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_device_count: Option, + #[doc = "List of device metrics by the aggregation date."] + #[serde( + rename = "devicesMetrics", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub devices_metrics: Vec, + #[doc = "List of devices with open alerts including the count of alerts per device."] + #[serde(rename = "topAlertedDevices", default, skip_serializing_if = "Option::is_none")] + pub top_alerted_devices: Option, + #[doc = "List of alerts with the count of raised alerts"] + #[serde(rename = "mostPrevalentDeviceAlerts", default, skip_serializing_if = "Option::is_none")] + pub most_prevalent_device_alerts: Option, + #[doc = "List of aggregated recommendation data, per recommendation type, per device."] + #[serde(rename = "mostPrevalentDeviceRecommendations", default, skip_serializing_if = "Option::is_none")] + pub most_prevalent_device_recommendations: Option, +} +impl IoTSecuritySolutionAnalyticsModelProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "IoT Security solution configuration and resource information."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSecuritySolutionModel { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "The resource location."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Security Solution setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, +} +impl IoTSecuritySolutionModel { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Solution setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecuritySolutionProperties { + #[doc = "Workspace resource ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub workspace: Option, + #[doc = "Resource display name."] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Status of the IoT Security solution."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "List of additional options for exporting to workspace data."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub export: Vec, + #[doc = "Disabled data sources. Disabling these data sources compromises the system."] + #[serde( + rename = "disabledDataSources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub disabled_data_sources: Vec, + #[doc = "IoT Hub resource IDs"] + #[serde(rename = "iotHubs")] + pub iot_hubs: Vec, + #[doc = "Properties of the IoT Security solution's user defined resources."] + #[serde(rename = "userDefinedResources", default, skip_serializing_if = "Option::is_none")] + pub user_defined_resources: Option, + #[doc = "List of resources that were automatically discovered as relevant to the security solution."] + #[serde( + rename = "autoDiscoveredResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub auto_discovered_resources: Vec, + #[doc = "List of the configuration status for each recommendation type."] + #[serde(rename = "recommendationsConfiguration", default, skip_serializing_if = "Option::is_none")] + pub recommendations_configuration: Option, + #[doc = "Unmasked IP address logging status"] + #[serde(rename = "unmaskedIpLoggingStatus", default, skip_serializing_if = "Option::is_none")] + pub unmasked_ip_logging_status: Option, + #[doc = "List of additional workspaces"] + #[serde( + rename = "additionalWorkspaces", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_workspaces: Vec, +} +impl IoTSecuritySolutionProperties { + pub fn new(display_name: String, iot_hubs: Vec) -> Self { + Self { + workspace: None, + display_name, + status: None, + export: Vec::new(), + disabled_data_sources: Vec::new(), + iot_hubs, + user_defined_resources: None, + auto_discovered_resources: Vec::new(), + recommendations_configuration: None, + unmasked_ip_logging_status: None, + additional_workspaces: Vec::new(), + } + } +} +pub mod io_t_security_solution_properties { + use super::*; + #[doc = "Status of the IoT Security solution."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Enabled, + Disabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Enabled => serializer.serialize_unit_variant("Status", 0u32, "Enabled"), + Self::Disabled => serializer.serialize_unit_variant("Status", 1u32, "Disabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Status { + fn default() -> Self { + Self::Enabled + } + } + #[doc = "Unmasked IP address logging status"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "UnmaskedIpLoggingStatus")] + pub enum UnmaskedIpLoggingStatus { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for UnmaskedIpLoggingStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for UnmaskedIpLoggingStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for UnmaskedIpLoggingStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("UnmaskedIpLoggingStatus", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("UnmaskedIpLoggingStatus", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for UnmaskedIpLoggingStatus { + fn default() -> Self { + Self::Disabled + } + } +} +#[doc = "List of IoT Security solutions."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IoTSecuritySolutionsList { + #[doc = "List of IoT Security solutions"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for IoTSecuritySolutionsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl IoTSecuritySolutionsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "IoT Security solution analytics severity metrics."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct IoTSeverityMetrics { + #[doc = "Count of high severity alerts/recommendations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub high: Option, + #[doc = "Count of medium severity alerts/recommendations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub medium: Option, + #[doc = "Count of low severity alerts/recommendations."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub low: Option, +} +impl IoTSeverityMetrics { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct JitNetworkAccessPoliciesList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for JitNetworkAccessPoliciesList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl JitNetworkAccessPoliciesList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicy { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub kind: Kind, + #[serde(flatten)] + pub location: Location, + pub properties: JitNetworkAccessPolicyProperties, +} +impl JitNetworkAccessPolicy { + pub fn new(properties: JitNetworkAccessPolicyProperties) -> Self { + Self { + resource: Resource::default(), + kind: Kind::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiatePort { + pub number: PortNumber, + #[doc = "Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "The time to close the request in UTC"] + #[serde(rename = "endTimeUtc", with = "azure_core::date::rfc3339")] + pub end_time_utc: time::OffsetDateTime, +} +impl JitNetworkAccessPolicyInitiatePort { + pub fn new(number: PortNumber, end_time_utc: time::OffsetDateTime) -> Self { + Self { + number, + allowed_source_address_prefix: None, + end_time_utc, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiateRequest { + #[doc = "A list of virtual machines & ports to open access for"] + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[doc = "The justification for making the initiate request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub justification: Option, +} +impl JitNetworkAccessPolicyInitiateRequest { + pub fn new(virtual_machines: Vec) -> Self { + Self { + virtual_machines, + justification: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyInitiateVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "The ports to open for the resource with the `id`"] + pub ports: Vec, +} +impl JitNetworkAccessPolicyInitiateVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { id, ports } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyProperties { + #[doc = "Configurations for Microsoft.Compute/virtualMachines resource type."] + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub requests: Vec, + #[doc = "Gets the provisioning state of the Just-in-Time policy."] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl JitNetworkAccessPolicyProperties { + pub fn new(virtual_machines: Vec) -> Self { + Self { + virtual_machines, + requests: Vec::new(), + provisioning_state: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPolicyVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "Port configurations for the virtual machine"] + pub ports: Vec, + #[doc = "Public IP address of the Azure Firewall that is linked to this policy, if applicable"] + #[serde(rename = "publicIpAddress", default, skip_serializing_if = "Option::is_none")] + pub public_ip_address: Option, +} +impl JitNetworkAccessPolicyVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { + id, + ports, + public_ip_address: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessPortRule { + pub number: PortNumber, + pub protocol: jit_network_access_port_rule::Protocol, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefixes\" parameter. Should be an IP address or CIDR, for example \"192.168.0.3\" or \"192.168.0.0/16\"."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefix\" parameter."] + #[serde( + rename = "allowedSourceAddressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_source_address_prefixes: Vec, + #[doc = "Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day"] + #[serde(rename = "maxRequestAccessDuration")] + pub max_request_access_duration: String, +} +impl JitNetworkAccessPortRule { + pub fn new(number: PortNumber, protocol: jit_network_access_port_rule::Protocol, max_request_access_duration: String) -> Self { + Self { + number, + protocol, + allowed_source_address_prefix: None, + allowed_source_address_prefixes: Vec::new(), + max_request_access_duration, + } + } +} +pub mod jit_network_access_port_rule { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Protocol")] + pub enum Protocol { + #[serde(rename = "TCP")] + Tcp, + #[serde(rename = "UDP")] + Udp, + #[serde(rename = "*")] + U2a, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Protocol { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Protocol { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Protocol { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Tcp => serializer.serialize_unit_variant("Protocol", 0u32, "TCP"), + Self::Udp => serializer.serialize_unit_variant("Protocol", 1u32, "UDP"), + Self::U2a => serializer.serialize_unit_variant("Protocol", 2u32, "*"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequest { + #[serde(rename = "virtualMachines")] + pub virtual_machines: Vec, + #[doc = "The start time of the request in UTC"] + #[serde(rename = "startTimeUtc", with = "azure_core::date::rfc3339")] + pub start_time_utc: time::OffsetDateTime, + #[doc = "The identity of the person who made the request"] + pub requestor: String, + #[doc = "The justification for making the initiate request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub justification: Option, +} +impl JitNetworkAccessRequest { + pub fn new( + virtual_machines: Vec, + start_time_utc: time::OffsetDateTime, + requestor: String, + ) -> Self { + Self { + virtual_machines, + start_time_utc, + requestor, + justification: None, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequestPort { + pub number: PortNumber, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefixes\" parameter. Should be an IP address or CIDR, for example \"192.168.0.3\" or \"192.168.0.0/16\"."] + #[serde(rename = "allowedSourceAddressPrefix", default, skip_serializing_if = "Option::is_none")] + pub allowed_source_address_prefix: Option, + #[doc = "Mutually exclusive with the \"allowedSourceAddressPrefix\" parameter."] + #[serde( + rename = "allowedSourceAddressPrefixes", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub allowed_source_address_prefixes: Vec, + #[doc = "The date & time at which the request ends in UTC"] + #[serde(rename = "endTimeUtc", with = "azure_core::date::rfc3339")] + pub end_time_utc: time::OffsetDateTime, + #[doc = "The status of the port"] + pub status: jit_network_access_request_port::Status, + #[doc = "A description of why the `status` has its value"] + #[serde(rename = "statusReason")] + pub status_reason: jit_network_access_request_port::StatusReason, + #[doc = "The port which is mapped to this port's `number` in the Azure Firewall, if applicable"] + #[serde(rename = "mappedPort", default, skip_serializing_if = "Option::is_none")] + pub mapped_port: Option, +} +impl JitNetworkAccessRequestPort { + pub fn new( + number: PortNumber, + end_time_utc: time::OffsetDateTime, + status: jit_network_access_request_port::Status, + status_reason: jit_network_access_request_port::StatusReason, + ) -> Self { + Self { + number, + allowed_source_address_prefix: None, + allowed_source_address_prefixes: Vec::new(), + end_time_utc, + status, + status_reason, + mapped_port: None, + } + } +} +pub mod jit_network_access_request_port { + use super::*; + #[doc = "The status of the port"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Revoked, + Initiated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Revoked => serializer.serialize_unit_variant("Status", 0u32, "Revoked"), + Self::Initiated => serializer.serialize_unit_variant("Status", 1u32, "Initiated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "A description of why the `status` has its value"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "StatusReason")] + pub enum StatusReason { + Expired, + UserRequested, + NewerRequestInitiated, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for StatusReason { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for StatusReason { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for StatusReason { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Expired => serializer.serialize_unit_variant("StatusReason", 0u32, "Expired"), + Self::UserRequested => serializer.serialize_unit_variant("StatusReason", 1u32, "UserRequested"), + Self::NewerRequestInitiated => serializer.serialize_unit_variant("StatusReason", 2u32, "NewerRequestInitiated"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct JitNetworkAccessRequestVirtualMachine { + #[doc = "Resource ID of the virtual machine that is linked to this policy"] + pub id: String, + #[doc = "The ports that were opened for the virtual machine"] + pub ports: Vec, +} +impl JitNetworkAccessRequestVirtualMachine { + pub fn new(id: String, ports: Vec) -> Self { + Self { id, ports } + } +} +#[doc = "Describes an Azure resource with kind"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Kind { + #[doc = "Kind of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kind: Option, +} +impl Kind { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A List custom alert rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ListCustomAlertRule { + #[serde(flatten)] + pub custom_alert_rule: CustomAlertRule, + #[doc = "The value type of the items in the list."] + #[serde(rename = "valueType", default, skip_serializing_if = "Option::is_none")] + pub value_type: Option, +} +impl ListCustomAlertRule { + pub fn new(custom_alert_rule: CustomAlertRule) -> Self { + Self { + custom_alert_rule, + value_type: None, + } + } +} +pub mod list_custom_alert_rule { + use super::*; + #[doc = "The value type of the items in the list."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ValueType")] + pub enum ValueType { + IpCidr, + String, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ValueType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ValueType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ValueType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IpCidr => serializer.serialize_unit_variant("ValueType", 0u32, "IpCidr"), + Self::String => serializer.serialize_unit_variant("ValueType", 1u32, "String"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Login by a local user that isn't allowed. Allow list consists of login names to allow."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LocalUserNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl LocalUserNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "Describes an Azure resource with location"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Location { + #[doc = "Location where the resource is stored"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, +} +impl Location { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a Log Analytics workspace scope identifier."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LogAnalyticsIdentifier { + #[serde(flatten)] + pub resource_identifier: ResourceIdentifier, + #[doc = "The LogAnalytics workspace id that stores this alert."] + #[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")] + pub workspace_id: Option, + #[doc = "The azure subscription id for the LogAnalytics workspace storing this alert."] + #[serde(rename = "workspaceSubscriptionId", default, skip_serializing_if = "Option::is_none")] + pub workspace_subscription_id: Option, + #[doc = "The azure resource group for the LogAnalytics workspace storing this alert"] + #[serde(rename = "workspaceResourceGroup", default, skip_serializing_if = "Option::is_none")] + pub workspace_resource_group: Option, + #[doc = "(optional) The LogAnalytics agent id reporting the event that this alert is based on."] + #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")] + pub agent_id: Option, +} +impl LogAnalyticsIdentifier { + pub fn new(resource_identifier: ResourceIdentifier) -> Self { + Self { + resource_identifier, + workspace_id: None, + workspace_subscription_id: None, + workspace_resource_group: None, + agent_id: None, + } + } +} +#[doc = "The resource of the configuration or data needed to onboard the machine to MDE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingData { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Properties of the MDE configuration or data parameter needed to onboard the machine to MDE"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl MdeOnboardingData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of all MDE onboarding data resources"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingDataList { + #[doc = "List of the resources of the configuration or data needed to onboard the machine to MDE"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl MdeOnboardingDataList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the MDE configuration or data parameter needed to onboard the machine to MDE"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct MdeOnboardingDataProperties { + #[doc = "The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension"] + #[serde(rename = "onboardingPackageWindows", default, skip_serializing_if = "Option::is_none")] + pub onboarding_package_windows: Option, + #[doc = "The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension"] + #[serde(rename = "onboardingPackageLinux", default, skip_serializing_if = "Option::is_none")] + pub onboarding_package_linux: Option, +} +impl MdeOnboardingDataProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of cloud to device messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttC2dMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttC2dMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of rejected cloud to device messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttC2dRejectedMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttC2dRejectedMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of device to cloud messages (MQTT protocol) is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MqttD2cMessagesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl MqttD2cMessagesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Possible operation in the REST API of Microsoft.Security"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Operation { + #[doc = "Name of the operation"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Where the operation is originated"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub origin: Option, + #[doc = "Security operation display"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} +impl Operation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security operation display"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationDisplay { + #[doc = "The resource provider for the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[doc = "The display name of the resource the operation applies to."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resource: Option, + #[doc = "The display name of the security operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operation: Option, + #[doc = "The description of the operation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl OperationDisplay { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of possible operations for Microsoft.Security resource provider"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationList { + #[doc = "List of Security operations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for OperationList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl OperationList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Long run operation status of governance rule over a given scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct OperationResult { + #[doc = "The status of the long run operation result of governance rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl OperationResult { + pub fn new() -> Self { + Self::default() + } +} +pub mod operation_result { + use super::*; + #[doc = "The status of the long run operation result of governance rule"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Succeeded, + Failed, + Canceled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("Status", 0u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("Status", 1u32, "Failed"), + Self::Canceled => serializer.serialize_unit_variant("Status", 2u32, "Canceled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents a path that is recommended to be allowed and its properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PathRecommendation { + #[doc = "The full path of the file, or an identifier of the application"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[doc = "The recommendation action of the machine or rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub action: Option, + #[doc = "The type of the rule to be allowed"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Represents the publisher information of a process/rule"] + #[serde(rename = "publisherInfo", default, skip_serializing_if = "Option::is_none")] + pub publisher_info: Option, + #[doc = "Whether the application is commonly run on the machine"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub common: Option, + #[serde( + rename = "userSids", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub user_sids: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub usernames: Vec, + #[doc = "The type of the file (for Linux files - Executable is used)"] + #[serde(rename = "fileType", default, skip_serializing_if = "Option::is_none")] + pub file_type: Option, + #[doc = "The configuration status of the machines group or machine or rule"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, +} +impl PathRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub type PathRecommendations = Vec; +#[doc = "A permission detected in the cloud account."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "PermissionProperty")] +pub enum PermissionProperty { + #[serde(rename = "AWS::AWSSecurityHubReadOnlyAccess")] + AwsAwsSecurityHubReadOnlyAccess, + #[serde(rename = "AWS::SecurityAudit")] + AwsSecurityAudit, + #[serde(rename = "AWS::AmazonSSMAutomationRole")] + AwsAmazonSsmAutomationRole, + #[serde(rename = "GCP::Security Center Admin Viewer")] + GcpSecurityCenterAdminViewer, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for PermissionProperty { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for PermissionProperty { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for PermissionProperty { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AwsAwsSecurityHubReadOnlyAccess => { + serializer.serialize_unit_variant("PermissionProperty", 0u32, "AWS::AWSSecurityHubReadOnlyAccess") + } + Self::AwsSecurityAudit => serializer.serialize_unit_variant("PermissionProperty", 1u32, "AWS::SecurityAudit"), + Self::AwsAmazonSsmAutomationRole => { + serializer.serialize_unit_variant("PermissionProperty", 2u32, "AWS::AmazonSSMAutomationRole") + } + Self::GcpSecurityCenterAdminViewer => { + serializer.serialize_unit_variant("PermissionProperty", 3u32, "GCP::Security Center Admin Viewer") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +pub type PortNumber = i64; +#[doc = "Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Pricing { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Pricing properties for the relevant scope"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Pricing { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of pricing configurations response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingList { + #[doc = "List of pricing configurations"] + pub value: Vec, +} +impl PricingList { + pub fn new(value: Vec) -> Self { + Self { value } + } +} +#[doc = "Pricing properties for the relevant scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PricingProperties { + #[doc = "The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] + #[serde(rename = "pricingTier")] + pub pricing_tier: pricing_properties::PricingTier, + #[doc = "The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is applied."] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, + #[doc = "The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S)."] + #[serde(rename = "freeTrialRemainingTime", default, skip_serializing_if = "Option::is_none")] + pub free_trial_remaining_time: Option, + #[doc = "Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deprecated: Option, + #[doc = "Optional. List of plans that replace this plan. This property exists only if this plan is deprecated."] + #[serde( + rename = "replacedBy", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub replaced_by: Vec, +} +impl PricingProperties { + pub fn new(pricing_tier: pricing_properties::PricingTier) -> Self { + Self { + pricing_tier, + sub_plan: None, + free_trial_remaining_time: None, + deprecated: None, + replaced_by: Vec::new(), + } + } +} +pub mod pricing_properties { + use super::*; + #[doc = "The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "PricingTier")] + pub enum PricingTier { + Free, + Standard, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for PricingTier { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for PricingTier { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for PricingTier { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Free => serializer.serialize_unit_variant("PricingTier", 0u32, "Free"), + Self::Standard => serializer.serialize_unit_variant("PricingTier", 1u32, "Standard"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Execution of a process that isn't allowed. Allow list consists of process names to allow."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProcessNotAllowed { + #[serde(flatten)] + pub allowlist_custom_alert_rule: AllowlistCustomAlertRule, +} +impl ProcessNotAllowed { + pub fn new(allowlist_custom_alert_rule: AllowlistCustomAlertRule) -> Self { + Self { + allowlist_custom_alert_rule, + } + } +} +#[doc = "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProtectionMode { + #[doc = "The application control policy enforcement/protection mode of the machine group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exe: Option, + #[doc = "The application control policy enforcement/protection mode of the machine group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub msi: Option, + #[doc = "The application control policy enforcement/protection mode of the machine group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub script: Option, + #[doc = "The application control policy enforcement/protection mode of the machine group"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub executable: Option, +} +impl ProtectionMode { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ProxyServerProperties { + #[doc = "Proxy server IP"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip: Option, + #[doc = "Proxy server port"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, +} +impl ProxyServerProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents the publisher information of a process/rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct PublisherInfo { + #[doc = "The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country"] + #[serde(rename = "publisherName", default, skip_serializing_if = "Option::is_none")] + pub publisher_name: Option, + #[doc = "The product name taken from the file's version resource"] + #[serde(rename = "productName", default, skip_serializing_if = "Option::is_none")] + pub product_name: Option, + #[doc = "The \"OriginalName\" field taken from the file's version resource"] + #[serde(rename = "binaryName", default, skip_serializing_if = "Option::is_none")] + pub binary_name: Option, + #[doc = "The binary file version taken from the file's version resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl PublisherInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule query details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct QueryCheck { + #[doc = "The rule query."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, + #[doc = "Expected result."] + #[serde( + rename = "expectedResult", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub expected_result: Vec>, + #[doc = "Column names of expected result."] + #[serde( + rename = "columnNames", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub column_names: Vec, +} +impl QueryCheck { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of device queue purges is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct QueuePurgesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl QueuePurgesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "The recommendation action of the machine or rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationAction { + Recommended, + Add, + Remove, +} +pub type RecommendationConfigurationList = Vec; +#[doc = "The type of IoT Security recommendation."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecommendationConfigurationProperties { + #[doc = "The type of IoT Security recommendation."] + #[serde(rename = "recommendationType")] + pub recommendation_type: recommendation_configuration_properties::RecommendationType, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Recommendation status. When the recommendation status is disabled recommendations are not generated."] + pub status: recommendation_configuration_properties::Status, +} +impl RecommendationConfigurationProperties { + pub fn new( + recommendation_type: recommendation_configuration_properties::RecommendationType, + status: recommendation_configuration_properties::Status, + ) -> Self { + Self { + recommendation_type, + name: None, + status, + } + } +} +pub mod recommendation_configuration_properties { + use super::*; + #[doc = "The type of IoT Security recommendation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "RecommendationType")] + pub enum RecommendationType { + #[serde(rename = "IoT_ACRAuthentication")] + IoTAcrAuthentication, + #[serde(rename = "IoT_AgentSendsUnutilizedMessages")] + IoTAgentSendsUnutilizedMessages, + #[serde(rename = "IoT_Baseline")] + IoTBaseline, + #[serde(rename = "IoT_EdgeHubMemOptimize")] + IoTEdgeHubMemOptimize, + #[serde(rename = "IoT_EdgeLoggingOptions")] + IoTEdgeLoggingOptions, + #[serde(rename = "IoT_InconsistentModuleSettings")] + IoTInconsistentModuleSettings, + #[serde(rename = "IoT_InstallAgent")] + IoTInstallAgent, + #[serde(rename = "IoT_IPFilter_DenyAll")] + IoTIpFilterDenyAll, + #[serde(rename = "IoT_IPFilter_PermissiveRule")] + IoTIpFilterPermissiveRule, + #[serde(rename = "IoT_OpenPorts")] + IoTOpenPorts, + #[serde(rename = "IoT_PermissiveFirewallPolicy")] + IoTPermissiveFirewallPolicy, + #[serde(rename = "IoT_PermissiveInputFirewallRules")] + IoTPermissiveInputFirewallRules, + #[serde(rename = "IoT_PermissiveOutputFirewallRules")] + IoTPermissiveOutputFirewallRules, + #[serde(rename = "IoT_PrivilegedDockerOptions")] + IoTPrivilegedDockerOptions, + #[serde(rename = "IoT_SharedCredentials")] + IoTSharedCredentials, + #[serde(rename = "IoT_VulnerableTLSCipherSuite")] + IoTVulnerableTlsCipherSuite, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for RecommendationType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for RecommendationType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for RecommendationType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::IoTAcrAuthentication => serializer.serialize_unit_variant("RecommendationType", 0u32, "IoT_ACRAuthentication"), + Self::IoTAgentSendsUnutilizedMessages => { + serializer.serialize_unit_variant("RecommendationType", 1u32, "IoT_AgentSendsUnutilizedMessages") + } + Self::IoTBaseline => serializer.serialize_unit_variant("RecommendationType", 2u32, "IoT_Baseline"), + Self::IoTEdgeHubMemOptimize => serializer.serialize_unit_variant("RecommendationType", 3u32, "IoT_EdgeHubMemOptimize"), + Self::IoTEdgeLoggingOptions => serializer.serialize_unit_variant("RecommendationType", 4u32, "IoT_EdgeLoggingOptions"), + Self::IoTInconsistentModuleSettings => { + serializer.serialize_unit_variant("RecommendationType", 5u32, "IoT_InconsistentModuleSettings") + } + Self::IoTInstallAgent => serializer.serialize_unit_variant("RecommendationType", 6u32, "IoT_InstallAgent"), + Self::IoTIpFilterDenyAll => serializer.serialize_unit_variant("RecommendationType", 7u32, "IoT_IPFilter_DenyAll"), + Self::IoTIpFilterPermissiveRule => { + serializer.serialize_unit_variant("RecommendationType", 8u32, "IoT_IPFilter_PermissiveRule") + } + Self::IoTOpenPorts => serializer.serialize_unit_variant("RecommendationType", 9u32, "IoT_OpenPorts"), + Self::IoTPermissiveFirewallPolicy => { + serializer.serialize_unit_variant("RecommendationType", 10u32, "IoT_PermissiveFirewallPolicy") + } + Self::IoTPermissiveInputFirewallRules => { + serializer.serialize_unit_variant("RecommendationType", 11u32, "IoT_PermissiveInputFirewallRules") + } + Self::IoTPermissiveOutputFirewallRules => { + serializer.serialize_unit_variant("RecommendationType", 12u32, "IoT_PermissiveOutputFirewallRules") + } + Self::IoTPrivilegedDockerOptions => { + serializer.serialize_unit_variant("RecommendationType", 13u32, "IoT_PrivilegedDockerOptions") + } + Self::IoTSharedCredentials => serializer.serialize_unit_variant("RecommendationType", 14u32, "IoT_SharedCredentials"), + Self::IoTVulnerableTlsCipherSuite => { + serializer.serialize_unit_variant("RecommendationType", 15u32, "IoT_VulnerableTLSCipherSuite") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Recommendation status. When the recommendation status is disabled recommendations are not generated."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Status")] + pub enum Status { + Disabled, + Enabled, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Status { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Status { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Disabled => serializer.serialize_unit_variant("Status", 0u32, "Disabled"), + Self::Enabled => serializer.serialize_unit_variant("Status", 1u32, "Enabled"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + impl Default for Status { + fn default() -> Self { + Self::Enabled + } + } +} +#[doc = "The initial recommendation status of the machine group or machine"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationStatus { + Recommended, + NotRecommended, + NotAvailable, + NoStatus, +} +#[doc = "The type of the rule to be allowed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum RecommendationType { + File, + FileHash, + PublisherSignature, + ProductSignature, + BinarySignature, + VersionAndAboveSignature, +} +#[doc = "Regulatory compliance assessment details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance assessment data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance assessment response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceAssessmentList { + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceAssessmentList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance assessment data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceAssessmentProperties { + #[doc = "The description of the regulatory compliance assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The expected type of assessment contained in the AssessmentDetailsLink"] + #[serde(rename = "assessmentType", default, skip_serializing_if = "Option::is_none")] + pub assessment_type: Option, + #[doc = "Link to more detailed assessment results data. The response type will be according to the assessmentType field"] + #[serde(rename = "assessmentDetailsLink", default, skip_serializing_if = "Option::is_none")] + pub assessment_details_link: Option, + #[doc = "Aggregative state based on the assessment's scanned resources states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The given assessment's related resources count with passed state."] + #[serde(rename = "passedResources", default, skip_serializing_if = "Option::is_none")] + pub passed_resources: Option, + #[doc = "The given assessment's related resources count with failed state."] + #[serde(rename = "failedResources", default, skip_serializing_if = "Option::is_none")] + pub failed_resources: Option, + #[doc = "The given assessment's related resources count with skipped state."] + #[serde(rename = "skippedResources", default, skip_serializing_if = "Option::is_none")] + pub skipped_resources: Option, + #[doc = "The given assessment's related resources count with unsupported state."] + #[serde(rename = "unsupportedResources", default, skip_serializing_if = "Option::is_none")] + pub unsupported_resources: Option, +} +impl RegulatoryComplianceAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_assessment_properties { + use super::*; + #[doc = "Aggregative state based on the assessment's scanned resources states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Regulatory compliance control details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceControl { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance control data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceControl { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance controls response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceControlList { + #[doc = "List of regulatory compliance controls"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceControlList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceControlList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance control data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceControlProperties { + #[doc = "The description of the regulatory compliance control"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Aggregative state based on the control's supported assessments states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a passed state"] + #[serde(rename = "passedAssessments", default, skip_serializing_if = "Option::is_none")] + pub passed_assessments: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a failed state"] + #[serde(rename = "failedAssessments", default, skip_serializing_if = "Option::is_none")] + pub failed_assessments: Option, + #[doc = "The number of supported regulatory compliance assessments of the given control with a skipped state"] + #[serde(rename = "skippedAssessments", default, skip_serializing_if = "Option::is_none")] + pub skipped_assessments: Option, +} +impl RegulatoryComplianceControlProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_control_properties { + use super::*; + #[doc = "Aggregative state based on the control's supported assessments states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Regulatory compliance standard details and state"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceStandard { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Regulatory compliance standard data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RegulatoryComplianceStandard { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of regulatory compliance standards response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegulatoryComplianceStandardList { + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for RegulatoryComplianceStandardList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl RegulatoryComplianceStandardList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Regulatory compliance standard data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RegulatoryComplianceStandardProperties { + #[doc = "Aggregative state based on the standard's supported controls states"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a passed state"] + #[serde(rename = "passedControls", default, skip_serializing_if = "Option::is_none")] + pub passed_controls: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a failed state"] + #[serde(rename = "failedControls", default, skip_serializing_if = "Option::is_none")] + pub failed_controls: Option, + #[doc = "The number of supported regulatory compliance controls of the given standard with a skipped state"] + #[serde(rename = "skippedControls", default, skip_serializing_if = "Option::is_none")] + pub skipped_controls: Option, + #[doc = "The number of regulatory compliance controls of the given standard which are unsupported by automated assessments"] + #[serde(rename = "unsupportedControls", default, skip_serializing_if = "Option::is_none")] + pub unsupported_controls: Option, +} +impl RegulatoryComplianceStandardProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod regulatory_compliance_standard_properties { + use super::*; + #[doc = "Aggregative state based on the standard's supported controls states"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + Passed, + Failed, + Skipped, + Unsupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Passed => serializer.serialize_unit_variant("State", 0u32, "Passed"), + Self::Failed => serializer.serialize_unit_variant("State", 1u32, "Failed"), + Self::Skipped => serializer.serialize_unit_variant("State", 2u32, "Skipped"), + Self::Unsupported => serializer.serialize_unit_variant("State", 3u32, "Unsupported"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Remediation details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Remediation { + #[doc = "Remediation description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Remediation script."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub scripts: Vec, + #[doc = "Is remediation automated."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub automated: Option, + #[doc = "Optional link to remediate in Azure Portal."] + #[serde(rename = "portalLink", default, skip_serializing_if = "Option::is_none")] + pub portal_link: Option, +} +impl Remediation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The ETA (estimated time of arrival) for remediation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RemediationEta { + #[doc = "ETA for remediation."] + #[serde(with = "azure_core::date::rfc3339")] + pub eta: time::OffsetDateTime, + #[doc = "Justification for change of Eta."] + pub justification: String, +} +impl RemediationEta { + pub fn new(eta: time::OffsetDateTime, justification: String) -> Self { + Self { eta, justification } + } +} +#[doc = "Describes an Azure resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Resource { + #[doc = "Resource Id"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Resource name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Resource type"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl Resource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Details of the resource that was assessed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceDetails { + #[doc = "The platform where the assessed resource resides"] + pub source: resource_details::Source, +} +impl ResourceDetails { + pub fn new(source: resource_details::Source) -> Self { + Self { source } + } +} +pub mod resource_details { + use super::*; + #[doc = "The platform where the assessed resource resides"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Source")] + pub enum Source { + Azure, + OnPremise, + OnPremiseSql, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Source { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Source { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Source { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("Source", 0u32, "Azure"), + Self::OnPremise => serializer.serialize_unit_variant("Source", 1u32, "OnPremise"), + Self::OnPremiseSql => serializer.serialize_unit_variant("Source", 2u32, "OnPremiseSql"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A resource identifier for an alert which can be used to direct the alert to the right product exposure group (tenant, workspace, subscription etc.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceIdentifier { + #[doc = "There can be multiple identifiers of different type per alert, this field specify the identifier type."] + #[serde(rename = "type")] + pub type_: resource_identifier::Type, +} +impl ResourceIdentifier { + pub fn new(type_: resource_identifier::Type) -> Self { + Self { type_ } + } +} +pub mod resource_identifier { + use super::*; + #[doc = "There can be multiple identifiers of different type per alert, this field specify the identifier type."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + AzureResource, + LogAnalytics, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AzureResource => serializer.serialize_unit_variant("Type", 0u32, "AzureResource"), + Self::LogAnalytics => serializer.serialize_unit_variant("Type", 1u32, "LogAnalytics"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote addresses are recommended to be blocked"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Rule { + #[doc = "The name of the rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The rule's direction"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub direction: Option, + #[serde(rename = "destinationPort", default, skip_serializing_if = "Option::is_none")] + pub destination_port: Option, + #[doc = "The rule's transport protocols"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub protocols: Vec, + #[doc = "The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol"] + #[serde( + rename = "ipAddresses", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub ip_addresses: Vec, +} +impl Rule { + pub fn new() -> Self { + Self::default() + } +} +pub mod rule { + use super::*; + #[doc = "The rule's direction"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Direction")] + pub enum Direction { + Inbound, + Outbound, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Direction { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Direction { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Direction { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Inbound => serializer.serialize_unit_variant("Direction", 0u32, "Inbound"), + Self::Outbound => serializer.serialize_unit_variant("Direction", 1u32, "Outbound"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Rule results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResults { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Rule results properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl RuleResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule results input."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResultsInput { + #[doc = "Take results from latest scan."] + #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] + pub latest_scan: Option, + #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results: Vec>, +} +impl RuleResultsInput { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rule results properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RuleResultsProperties { + #[doc = "Expected results in the baseline."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub results: Vec>, +} +impl RuleResultsProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The rule severity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleSeverity")] +pub enum RuleSeverity { + High, + Medium, + Low, + Informational, + Obsolete, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("RuleSeverity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("RuleSeverity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("RuleSeverity", 2u32, "Low"), + Self::Informational => serializer.serialize_unit_variant("RuleSeverity", 3u32, "Informational"), + Self::Obsolete => serializer.serialize_unit_variant("RuleSeverity", 4u32, "Obsolete"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The rule result status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleStatus")] +pub enum RuleStatus { + NonFinding, + Finding, + InternalError, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::NonFinding => serializer.serialize_unit_variant("RuleStatus", 0u32, "NonFinding"), + Self::Finding => serializer.serialize_unit_variant("RuleStatus", 1u32, "Finding"), + Self::InternalError => serializer.serialize_unit_variant("RuleStatus", 2u32, "InternalError"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The rule type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "RuleType")] +pub enum RuleType { + Binary, + BaselineExpected, + PositiveList, + NegativeList, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for RuleType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for RuleType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for RuleType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Binary => serializer.serialize_unit_variant("RuleType", 0u32, "Binary"), + Self::BaselineExpected => serializer.serialize_unit_variant("RuleType", 1u32, "BaselineExpected"), + Self::PositiveList => serializer.serialize_unit_variant("RuleType", 2u32, "PositiveList"), + Self::NegativeList => serializer.serialize_unit_variant("RuleType", 3u32, "NegativeList"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A list of rules results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RulesResults { + #[doc = "List of rule results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl RulesResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Rules results input."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct RulesResultsInput { + #[doc = "Take results from latest scan."] + #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] + pub latest_scan: Option, + #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option, +} +impl RulesResultsInput { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan record."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Scan { + #[serde(flatten)] + pub resource: Resource, + #[doc = "A vulnerability assessment scan record properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl Scan { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan record properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanProperties { + #[doc = "The scan trigger type."] + #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] + pub trigger_type: Option, + #[doc = "The scan status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The server name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub server: Option, + #[doc = "The database name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub database: Option, + #[doc = "The SQL version."] + #[serde(rename = "sqlVersion", default, skip_serializing_if = "Option::is_none")] + pub sql_version: Option, + #[doc = "The scan start time (UTC)."] + #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] + pub start_time: Option, + #[doc = "Scan results are valid until end time (UTC)."] + #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] + pub end_time: Option, + #[doc = "The number of failed rules with high severity."] + #[serde(rename = "highSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub high_severity_failed_rules_count: Option, + #[doc = "The number of failed rules with medium severity."] + #[serde(rename = "mediumSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub medium_severity_failed_rules_count: Option, + #[doc = "The number of failed rules with low severity."] + #[serde(rename = "lowSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub low_severity_failed_rules_count: Option, + #[doc = "The number of total passed rules."] + #[serde(rename = "totalPassedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_passed_rules_count: Option, + #[doc = "The number of total failed rules."] + #[serde(rename = "totalFailedRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_failed_rules_count: Option, + #[doc = "The number of total rules assessed."] + #[serde(rename = "totalRulesCount", default, skip_serializing_if = "Option::is_none")] + pub total_rules_count: Option, + #[doc = "Baseline created for this database, and has one or more rules."] + #[serde(rename = "isBaselineApplied", default, skip_serializing_if = "Option::is_none")] + pub is_baseline_applied: Option, + #[doc = "Last scan time."] + #[serde(rename = "lastScanTime", default, with = "azure_core::date::rfc3339::option")] + pub last_scan_time: Option, +} +impl ScanProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan result for a single rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResult { + #[serde(flatten)] + pub resource: Resource, + #[doc = "A vulnerability assessment scan result properties for a single rule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ScanResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A vulnerability assessment scan result properties for a single rule."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResultProperties { + #[doc = "The rule Id."] + #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + #[doc = "The rule result status."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Indicated whether the results specified here are trimmed."] + #[serde(rename = "isTrimmed", default, skip_serializing_if = "Option::is_none")] + pub is_trimmed: Option, + #[doc = "The results of the query that was run."] + #[serde( + rename = "queryResults", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub query_results: Vec>, + #[doc = "Remediation details."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remediation: Option, + #[doc = "The rule result adjusted with baseline."] + #[serde(rename = "baselineAdjustedResult", default, skip_serializing_if = "Option::is_none")] + pub baseline_adjusted_result: Option, + #[doc = "vulnerability assessment rule metadata details."] + #[serde(rename = "ruleMetadata", default, skip_serializing_if = "Option::is_none")] + pub rule_metadata: Option, +} +impl ScanResultProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A list of vulnerability assessment scan results."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScanResults { + #[doc = "List of vulnerability assessment scan results."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ScanResults { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The scan status."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScanState")] +pub enum ScanState { + Failed, + FailedToRun, + InProgress, + Passed, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScanState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScanState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScanState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Failed => serializer.serialize_unit_variant("ScanState", 0u32, "Failed"), + Self::FailedToRun => serializer.serialize_unit_variant("ScanState", 1u32, "FailedToRun"), + Self::InProgress => serializer.serialize_unit_variant("ScanState", 2u32, "InProgress"), + Self::Passed => serializer.serialize_unit_variant("ScanState", 3u32, "Passed"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "The scan trigger type."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "ScanTriggerType")] +pub enum ScanTriggerType { + OnDemand, + Recurring, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for ScanTriggerType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for ScanTriggerType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for ScanTriggerType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::OnDemand => serializer.serialize_unit_variant("ScanTriggerType", 0u32, "OnDemand"), + Self::Recurring => serializer.serialize_unit_variant("ScanTriggerType", 1u32, "Recurring"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "A list of vulnerability assessment scan records."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Scans { + #[doc = "List of vulnerability assessment scan records."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl Scans { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A more specific scope used to identify the alerts to suppress."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScopeElement { + #[doc = "The alert entity type to suppress by."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub field: Option, +} +impl ScopeElement { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ScoreDetails { + #[doc = "Maximum score available"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, + #[doc = "Current score"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + #[doc = "Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl ScoreDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Information about the security control."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionItem { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Security Control Definition Properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreControlDefinitionItem { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security Control Definition Properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionItemProperties { + #[doc = "User friendly display name of the control"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "User friendly description of the control"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Maximum control score (0..10)"] + #[serde(rename = "maxScore", default, skip_serializing_if = "Option::is_none")] + pub max_score: Option, + #[doc = "The type of the security control (For example, BuiltIn)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, + #[doc = "array of azure resource IDs"] + #[serde(rename = "assessmentDefinitions", default, skip_serializing_if = "Option::is_none")] + pub assessment_definitions: Option, +} +impl SecureScoreControlDefinitionItemProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The type of the security control (For example, BuiltIn)"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionSource { + #[doc = "The type of security control (for example, BuiltIn)"] + #[serde(rename = "sourceType", default, skip_serializing_if = "Option::is_none")] + pub source_type: Option, +} +impl SecureScoreControlDefinitionSource { + pub fn new() -> Self { + Self::default() + } +} +pub mod secure_score_control_definition_source { + use super::*; + #[doc = "The type of security control (for example, BuiltIn)"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SourceType")] + pub enum SourceType { + BuiltIn, + Custom, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SourceType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SourceType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SourceType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::BuiltIn => serializer.serialize_unit_variant("SourceType", 0u32, "BuiltIn"), + Self::Custom => serializer.serialize_unit_variant("SourceType", 1u32, "Custom"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Details of the security control, its score, and the health status of the relevant resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDetails { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Calculation result data in control level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreControlDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security controls"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlList { + #[doc = "Collection of security controls in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoreControlList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoreControlList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlScore { + #[doc = "Maximum control score (0..10)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max: Option, + #[doc = "Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + #[doc = "Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub percentage: Option, +} +impl SecureScoreControlScore { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Calculation result data in control level"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlScoreDetails { + #[doc = "User friendly display name of the control"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Calculation result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + #[doc = "Number of healthy resources in the control"] + #[serde(rename = "healthyResourceCount", default, skip_serializing_if = "Option::is_none")] + pub healthy_resource_count: Option, + #[doc = "Number of unhealthy resources in the control"] + #[serde(rename = "unhealthyResourceCount", default, skip_serializing_if = "Option::is_none")] + pub unhealthy_resource_count: Option, + #[doc = "Number of not applicable resources in the control"] + #[serde(rename = "notApplicableResourceCount", default, skip_serializing_if = "Option::is_none")] + pub not_applicable_resource_count: Option, + #[doc = "The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, + #[doc = "Information about the security control."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub definition: Option, +} +impl SecureScoreControlScoreDetails { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Secure score item data model"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreItem { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a calculated secure score."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecureScoreItem { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a calculated secure score."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreItemProperties { + #[doc = "The initiative’s name"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Calculation result data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + #[doc = "The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, +} +impl SecureScoreItemProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of secure scores"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoresList { + #[doc = "Collection of secure scores in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoresList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoresList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security assessment on a resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an assessment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Page of a security assessments list"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityAssessmentList { + #[doc = "Collection of security assessments in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityAssessmentList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security assessment metadata"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityAssessmentMetadata { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an assessment metadata."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityAssessmentMetadata { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes the partner that created the assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentMetadataPartnerData { + #[doc = "Name of the company of the partner"] + #[serde(rename = "partnerName")] + pub partner_name: String, + #[doc = "Name of the product of the partner that created the assessment"] + #[serde(rename = "productName", default, skip_serializing_if = "Option::is_none")] + pub product_name: Option, + #[doc = "Secret to authenticate the partner and verify it created the assessment - write only"] + pub secret: String, +} +impl SecurityAssessmentMetadataPartnerData { + pub fn new(partner_name: String, secret: String) -> Self { + Self { + partner_name, + product_name: None, + secret, + } + } +} +#[doc = "Describes properties of an assessment metadata."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentMetadataProperties { + #[doc = "User friendly display name of the assessment"] + #[serde(rename = "displayName")] + pub display_name: String, + #[doc = "Azure resource ID of the policy definition that turns this assessment calculation on"] + #[serde(rename = "policyDefinitionId", default, skip_serializing_if = "Option::is_none")] + pub policy_definition_id: Option, + #[doc = "Human readable description of the assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Human readable description of what you should do to mitigate this security issue"] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub categories: Vec, + #[doc = "The severity level of the assessment"] + pub severity: security_assessment_metadata_properties::Severity, + #[doc = "The user impact of the assessment"] + #[serde(rename = "userImpact", default, skip_serializing_if = "Option::is_none")] + pub user_impact: Option, + #[doc = "The implementation effort required to remediate this assessment"] + #[serde(rename = "implementationEffort", default, skip_serializing_if = "Option::is_none")] + pub implementation_effort: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub threats: Vec, + #[doc = "True if this assessment is in preview release status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preview: Option, + #[doc = "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition"] + #[serde(rename = "assessmentType")] + pub assessment_type: security_assessment_metadata_properties::AssessmentType, + #[doc = "Describes the partner that created the assessment"] + #[serde(rename = "partnerData", default, skip_serializing_if = "Option::is_none")] + pub partner_data: Option, +} +impl SecurityAssessmentMetadataProperties { + pub fn new( + display_name: String, + severity: security_assessment_metadata_properties::Severity, + assessment_type: security_assessment_metadata_properties::AssessmentType, + ) -> Self { + Self { + display_name, + policy_definition_id: None, + description: None, + remediation_description: None, + categories: Vec::new(), + severity, + user_impact: None, + implementation_effort: None, + threats: Vec::new(), + preview: None, + assessment_type, + partner_data: None, + } + } +} +pub mod security_assessment_metadata_properties { + use super::*; + #[doc = "The severity level of the assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Low => serializer.serialize_unit_variant("Severity", 0u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::High => serializer.serialize_unit_variant("Severity", 2u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The user impact of the assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "UserImpact")] + pub enum UserImpact { + Low, + Moderate, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for UserImpact { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for UserImpact { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for UserImpact { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Low => serializer.serialize_unit_variant("UserImpact", 0u32, "Low"), + Self::Moderate => serializer.serialize_unit_variant("UserImpact", 1u32, "Moderate"), + Self::High => serializer.serialize_unit_variant("UserImpact", 2u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The implementation effort required to remediate this assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ImplementationEffort")] + pub enum ImplementationEffort { + Low, + Moderate, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ImplementationEffort { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ImplementationEffort { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ImplementationEffort { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Low => serializer.serialize_unit_variant("ImplementationEffort", 0u32, "Low"), + Self::Moderate => serializer.serialize_unit_variant("ImplementationEffort", 1u32, "Moderate"), + Self::High => serializer.serialize_unit_variant("ImplementationEffort", 2u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "AssessmentType")] + pub enum AssessmentType { + BuiltIn, + CustomPolicy, + CustomerManaged, + VerifiedPartner, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for AssessmentType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for AssessmentType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for AssessmentType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::BuiltIn => serializer.serialize_unit_variant("AssessmentType", 0u32, "BuiltIn"), + Self::CustomPolicy => serializer.serialize_unit_variant("AssessmentType", 1u32, "CustomPolicy"), + Self::CustomerManaged => serializer.serialize_unit_variant("AssessmentType", 2u32, "CustomerManaged"), + Self::VerifiedPartner => serializer.serialize_unit_variant("AssessmentType", 3u32, "VerifiedPartner"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Describes properties of an assessment metadata response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentMetadataPropertiesResponse { + #[serde(flatten)] + pub security_assessment_metadata_properties: SecurityAssessmentMetadataProperties, + #[serde(rename = "publishDates", default, skip_serializing_if = "Option::is_none")] + pub publish_dates: Option, + #[serde(rename = "plannedDeprecationDate", default, skip_serializing_if = "Option::is_none")] + pub planned_deprecation_date: Option, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub tactics: Vec, + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub techniques: Vec, +} +impl SecurityAssessmentMetadataPropertiesResponse { + pub fn new(security_assessment_metadata_properties: SecurityAssessmentMetadataProperties) -> Self { + Self { + security_assessment_metadata_properties, + publish_dates: None, + planned_deprecation_date: None, + tactics: Vec::new(), + techniques: Vec::new(), + } + } +} +pub mod security_assessment_metadata_properties_response { + use super::*; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub struct PublishDates { + #[serde(rename = "GA", default, skip_serializing_if = "Option::is_none")] + pub ga: Option, + pub public: String, + } + impl PublishDates { + pub fn new(public: String) -> Self { + Self { ga: None, public } + } + } +} +#[doc = "Security assessment metadata response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityAssessmentMetadataResponse { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an assessment metadata response."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityAssessmentMetadataResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security assessment metadata"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityAssessmentMetadataResponseList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityAssessmentMetadataResponseList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityAssessmentMetadataResponseList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Data regarding 3rd party partner integration"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentPartnerData { + #[doc = "Name of the company of the partner"] + #[serde(rename = "partnerName")] + pub partner_name: String, + #[doc = "secret to authenticate the partner - write only"] + pub secret: String, +} +impl SecurityAssessmentPartnerData { + pub fn new(partner_name: String, secret: String) -> Self { + Self { partner_name, secret } + } +} +#[doc = "Describes properties of an assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentProperties { + #[serde(flatten)] + pub security_assessment_properties_base: SecurityAssessmentPropertiesBase, + #[doc = "The result of the assessment"] + pub status: AssessmentStatus, +} +impl SecurityAssessmentProperties { + pub fn new(security_assessment_properties_base: SecurityAssessmentPropertiesBase, status: AssessmentStatus) -> Self { + Self { + security_assessment_properties_base, + status, + } + } +} +#[doc = "Describes properties of an assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentPropertiesBase { + #[doc = "Details of the resource that was assessed"] + #[serde(rename = "resourceDetails")] + pub resource_details: ResourceDetails, + #[doc = "User friendly display name of the assessment"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Additional data regarding the assessment"] + #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] + pub additional_data: Option, + #[doc = "Links relevant to the assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub links: Option, + #[doc = "Describes properties of an assessment metadata."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + #[doc = "Data regarding 3rd party partner integration"] + #[serde(rename = "partnersData", default, skip_serializing_if = "Option::is_none")] + pub partners_data: Option, +} +impl SecurityAssessmentPropertiesBase { + pub fn new(resource_details: ResourceDetails) -> Self { + Self { + resource_details, + display_name: None, + additional_data: None, + links: None, + metadata: None, + partners_data: None, + } + } +} +#[doc = "Describes properties of an assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityAssessmentPropertiesResponse { + #[serde(flatten)] + pub security_assessment_properties_base: SecurityAssessmentPropertiesBase, + #[doc = "The result of the assessment"] + pub status: AssessmentStatusResponse, +} +impl SecurityAssessmentPropertiesResponse { + pub fn new(security_assessment_properties_base: SecurityAssessmentPropertiesBase, status: AssessmentStatusResponse) -> Self { + Self { + security_assessment_properties_base, + status, + } + } +} +#[doc = "Security assessment on a resource - response format"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityAssessmentResponse { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an assessment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityAssessmentResponse { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The security connector resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityConnector { + #[serde(flatten)] + pub tracked_resource: TrackedResource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "A set of properties that defines the security connector configuration."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityConnector { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A set of properties that defines the security connector configuration."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityConnectorProperties { + #[doc = "The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector)."] + #[serde(rename = "hierarchyIdentifier", default, skip_serializing_if = "Option::is_none")] + pub hierarchy_identifier: Option, + #[doc = "The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings."] + #[serde(rename = "hierarchyIdentifierTrialEndDate", default, with = "azure_core::date::rfc3339::option")] + pub hierarchy_identifier_trial_end_date: Option, + #[doc = "The multi cloud resource's cloud name."] + #[serde(rename = "environmentName", default, skip_serializing_if = "Option::is_none")] + pub environment_name: Option, + #[doc = "A collection of offerings for the security connector."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub offerings: Vec, + #[doc = "The security connector environment data."] + #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] + pub environment_data: Option, +} +impl SecurityConnectorProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_connector_properties { + use super::*; + #[doc = "The multi cloud resource's cloud name."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EnvironmentName")] + pub enum EnvironmentName { + Azure, + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + Github, + AzureDevOps, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EnvironmentName { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EnvironmentName { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EnvironmentName { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Azure => serializer.serialize_unit_variant("EnvironmentName", 0u32, "Azure"), + Self::Aws => serializer.serialize_unit_variant("EnvironmentName", 1u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("EnvironmentName", 2u32, "GCP"), + Self::Github => serializer.serialize_unit_variant("EnvironmentName", 3u32, "Github"), + Self::AzureDevOps => serializer.serialize_unit_variant("EnvironmentName", 4u32, "AzureDevOps"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "List of security connectors response."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecurityConnectorsList { + #[doc = "The list of security connectors under the given scope."] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityConnectorsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityConnectorsList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Contact details and configurations for notifications coming from Microsoft Defender for Cloud."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContact { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes security contact properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityContact { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security contacts response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContactList { + #[doc = "List of security contacts"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityContactList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityContactList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes security contact properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityContactProperties { + #[doc = "List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations defined in this security contact."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option, + #[doc = "The security contact's phone number"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[doc = "Defines whether to send email notifications about new security alerts"] + #[serde(rename = "alertNotifications", default, skip_serializing_if = "Option::is_none")] + pub alert_notifications: Option, + #[doc = "Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[serde(rename = "notificationsByRole", default, skip_serializing_if = "Option::is_none")] + pub notifications_by_role: Option, +} +impl SecurityContactProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod security_contact_properties { + use super::*; + #[doc = "Defines whether to send email notifications about new security alerts"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct AlertNotifications { + #[doc = "Defines if email notifications will be sent about new security alerts"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Defines the minimal alert severity which will be sent as email notifications"] + #[serde(rename = "minimalSeverity", default, skip_serializing_if = "Option::is_none")] + pub minimal_severity: Option, + } + impl AlertNotifications { + pub fn new() -> Self { + Self::default() + } + } + pub mod alert_notifications { + use super::*; + #[doc = "Defines if email notifications will be sent about new security alerts"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("State", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("State", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "Defines the minimal alert severity which will be sent as email notifications"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "MinimalSeverity")] + pub enum MinimalSeverity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for MinimalSeverity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for MinimalSeverity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for MinimalSeverity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("MinimalSeverity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("MinimalSeverity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("MinimalSeverity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NotificationsByRole { + #[doc = "Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC roles: "] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub roles: Vec, + } + impl NotificationsByRole { + pub fn new() -> Self { + Self::default() + } + } + pub mod notifications_by_role { + use super::*; + #[doc = "Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "State")] + pub enum State { + On, + Off, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for State { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for State { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for State { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::On => serializer.serialize_unit_variant("State", 0u32, "On"), + Self::Off => serializer.serialize_unit_variant("State", 1u32, "Off"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "A possible role to configure sending security notification alerts to"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "SecurityContactRole")] +pub enum SecurityContactRole { + AccountAdmin, + ServiceAdmin, + Owner, + Contributor, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for SecurityContactRole { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for SecurityContactRole { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for SecurityContactRole { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::AccountAdmin => serializer.serialize_unit_variant("SecurityContactRole", 0u32, "AccountAdmin"), + Self::ServiceAdmin => serializer.serialize_unit_variant("SecurityContactRole", 1u32, "ServiceAdmin"), + Self::Owner => serializer.serialize_unit_variant("SecurityContactRole", 2u32, "Owner"), + Self::Contributor => serializer.serialize_unit_variant("SecurityContactRole", 3u32, "Contributor"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySolution { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecuritySolution { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySolutionList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecuritySolutionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecuritySolutionList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecuritySolutionProperties { + #[doc = "The security family of the security solution"] + #[serde(rename = "securityFamily")] + pub security_family: security_solution_properties::SecurityFamily, + #[doc = "The security family provisioning State"] + #[serde(rename = "provisioningState")] + pub provisioning_state: security_solution_properties::ProvisioningState, + #[doc = "The security solutions' template"] + pub template: String, + #[doc = "The security solutions' status"] + #[serde(rename = "protectionStatus")] + pub protection_status: String, +} +impl SecuritySolutionProperties { + pub fn new( + security_family: security_solution_properties::SecurityFamily, + provisioning_state: security_solution_properties::ProvisioningState, + template: String, + protection_status: String, + ) -> Self { + Self { + security_family, + provisioning_state, + template, + protection_status, + } + } +} +pub mod security_solution_properties { + use super::*; + #[doc = "The security family of the security solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SecurityFamily")] + pub enum SecurityFamily { + Waf, + Ngfw, + SaasWaf, + Va, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SecurityFamily { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SecurityFamily { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SecurityFamily { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Waf => serializer.serialize_unit_variant("SecurityFamily", 0u32, "Waf"), + Self::Ngfw => serializer.serialize_unit_variant("SecurityFamily", 1u32, "Ngfw"), + Self::SaasWaf => serializer.serialize_unit_variant("SecurityFamily", 2u32, "SaasWaf"), + Self::Va => serializer.serialize_unit_variant("SecurityFamily", 3u32, "Va"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The security family provisioning State"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ProvisioningState")] + pub enum ProvisioningState { + Succeeded, + Failed, + Updating, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ProvisioningState { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ProvisioningState { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ProvisioningState { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Succeeded"), + Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Failed"), + Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Updating"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Security sub-assessment on a resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of an sub-assessment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecuritySubAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security sub-assessments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessmentList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecuritySubAssessmentList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecuritySubAssessmentList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of an sub-assessment."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySubAssessmentProperties { + #[doc = "Vulnerability ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "User friendly display name of the sub-assessment"] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Status of the sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Information on how to remediate this sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub remediation: Option, + #[doc = "Description of the impact of this sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub impact: Option, + #[doc = "Category of the sub-assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The date and time the sub-assessment was generated"] + #[serde(rename = "timeGenerated", default, with = "azure_core::date::rfc3339::option")] + pub time_generated: Option, + #[doc = "Details of the resource that was assessed"] + #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] + pub resource_details: Option, + #[doc = "Details of the sub-assessment"] + #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] + pub additional_data: Option, +} +impl SecuritySubAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Security task that we recommend to do in order to strengthen security"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTask { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Describes properties of a task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl SecurityTask { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of security task recommendations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecurityTaskList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecurityTaskList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Changing set of properties, depending on the task type that is derived from the name field"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskParameters { + #[doc = "Name of the task type"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +impl SecurityTaskParameters { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes properties of a task."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecurityTaskProperties { + #[doc = "State of the task (Active, Resolved etc.)"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[doc = "The time this task was discovered in UTC"] + #[serde(rename = "creationTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub creation_time_utc: Option, + #[doc = "Changing set of properties, depending on the task type that is derived from the name field"] + #[serde(rename = "securityTaskParameters", default, skip_serializing_if = "Option::is_none")] + pub security_task_parameters: Option, + #[doc = "The time this task's details were last changed in UTC"] + #[serde(rename = "lastStateChangeTimeUtc", default, with = "azure_core::date::rfc3339::option")] + pub last_state_change_time_utc: Option, + #[doc = "Additional data on the state of the task"] + #[serde(rename = "subState", default, skip_serializing_if = "Option::is_none")] + pub sub_state: Option, +} +impl SecurityTaskProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The sensitivity label."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SensitivityLabel { + #[doc = "The name of the sensitivity label."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rank of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + #[doc = "The order of the sensitivity label."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub order: Option, + #[doc = "Indicates whether the label is enabled or not."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl SensitivityLabel { + pub fn new() -> Self { + Self::default() + } +} +pub mod sensitivity_label { + use super::*; + #[doc = "The rank of the sensitivity label."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum Rank { + None, + Low, + Medium, + High, + Critical, + } +} +#[doc = "Describes the server vulnerability assessment details on a resource"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerVulnerabilityAssessment { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes ServerVulnerabilityAssessment properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl ServerVulnerabilityAssessment { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes ServerVulnerabilityAssessment properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerVulnerabilityAssessmentProperties { + #[doc = "The provisioningState of the vulnerability assessment capability on the VM"] + #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")] + pub provisioning_state: Option, +} +impl ServerVulnerabilityAssessmentProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod server_vulnerability_assessment_properties { + use super::*; + #[doc = "The provisioningState of the vulnerability assessment capability on the VM"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + pub enum ProvisioningState { + Succeeded, + Failed, + Canceled, + Provisioning, + Deprovisioning, + } +} +#[doc = "List of server vulnerability assessments"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServerVulnerabilityAssessmentsList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl ServerVulnerabilityAssessmentsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Additional context fields for server vulnerability assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServerVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Dictionary from cvss version to cvss details object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cvss: Option, + #[doc = "Indicates whether a patch is available or not"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patchable: Option, + #[doc = "List of CVEs"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub cve: Vec, + #[doc = "Threat name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub threat: Option, + #[doc = "Published time"] + #[serde(rename = "publishedTime", default, with = "azure_core::date::rfc3339::option")] + pub published_time: Option, + #[serde( + rename = "vendorReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub vendor_references: Vec, +} +impl ServerVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + cvss: None, + patchable: None, + cve: Vec::new(), + threat: None, + published_time: None, + vendor_references: Vec::new(), + } + } +} +#[doc = "Details of the service principal."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ServicePrincipalProperties { + #[doc = "Application ID of service principal."] + #[serde(rename = "applicationId", default, skip_serializing_if = "Option::is_none")] + pub application_id: Option, + #[doc = "A secret string that the application uses to prove its identity, also can be referred to as application password (write only)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub secret: Option, +} +impl ServicePrincipalProperties { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The kind of the security setting"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Setting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "the kind of the settings string"] + pub kind: setting::Kind, +} +impl Setting { + pub fn new(kind: setting::Kind) -> Self { + Self { + resource: Resource::default(), + kind, + } + } +} +pub mod setting { + use super::*; + #[doc = "the kind of the settings string"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Kind")] + pub enum Kind { + DataExportSettings, + AlertSuppressionSetting, + AlertSyncSettings, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Kind { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Kind { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Kind { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::DataExportSettings => serializer.serialize_unit_variant("Kind", 0u32, "DataExportSettings"), + Self::AlertSuppressionSetting => serializer.serialize_unit_variant("Kind", 1u32, "AlertSuppressionSetting"), + Self::AlertSyncSettings => serializer.serialize_unit_variant("Kind", 2u32, "AlertSyncSettings"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Subscription settings list."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SettingsList { + #[doc = "The settings list."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SettingsList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SettingsList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a software data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Software { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Software Inventory resource properties"] + pub properties: SoftwareProperties, +} +impl Software { + pub fn new(properties: SoftwareProperties) -> Self { + Self { + resource: Resource::default(), + properties, + } + } +} +#[doc = "Software Inventory resource properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoftwareProperties { + #[doc = "Unique identifier for the virtual machine in the service."] + #[serde(rename = "deviceId", default, skip_serializing_if = "Option::is_none")] + pub device_id: Option, + #[doc = "Platform of the operating system running on the device."] + #[serde(rename = "osPlatform", default, skip_serializing_if = "Option::is_none")] + pub os_platform: Option, + #[doc = "Name of the software vendor."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vendor: Option, + #[doc = "Name of the software product."] + #[serde(rename = "softwareName", default, skip_serializing_if = "Option::is_none")] + pub software_name: Option, + #[doc = "Version number of the software product."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "End of support status."] + #[serde(rename = "endOfSupportStatus", default, skip_serializing_if = "Option::is_none")] + pub end_of_support_status: Option, + #[doc = "The end of support date in case the product is upcoming end of support."] + #[serde(rename = "endOfSupportDate", default, skip_serializing_if = "Option::is_none")] + pub end_of_support_date: Option, + #[doc = "Number of weaknesses."] + #[serde(rename = "numberOfKnownVulnerabilities", default, skip_serializing_if = "Option::is_none")] + pub number_of_known_vulnerabilities: Option, + #[doc = "First time that the software was seen in the device."] + #[serde(rename = "firstSeenAt", default, skip_serializing_if = "Option::is_none")] + pub first_seen_at: Option, +} +impl SoftwareProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod software_properties { + use super::*; + #[doc = "End of support status."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "EndOfSupportStatus")] + pub enum EndOfSupportStatus { + None, + #[serde(rename = "noLongerSupported")] + NoLongerSupported, + #[serde(rename = "versionNoLongerSupported")] + VersionNoLongerSupported, + #[serde(rename = "upcomingNoLongerSupported")] + UpcomingNoLongerSupported, + #[serde(rename = "upcomingVersionNoLongerSupported")] + UpcomingVersionNoLongerSupported, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for EndOfSupportStatus { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for EndOfSupportStatus { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for EndOfSupportStatus { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::None => serializer.serialize_unit_variant("EndOfSupportStatus", 0u32, "None"), + Self::NoLongerSupported => serializer.serialize_unit_variant("EndOfSupportStatus", 1u32, "noLongerSupported"), + Self::VersionNoLongerSupported => serializer.serialize_unit_variant("EndOfSupportStatus", 2u32, "versionNoLongerSupported"), + Self::UpcomingNoLongerSupported => { + serializer.serialize_unit_variant("EndOfSupportStatus", 3u32, "upcomingNoLongerSupported") + } + Self::UpcomingVersionNoLongerSupported => { + serializer.serialize_unit_variant("EndOfSupportStatus", 4u32, "upcomingVersionNoLongerSupported") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Represents the software inventory of the virtual machine."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SoftwaresList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SoftwaresList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SoftwaresList { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The source type of the machine group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum SourceSystem { + #[serde(rename = "Azure_AppLocker")] + AzureAppLocker, + #[serde(rename = "Azure_AuditD")] + AzureAuditD, + #[serde(rename = "NonAzure_AppLocker")] + NonAzureAppLocker, + #[serde(rename = "NonAzure_AuditD")] + NonAzureAuditD, + None, +} +#[doc = "Details of the resource that was assessed"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SqlServerVulnerabilityProperties { + #[serde(flatten)] + pub additional_data: AdditionalData, + #[doc = "The resource type the sub assessment refers to in its resource details"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The T-SQL query that runs on your SQL database to perform the particular check"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub query: Option, +} +impl SqlServerVulnerabilityProperties { + pub fn new(additional_data: AdditionalData) -> Self { + Self { + additional_data, + type_: None, + query: None, + } + } +} +#[doc = "Status of the sub-assessment"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SubAssessmentStatus { + #[doc = "Programmatic code for the status of the assessment"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "Programmatic code for the cause of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cause: Option, + #[doc = "Human readable description of the assessment status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The sub-assessment severity level"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, +} +impl SubAssessmentStatus { + pub fn new() -> Self { + Self::default() + } +} +pub mod sub_assessment_status { + use super::*; + #[doc = "Programmatic code for the status of the assessment"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Code")] + pub enum Code { + Healthy, + Unhealthy, + NotApplicable, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Code { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Code { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Code { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Healthy => serializer.serialize_unit_variant("Code", 0u32, "Healthy"), + Self::Unhealthy => serializer.serialize_unit_variant("Code", 1u32, "Unhealthy"), + Self::NotApplicable => serializer.serialize_unit_variant("Code", 2u32, "NotApplicable"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The sub-assessment severity level"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + Low, + Medium, + High, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Low => serializer.serialize_unit_variant("Severity", 0u32, "Low"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::High => serializer.serialize_unit_variant("Severity", 2u32, "High"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SuppressionAlertsScope { + #[doc = "All the conditions inside need to be true in order to suppress the alert"] + #[serde(rename = "allOf")] + pub all_of: Vec, +} +impl SuppressionAlertsScope { + pub fn new(all_of: Vec) -> Self { + Self { all_of } + } +} +#[doc = "A list of key value pairs that describe the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Tags { + #[doc = "A list of key value pairs that describe the resource."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl Tags { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A container holding only the Tags for a resource, allowing the user to update the tags."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TagsResource { + #[doc = "Resource tags"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, +} +impl TagsResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "A custom alert rule that checks if a value (depends on the custom alert type) is within the given range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ThresholdCustomAlertRule { + #[serde(flatten)] + pub custom_alert_rule: CustomAlertRule, + #[doc = "The minimum threshold."] + #[serde(rename = "minThreshold")] + pub min_threshold: i32, + #[doc = "The maximum threshold."] + #[serde(rename = "maxThreshold")] + pub max_threshold: i32, +} +impl ThresholdCustomAlertRule { + pub fn new(custom_alert_rule: CustomAlertRule, min_threshold: i32, max_threshold: i32) -> Self { + Self { + custom_alert_rule, + min_threshold, + max_threshold, + } + } +} +#[doc = "A custom alert rule that checks if the number of activities (depends on the custom alert type) in a time window is within the given range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TimeWindowCustomAlertRule { + #[serde(flatten)] + pub threshold_custom_alert_rule: ThresholdCustomAlertRule, + #[doc = "The time window size in iso8601 format."] + #[serde(rename = "timeWindowSize")] + pub time_window_size: String, +} +impl TimeWindowCustomAlertRule { + pub fn new(threshold_custom_alert_rule: ThresholdCustomAlertRule, time_window_size: String) -> Self { + Self { + threshold_custom_alert_rule, + time_window_size, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for TopologyList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl TopologyList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl TopologyResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologyResourceProperties { + #[doc = "The UTC time on which the topology was calculated"] + #[serde(rename = "calculatedDateTime", default, with = "azure_core::date::rfc3339::option")] + pub calculated_date_time: Option, + #[doc = "Azure resources which are part of this topology resource"] + #[serde( + rename = "topologyResources", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub topology_resources: Vec, +} +impl TopologyResourceProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResource { + #[doc = "Azure resource id"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The security severity of the resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "Indicates if the resource has security recommendations"] + #[serde(rename = "recommendationsExist", default, skip_serializing_if = "Option::is_none")] + pub recommendations_exist: Option, + #[doc = "Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.)"] + #[serde(rename = "networkZones", default, skip_serializing_if = "Option::is_none")] + pub network_zones: Option, + #[doc = "Score of the resource based on its security severity"] + #[serde(rename = "topologyScore", default, skip_serializing_if = "Option::is_none")] + pub topology_score: Option, + #[doc = "The location of this resource"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "Azure resources connected to this resource which are in higher level in the topology view"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub parents: Vec, + #[doc = "Azure resources connected to this resource which are in lower level in the topology view"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub children: Vec, +} +impl TopologySingleResource { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResourceChild { + #[doc = "Azure resource id which serves as child resource in topology view"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl TopologySingleResourceChild { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TopologySingleResourceParent { + #[doc = "Azure resource id which serves as parent resource in topology view"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, +} +impl TopologySingleResourceParent { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Describes an Azure tracked resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct TrackedResource { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub azure_tracked_resource_location: AzureTrackedResourceLocation, + #[serde(flatten)] + pub kind: Kind, + #[serde(flatten)] + pub e_tag: ETag, + #[serde(flatten)] + pub tags: Tags, +} +impl TrackedResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Number of twin updates is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TwinUpdatesNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl TwinUpdatesNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Number of unauthorized operations is not in allowed range."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UnauthorizedOperationsNotInAllowedRange { + #[serde(flatten)] + pub time_window_custom_alert_rule: TimeWindowCustomAlertRule, +} +impl UnauthorizedOperationsNotInAllowedRange { + pub fn new(time_window_custom_alert_rule: TimeWindowCustomAlertRule) -> Self { + Self { + time_window_custom_alert_rule, + } + } +} +#[doc = "Update Security Solution setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateIoTSecuritySolutionProperties { + #[doc = "Properties of the IoT Security solution's user defined resources."] + #[serde(rename = "userDefinedResources", default, skip_serializing_if = "Option::is_none")] + pub user_defined_resources: Option, + #[doc = "List of the configuration status for each recommendation type."] + #[serde(rename = "recommendationsConfiguration", default, skip_serializing_if = "Option::is_none")] + pub recommendations_configuration: Option, +} +impl UpdateIoTSecuritySolutionProperties { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UpdateIotSecuritySolutionData { + #[serde(flatten)] + pub tags_resource: TagsResource, + #[doc = "Update Security Solution setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl UpdateIotSecuritySolutionData { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Properties of the IoT Security solution's user defined resources."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserDefinedResourcesProperties { + #[doc = "Azure Resource Graph query which represents the security solution's user defined resources. Required to start with \"where type != \"Microsoft.Devices/IotHubs\"\""] + pub query: String, + #[doc = "List of Azure subscription ids on which the user defined resources query should be executed."] + #[serde(rename = "querySubscriptions")] + pub query_subscriptions: Vec, +} +impl UserDefinedResourcesProperties { + pub fn new(query: String, query_subscriptions: Vec) -> Self { + Self { + query, + query_subscriptions, + } + } +} +#[doc = "Represents a user that is recommended to be allowed for a certain rule"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct UserRecommendation { + #[doc = "Represents a user that is recommended to be allowed for a certain rule"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The recommendation action of the machine or rule"] + #[serde(rename = "recommendationAction", default, skip_serializing_if = "Option::is_none")] + pub recommendation_action: Option, +} +impl UserRecommendation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "vulnerability assessment rule metadata details."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VaRule { + #[doc = "The rule Id."] + #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + #[doc = "The rule severity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The rule category."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option, + #[doc = "The rule type."] + #[serde(rename = "ruleType", default, skip_serializing_if = "Option::is_none")] + pub rule_type: Option, + #[doc = "The rule title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "The rule description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rule rationale."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rationale: Option, + #[doc = "The rule query details."] + #[serde(rename = "queryCheck", default, skip_serializing_if = "Option::is_none")] + pub query_check: Option, + #[doc = "The benchmark references."] + #[serde( + rename = "benchmarkReferences", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub benchmark_references: Vec, +} +impl VaRule { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Vendor reference"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VendorReference { + #[doc = "Link title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Link url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub link: Option, +} +impl VendorReference { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Represents a machine that is part of a machine group"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct VmRecommendation { + #[doc = "The configuration status of the machines group or machine or rule"] + #[serde(rename = "configurationStatus", default, skip_serializing_if = "Option::is_none")] + pub configuration_status: Option, + #[doc = "The recommendation action of the machine or rule"] + #[serde(rename = "recommendationAction", default, skip_serializing_if = "Option::is_none")] + pub recommendation_action: Option, + #[doc = "The full resource id of the machine"] + #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + #[doc = "The machine supportability of Enforce feature"] + #[serde(rename = "enforcementSupport", default, skip_serializing_if = "Option::is_none")] + pub enforcement_support: Option, +} +impl VmRecommendation { + pub fn new() -> Self { + Self::default() + } +} +pub type VmRecommendations = Vec; +pub type VmResourceId = String; +#[doc = "Configures where to store the OMS agent data for workspaces under a scope"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct WorkspaceSetting { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Workspace setting data"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl WorkspaceSetting { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "List of workspace settings response"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceSettingList { + #[doc = "List of workspace settings"] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for WorkspaceSettingList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl WorkspaceSettingList { + pub fn new(value: Vec) -> Self { + Self { value, next_link: None } + } +} +#[doc = "Workspace setting data"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WorkspaceSettingProperties { + #[doc = "The full Azure ID of the workspace to save the data in"] + #[serde(rename = "workspaceId")] + pub workspace_id: String, + #[doc = "All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope"] + pub scope: String, +} +impl WorkspaceSettingProperties { + pub fn new(workspace_id: String, scope: String) -> Self { + Self { workspace_id, scope } + } +} +#[doc = "The security offering details"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CloudOffering { + #[doc = "The type of the security offering."] + #[serde(rename = "offeringType")] + pub offering_type: cloud_offering::OfferingType, + #[doc = "The offering description."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl CloudOffering { + pub fn new(offering_type: cloud_offering::OfferingType) -> Self { + Self { + offering_type, + description: None, + } + } +} +pub mod cloud_offering { + use super::*; + #[doc = "The type of the security offering."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "OfferingType")] + pub enum OfferingType { + CspmMonitorAws, + DefenderForContainersAws, + DefenderForServersAws, + DefenderForDatabasesAws, + InformationProtectionAws, + CspmMonitorGcp, + CspmMonitorGithub, + CspmMonitorAzureDevOps, + DefenderForServersGcp, + DefenderForContainersGcp, + DefenderForDatabasesGcp, + DefenderCspmAws, + DefenderCspmGcp, + DefenderForDevOpsGithub, + DefenderForDevOpsAzureDevOps, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for OfferingType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for OfferingType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for OfferingType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::CspmMonitorAws => serializer.serialize_unit_variant("OfferingType", 0u32, "CspmMonitorAws"), + Self::DefenderForContainersAws => serializer.serialize_unit_variant("OfferingType", 1u32, "DefenderForContainersAws"), + Self::DefenderForServersAws => serializer.serialize_unit_variant("OfferingType", 2u32, "DefenderForServersAws"), + Self::DefenderForDatabasesAws => serializer.serialize_unit_variant("OfferingType", 3u32, "DefenderForDatabasesAws"), + Self::InformationProtectionAws => serializer.serialize_unit_variant("OfferingType", 4u32, "InformationProtectionAws"), + Self::CspmMonitorGcp => serializer.serialize_unit_variant("OfferingType", 5u32, "CspmMonitorGcp"), + Self::CspmMonitorGithub => serializer.serialize_unit_variant("OfferingType", 6u32, "CspmMonitorGithub"), + Self::CspmMonitorAzureDevOps => serializer.serialize_unit_variant("OfferingType", 7u32, "CspmMonitorAzureDevOps"), + Self::DefenderForServersGcp => serializer.serialize_unit_variant("OfferingType", 8u32, "DefenderForServersGcp"), + Self::DefenderForContainersGcp => serializer.serialize_unit_variant("OfferingType", 9u32, "DefenderForContainersGcp"), + Self::DefenderForDatabasesGcp => serializer.serialize_unit_variant("OfferingType", 10u32, "DefenderForDatabasesGcp"), + Self::DefenderCspmAws => serializer.serialize_unit_variant("OfferingType", 11u32, "DefenderCspmAws"), + Self::DefenderCspmGcp => serializer.serialize_unit_variant("OfferingType", 12u32, "DefenderCspmGcp"), + Self::DefenderForDevOpsGithub => serializer.serialize_unit_variant("OfferingType", 13u32, "DefenderForDevOpsGithub"), + Self::DefenderForDevOpsAzureDevOps => { + serializer.serialize_unit_variant("OfferingType", 14u32, "DefenderForDevOpsAzureDevOps") + } + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "The CSPM monitoring for AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, +} +impl CspmMonitorAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + } + } +} +pub mod cspm_monitor_aws_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The CSPM monitoring for AzureDevOps offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorAzureDevOpsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl CspmMonitorAzureDevOpsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The CSPM monitoring for GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, +} +impl CspmMonitorGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + } + } +} +pub mod cspm_monitor_gcp_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The GCP workload identity provider id for the offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The CSPM monitoring for github offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CspmMonitorGithubOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl CspmMonitorGithubOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "Custom Assessment Automation"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomation { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Metadata pertaining to creation and last modification of the resource."] + #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] + pub system_data: Option, + #[doc = "describes the Custom Assessment Automation properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomAssessmentAutomation { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the Custom Assessment Automation properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationProperties { + #[doc = "GZip encoded KQL query representing the assessment automation results required."] + #[serde(rename = "compressedQuery", default, skip_serializing_if = "Option::is_none")] + pub compressed_query: Option, + #[doc = "Relevant cloud for the custom assessment automation."] + #[serde(rename = "supportedCloud", default, skip_serializing_if = "Option::is_none")] + pub supported_cloud: Option, + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The display name of the assessments generated by this assessment automation."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The remediation description to relate to the assessments generated by this assessment automation."] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, + #[doc = "The assessment metadata key used when an assessment is generated for this assessment automation."] + #[serde(rename = "assessmentKey", default, skip_serializing_if = "Option::is_none")] + pub assessment_key: Option, +} +impl CustomAssessmentAutomationProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod custom_assessment_automation_properties { + use super::*; + #[doc = "Relevant cloud for the custom assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SupportedCloud")] + pub enum SupportedCloud { + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SupportedCloud { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SupportedCloud { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SupportedCloud { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("SupportedCloud", 0u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("SupportedCloud", 1u32, "GCP"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("Severity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("Severity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Custom Assessment Automation request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationRequest { + #[serde(flatten)] + pub resource: Resource, + #[doc = "describes the Custom Assessment Automation properties"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl CustomAssessmentAutomationRequest { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "describes the Custom Assessment Automation properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationRequestProperties { + #[doc = "Base 64 encoded KQL query representing the assessment automation results required."] + #[serde(rename = "compressedQuery", default, skip_serializing_if = "Option::is_none")] + pub compressed_query: Option, + #[doc = "Relevant cloud for the custom assessment automation."] + #[serde(rename = "supportedCloud", default, skip_serializing_if = "Option::is_none")] + pub supported_cloud: Option, + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub severity: Option, + #[doc = "The display name of the assessments generated by this assessment automation."] + #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The description to relate to the assessments generated by this assessment automation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The remediation description to relate to the assessments generated by this assessment automation."] + #[serde(rename = "remediationDescription", default, skip_serializing_if = "Option::is_none")] + pub remediation_description: Option, +} +impl CustomAssessmentAutomationRequestProperties { + pub fn new() -> Self { + Self::default() + } +} +pub mod custom_assessment_automation_request_properties { + use super::*; + #[doc = "Relevant cloud for the custom assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SupportedCloud")] + pub enum SupportedCloud { + #[serde(rename = "AWS")] + Aws, + #[serde(rename = "GCP")] + Gcp, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SupportedCloud { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SupportedCloud { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SupportedCloud { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Aws => serializer.serialize_unit_variant("SupportedCloud", 0u32, "AWS"), + Self::Gcp => serializer.serialize_unit_variant("SupportedCloud", 1u32, "GCP"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The severity to relate to the assessments generated by this assessment automation."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Severity")] + pub enum Severity { + High, + Medium, + Low, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Severity { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Severity { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Severity { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::High => serializer.serialize_unit_variant("Severity", 0u32, "High"), + Self::Medium => serializer.serialize_unit_variant("Severity", 1u32, "Medium"), + Self::Low => serializer.serialize_unit_variant("Severity", 2u32, "Low"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "A list of Custom Assessment Automations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct CustomAssessmentAutomationsListResult { + #[doc = "Collection of Custom Assessment Automations"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The link used to get the next page of operations."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for CustomAssessmentAutomationsListResult { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl CustomAssessmentAutomationsListResult { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The CSPM P1 for Aws offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderCspmAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] + pub vm_scanners: Option, +} +impl DefenderCspmAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + vm_scanners: None, + } + } +} +pub mod defender_cspm_aws_offering { + use super::*; + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VmScanners { + #[doc = "Is Microsoft Defender for Server VM scanning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VmScanners { + pub fn new() -> Self { + Self::default() + } + } + pub mod vm_scanners { + use super::*; + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + #[doc = "The scanning mode for the vm scan."] + #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] + pub scanning_mode: Option, + #[doc = "VM tags that indicates that VM should not be scanned"] + #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] + pub exclusion_tags: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The scanning mode for the vm scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ScanningMode")] + pub enum ScanningMode { + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ScanningMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ScanningMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ScanningMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "The CSPM P1 for GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderCspmGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderCspmGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for Databases AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderFoDatabasesAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The RDS configuration"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rds: Option, +} +impl DefenderFoDatabasesAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + arc_auto_provisioning: None, + rds: None, + } + } +} +pub mod defender_fo_databases_aws_offering { + use super::*; + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The RDS configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Rds { + #[doc = "Is RDS protection enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl Rds { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for Containers AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForContainersAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The kubernetes service connection configuration"] + #[serde(rename = "kubernetesService", default, skip_serializing_if = "Option::is_none")] + pub kubernetes_service: Option, + #[doc = "The kubernetes to scuba connection configuration"] + #[serde(rename = "kubernetesScubaReader", default, skip_serializing_if = "Option::is_none")] + pub kubernetes_scuba_reader: Option, + #[doc = "The cloudwatch to kinesis connection configuration"] + #[serde(rename = "cloudWatchToKinesis", default, skip_serializing_if = "Option::is_none")] + pub cloud_watch_to_kinesis: Option, + #[doc = "The kinesis to s3 connection configuration"] + #[serde(rename = "kinesisToS3", default, skip_serializing_if = "Option::is_none")] + pub kinesis_to_s3: Option, + #[doc = "The container vulnerability assessment configuration"] + #[serde(rename = "containerVulnerabilityAssessment", default, skip_serializing_if = "Option::is_none")] + pub container_vulnerability_assessment: Option, + #[doc = "The container vulnerability assessment task configuration"] + #[serde(rename = "containerVulnerabilityAssessmentTask", default, skip_serializing_if = "Option::is_none")] + pub container_vulnerability_assessment_task: Option, + #[doc = "Enable container vulnerability assessment feature"] + #[serde( + rename = "enableContainerVulnerabilityAssessment", + default, + skip_serializing_if = "Option::is_none" + )] + pub enable_container_vulnerability_assessment: Option, + #[doc = "Is audit logs pipeline auto provisioning enabled"] + #[serde(rename = "autoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub auto_provisioning: Option, + #[doc = "The retention time in days of kube audit logs set on the CloudWatch log group"] + #[serde(rename = "kubeAuditRetentionTime", default, skip_serializing_if = "Option::is_none")] + pub kube_audit_retention_time: Option, + #[doc = "The externalId used by the data reader to prevent the confused deputy attack"] + #[serde(rename = "scubaExternalId", default, skip_serializing_if = "Option::is_none")] + pub scuba_external_id: Option, +} +impl DefenderForContainersAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + kubernetes_service: None, + kubernetes_scuba_reader: None, + cloud_watch_to_kinesis: None, + kinesis_to_s3: None, + container_vulnerability_assessment: None, + container_vulnerability_assessment_task: None, + enable_container_vulnerability_assessment: None, + auto_provisioning: None, + kube_audit_retention_time: None, + scuba_external_id: None, + } + } +} +pub mod defender_for_containers_aws_offering { + use super::*; + #[doc = "The kubernetes service connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KubernetesService { + #[doc = "The cloud role ARN in AWS for this feature used for provisioning resources"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KubernetesService { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The kubernetes to scuba connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KubernetesScubaReader { + #[doc = "The cloud role ARN in AWS for this feature used for reading data"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KubernetesScubaReader { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The cloudwatch to kinesis connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct CloudWatchToKinesis { + #[doc = "The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl CloudWatchToKinesis { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The kinesis to s3 connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct KinesisToS3 { + #[doc = "The cloud role ARN in AWS used by Kinesis to transfer data into S3"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl KinesisToS3 { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The container vulnerability assessment configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ContainerVulnerabilityAssessment { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ContainerVulnerabilityAssessment { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The container vulnerability assessment task configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ContainerVulnerabilityAssessmentTask { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ContainerVulnerabilityAssessmentTask { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The containers GCP offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForContainersGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub native_cloud_connection: Option, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "dataPipelineNativeCloudConnection", default, skip_serializing_if = "Option::is_none")] + pub data_pipeline_native_cloud_connection: Option, + #[doc = "Is audit logs data collection enabled"] + #[serde(rename = "auditLogsAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub audit_logs_auto_provisioning_flag: Option, + #[doc = "Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled"] + #[serde(rename = "defenderAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub defender_agent_auto_provisioning_flag: Option, + #[doc = "Is Policy Kubernetes agent auto provisioning enabled"] + #[serde(rename = "policyAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] + pub policy_agent_auto_provisioning_flag: Option, +} +impl DefenderForContainersGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + native_cloud_connection: None, + data_pipeline_native_cloud_connection: None, + audit_logs_auto_provisioning_flag: None, + defender_agent_auto_provisioning_flag: None, + policy_agent_auto_provisioning_flag: None, + } + } +} +pub mod defender_for_containers_gcp_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct NativeCloudConnection { + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl NativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DataPipelineNativeCloudConnection { + #[doc = "The data collection service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The data collection GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl DataPipelineNativeCloudConnection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for Databases GCP offering configurations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDatabasesGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The native cloud connection configuration"] + #[serde( + rename = "defenderForDatabasesArcAutoProvisioning", + default, + skip_serializing_if = "Option::is_none" + )] + pub defender_for_databases_arc_auto_provisioning: Option, +} +impl DefenderForDatabasesGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + arc_auto_provisioning: None, + defender_for_databases_arc_auto_provisioning: None, + } + } +} +pub mod defender_for_databases_gcp_offering { + use super::*; + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForDatabasesArcAutoProvisioning { + #[doc = "The service account email address in GCP for this offering"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + #[doc = "The GCP workload identity provider id for this offering"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + } + impl DefenderForDatabasesArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "The Defender for DevOps for Azure DevOps offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDevOpsAzureDevOpsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderForDevOpsAzureDevOpsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for DevOps for Github offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForDevOpsGithubOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, +} +impl DefenderForDevOpsGithubOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { cloud_offering } + } +} +#[doc = "The Defender for Servers AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForServersAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Defender for servers connection configuration"] + #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] + pub defender_for_servers: Option, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub va_auto_provisioning: Option, + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub mde_auto_provisioning: Option, + #[doc = "configuration for the servers offering subPlan"] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] + pub vm_scanners: Option, +} +impl DefenderForServersAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + defender_for_servers: None, + arc_auto_provisioning: None, + va_auto_provisioning: None, + mde_auto_provisioning: None, + sub_plan: None, + vm_scanners: None, + } + } +} +pub mod defender_for_servers_aws_offering { + use super::*; + #[doc = "The Defender for servers connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForServers { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl DefenderForServers { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VaAutoProvisioning { + #[doc = "Is Vulnerability Assessment auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VaAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + pub mod va_auto_provisioning { + use super::*; + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Qualys, + #[serde(rename = "TVM")] + Tvm, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), + Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MdeAutoProvisioning { + #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl MdeAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "configuration for the servers offering subPlan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SubPlan { + #[doc = "The available sub plans"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SubPlan { + pub fn new() -> Self { + Self::default() + } + } + pub mod sub_plan { + use super::*; + #[doc = "The available sub plans"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + P1, + P2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + #[doc = "The Microsoft Defender for Server VM scanning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VmScanners { + #[doc = "Is Microsoft Defender for Server VM scanning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VmScanners { + pub fn new() -> Self { + Self::default() + } + } + pub mod vm_scanners { + use super::*; + #[doc = "configuration for Microsoft Defender for Server VM scanning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + #[doc = "The scanning mode for the vm scan."] + #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] + pub scanning_mode: Option, + #[doc = "VM tags that indicates that VM should not be scanned"] + #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] + pub exclusion_tags: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The scanning mode for the vm scan."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "ScanningMode")] + pub enum ScanningMode { + Default, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for ScanningMode { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for ScanningMode { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for ScanningMode { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } +} +#[doc = "The Defender for Servers GCP offering configurations"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DefenderForServersGcpOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The Defender for servers connection configuration"] + #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] + pub defender_for_servers: Option, + #[doc = "The ARC autoprovisioning configuration"] + #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub arc_auto_provisioning: Option, + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub va_auto_provisioning: Option, + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] + pub mde_auto_provisioning: Option, + #[doc = "configuration for the servers offering subPlan"] + #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] + pub sub_plan: Option, +} +impl DefenderForServersGcpOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + defender_for_servers: None, + arc_auto_provisioning: None, + va_auto_provisioning: None, + mde_auto_provisioning: None, + sub_plan: None, + } + } +} +pub mod defender_for_servers_gcp_offering { + use super::*; + #[doc = "The Defender for servers connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct DefenderForServers { + #[doc = "The workload identity provider id in GCP for this feature"] + #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] + pub workload_identity_provider_id: Option, + #[doc = "The service account email address in GCP for this feature"] + #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] + pub service_account_email_address: Option, + } + impl DefenderForServers { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The ARC autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct ArcAutoProvisioning { + #[doc = "Is arc auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + } + impl ArcAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "The Vulnerability Assessment autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct VaAutoProvisioning { + #[doc = "Is Vulnerability Assessment auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl VaAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + pub mod va_auto_provisioning { + use super::*; + #[doc = "configuration for Vulnerability Assessment autoprovisioning"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct Configuration { + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } + pub mod configuration { + use super::*; + #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + Qualys, + #[serde(rename = "TVM")] + Tvm, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), + Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } + } + #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct MdeAutoProvisioning { + #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub configuration: Option, + } + impl MdeAutoProvisioning { + pub fn new() -> Self { + Self::default() + } + } + #[doc = "configuration for the servers offering subPlan"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct SubPlan { + #[doc = "The available sub plans"] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + } + impl SubPlan { + pub fn new() -> Self { + Self::default() + } + } + pub mod sub_plan { + use super::*; + #[doc = "The available sub plans"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "Type")] + pub enum Type { + P1, + P2, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for Type { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for Type { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for Type { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), + Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + } +} +#[doc = "The information protection for AWS offering"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct InformationProtectionAwsOffering { + #[serde(flatten)] + pub cloud_offering: CloudOffering, + #[doc = "The native cloud connection configuration"] + #[serde(rename = "informationProtection", default, skip_serializing_if = "Option::is_none")] + pub information_protection: Option, +} +impl InformationProtectionAwsOffering { + pub fn new(cloud_offering: CloudOffering) -> Self { + Self { + cloud_offering, + information_protection: None, + } + } +} +pub mod information_protection_aws_offering { + use super::*; + #[doc = "The native cloud connection configuration"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] + pub struct InformationProtection { + #[doc = "The cloud role ARN in AWS for this feature"] + #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] + pub cloud_role_arn: Option, + } + impl InformationProtection { + pub fn new() -> Self { + Self::default() + } + } +} +#[doc = "List of security controls definition"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecureScoreControlDefinitionList { + #[doc = "Collection of security controls definition in this page"] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, + #[doc = "The URI to fetch the next page."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +impl azure_core::Continuable for SecureScoreControlDefinitionList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl SecureScoreControlDefinitionList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecuritySolutionsReferenceData { + #[serde(flatten)] + pub resource: Resource, + #[serde(flatten)] + pub location: Location, + pub properties: SecuritySolutionsReferenceDataProperties, +} +impl SecuritySolutionsReferenceData { + pub fn new(properties: SecuritySolutionsReferenceDataProperties) -> Self { + Self { + resource: Resource::default(), + location: Location::default(), + properties, + } + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SecuritySolutionsReferenceDataList { + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub value: Vec, +} +impl SecuritySolutionsReferenceDataList { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecuritySolutionsReferenceDataProperties { + #[doc = "The security family of the security solution"] + #[serde(rename = "securityFamily")] + pub security_family: security_solutions_reference_data_properties::SecurityFamily, + #[doc = "The security solutions' vendor name"] + #[serde(rename = "alertVendorName")] + pub alert_vendor_name: String, + #[doc = "The security solutions' package info url"] + #[serde(rename = "packageInfoUrl")] + pub package_info_url: String, + #[doc = "The security solutions' product name"] + #[serde(rename = "productName")] + pub product_name: String, + #[doc = "The security solutions' publisher"] + pub publisher: String, + #[doc = "The security solutions' publisher display name"] + #[serde(rename = "publisherDisplayName")] + pub publisher_display_name: String, + #[doc = "The security solutions' template"] + pub template: String, +} +impl SecuritySolutionsReferenceDataProperties { + pub fn new( + security_family: security_solutions_reference_data_properties::SecurityFamily, + alert_vendor_name: String, + package_info_url: String, + product_name: String, + publisher: String, + publisher_display_name: String, + template: String, + ) -> Self { + Self { + security_family, + alert_vendor_name, + package_info_url, + product_name, + publisher, + publisher_display_name, + template, + } + } +} +pub mod security_solutions_reference_data_properties { + use super::*; + #[doc = "The security family of the security solution"] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "SecurityFamily")] + pub enum SecurityFamily { + Waf, + Ngfw, + SaasWaf, + Va, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for SecurityFamily { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for SecurityFamily { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for SecurityFamily { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::Waf => serializer.serialize_unit_variant("SecurityFamily", 0u32, "Waf"), + Self::Ngfw => serializer.serialize_unit_variant("SecurityFamily", 1u32, "Ngfw"), + Self::SaasWaf => serializer.serialize_unit_variant("SecurityFamily", 2u32, "SaasWaf"), + Self::Va => serializer.serialize_unit_variant("SecurityFamily", 3u32, "Va"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} +#[doc = "Metadata pertaining to creation and last modification of the resource."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct SystemData { + #[doc = "The identity that created the resource."] + #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] + pub created_by: Option, + #[doc = "The type of identity that created the resource."] + #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] + pub created_by_type: Option, + #[doc = "The timestamp of resource creation (UTC)."] + #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] + pub created_at: Option, + #[doc = "The identity that last modified the resource."] + #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by: Option, + #[doc = "The type of identity that last modified the resource."] + #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] + pub last_modified_by_type: Option, + #[doc = "The timestamp of resource last modification (UTC)"] + #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] + pub last_modified_at: Option, +} +impl SystemData { + pub fn new() -> Self { + Self::default() + } +} +pub mod system_data { + use super::*; + #[doc = "The type of identity that created the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "CreatedByType")] + pub enum CreatedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for CreatedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for CreatedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for CreatedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } + #[doc = "The type of identity that last modified the resource."] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + #[serde(remote = "LastModifiedByType")] + pub enum LastModifiedByType { + User, + Application, + ManagedIdentity, + Key, + #[serde(skip_deserializing)] + UnknownValue(String), + } + impl FromStr for LastModifiedByType { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } + } + impl<'de> Deserialize<'de> for LastModifiedByType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } + } + impl Serialize for LastModifiedByType { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), + Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), + Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), + Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } + } +} diff --git a/services/mgmt/security/src/package_preview_2022_08/models.rs b/services/mgmt/security/src/package_preview_2022_08/models.rs deleted file mode 100644 index dbcf5ac236..0000000000 --- a/services/mgmt/security/src/package_preview_2022_08/models.rs +++ /dev/null @@ -1,1838 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "The aws connector environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, - #[doc = "The awsOrganization data "] - #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, -} -impl AwsEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { - environment_data, - organizational_data: None, - } - } -} -#[doc = "The awsOrganization data "] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsOrganizationalData { - #[doc = "The multi cloud account's membership type in the organization"] - #[serde(rename = "organizationMembershipType")] - pub organization_membership_type: aws_organizational_data::OrganizationMembershipType, -} -impl AwsOrganizationalData { - pub fn new(organization_membership_type: aws_organizational_data::OrganizationMembershipType) -> Self { - Self { - organization_membership_type, - } - } -} -pub mod aws_organizational_data { - use super::*; - #[doc = "The multi cloud account's membership type in the organization"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OrganizationMembershipType")] - pub enum OrganizationMembershipType { - Member, - Organization, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OrganizationMembershipType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OrganizationMembershipType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OrganizationMembershipType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), - Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The awsOrganization data for the master account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsOrganizationalDataMaster { - #[serde(flatten)] - pub aws_organizational_data: AwsOrganizationalData, - #[doc = "If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset"] - #[serde(rename = "stacksetName", default, skip_serializing_if = "Option::is_none")] - pub stackset_name: Option, - #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] - #[serde( - rename = "excludedAccountIds", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_account_ids: Vec, -} -impl AwsOrganizationalDataMaster { - pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { - Self { - aws_organizational_data, - stackset_name: None, - excluded_account_ids: Vec::new(), - } - } -} -#[doc = "The awsOrganization data for the member account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsOrganizationalDataMember { - #[serde(flatten)] - pub aws_organizational_data: AwsOrganizationalData, - #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the account's parent"] - #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] - pub parent_hierarchy_id: Option, -} -impl AwsOrganizationalDataMember { - pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { - Self { - aws_organizational_data, - parent_hierarchy_id: None, - } - } -} -#[doc = "The AzureDevOps scope connector's environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDevOpsScopeEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, -} -impl AzureDevOpsScopeEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { environment_data } - } -} -#[doc = "Describes an Azure resource with location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureTrackedResourceLocation { - #[doc = "Location where the resource is stored"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, -} -impl AzureTrackedResourceLocation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudError { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for CloudError { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl CloudError { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudErrorBody { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl CloudErrorBody { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ETag { - #[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, -} -impl ETag { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The security connector environment data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnvironmentData { - #[doc = "The type of the environment data."] - #[serde(rename = "environmentType")] - pub environment_type: environment_data::EnvironmentType, -} -impl EnvironmentData { - pub fn new(environment_type: environment_data::EnvironmentType) -> Self { - Self { environment_type } - } -} -pub mod environment_data { - use super::*; - #[doc = "The type of the environment data."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "EnvironmentType")] - pub enum EnvironmentType { - AwsAccount, - GcpProject, - GithubScope, - AzureDevOpsScope, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for EnvironmentType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for EnvironmentType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for EnvironmentType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AwsAccount => serializer.serialize_unit_variant("EnvironmentType", 0u32, "AwsAccount"), - Self::GcpProject => serializer.serialize_unit_variant("EnvironmentType", 1u32, "GcpProject"), - Self::GithubScope => serializer.serialize_unit_variant("EnvironmentType", 2u32, "GithubScope"), - Self::AzureDevOpsScope => serializer.serialize_unit_variant("EnvironmentType", 3u32, "AzureDevOpsScope"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The gcpOrganization data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpOrganizationalData { - #[doc = "The multi cloud account's membership type in the organization"] - #[serde(rename = "organizationMembershipType")] - pub organization_membership_type: gcp_organizational_data::OrganizationMembershipType, -} -impl GcpOrganizationalData { - pub fn new(organization_membership_type: gcp_organizational_data::OrganizationMembershipType) -> Self { - Self { - organization_membership_type, - } - } -} -pub mod gcp_organizational_data { - use super::*; - #[doc = "The multi cloud account's membership type in the organization"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OrganizationMembershipType")] - pub enum OrganizationMembershipType { - Member, - Organization, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OrganizationMembershipType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OrganizationMembershipType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OrganizationMembershipType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), - Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The gcpOrganization data for the member account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpOrganizationalDataMember { - #[serde(flatten)] - pub gcp_organizational_data: GcpOrganizationalData, - #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the project's parent"] - #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] - pub parent_hierarchy_id: Option, - #[doc = "The GCP management project number from organizational onboarding"] - #[serde(rename = "managementProjectNumber", default, skip_serializing_if = "Option::is_none")] - pub management_project_number: Option, -} -impl GcpOrganizationalDataMember { - pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { - Self { - gcp_organizational_data, - parent_hierarchy_id: None, - management_project_number: None, - } - } -} -#[doc = "The gcpOrganization data for the parent account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpOrganizationalDataOrganization { - #[serde(flatten)] - pub gcp_organizational_data: GcpOrganizationalData, - #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] - #[serde( - rename = "excludedProjectNumbers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_project_numbers: Vec, - #[doc = "The service account email address which represents the organization level permissions container."] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The GCP workload identity provider id which represents the permissions required to auto provision security connectors"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, -} -impl GcpOrganizationalDataOrganization { - pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { - Self { - gcp_organizational_data, - excluded_project_numbers: Vec::new(), - service_account_email_address: None, - workload_identity_provider_id: None, - } - } -} -#[doc = "The details about the project represented by the security connector"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GcpProjectDetails { - #[doc = "The unique GCP Project number"] - #[serde(rename = "projectNumber", default, skip_serializing_if = "Option::is_none")] - pub project_number: Option, - #[doc = "The GCP Project id"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "The GCP workload identity federation pool id"] - #[serde(rename = "workloadIdentityPoolId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_pool_id: Option, -} -impl GcpProjectDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The GCP project connector environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpProjectEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, - #[doc = "The gcpOrganization data"] - #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, - #[doc = "The details about the project represented by the security connector"] - #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] - pub project_details: Option, -} -impl GcpProjectEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { - environment_data, - organizational_data: None, - project_details: None, - } - } -} -#[doc = "The github scope connector's environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GithubScopeEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, -} -impl GithubScopeEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { environment_data } - } -} -#[doc = "Describes an Azure resource with kind"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Kind { - #[doc = "Kind of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, -} -impl Kind { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes an Azure resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Resource Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The security connector resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecurityConnector { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, - #[doc = "A set of properties that defines the security connector configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SecurityConnector { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A set of properties that defines the security connector configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecurityConnectorProperties { - #[doc = "The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector)."] - #[serde(rename = "hierarchyIdentifier", default, skip_serializing_if = "Option::is_none")] - pub hierarchy_identifier: Option, - #[doc = "The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings."] - #[serde(rename = "hierarchyIdentifierTrialEndDate", default, with = "azure_core::date::rfc3339::option")] - pub hierarchy_identifier_trial_end_date: Option, - #[doc = "The multi cloud resource's cloud name."] - #[serde(rename = "environmentName", default, skip_serializing_if = "Option::is_none")] - pub environment_name: Option, - #[doc = "A collection of offerings for the security connector."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub offerings: Vec, - #[doc = "The security connector environment data."] - #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] - pub environment_data: Option, -} -impl SecurityConnectorProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod security_connector_properties { - use super::*; - #[doc = "The multi cloud resource's cloud name."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "EnvironmentName")] - pub enum EnvironmentName { - Azure, - #[serde(rename = "AWS")] - Aws, - #[serde(rename = "GCP")] - Gcp, - Github, - AzureDevOps, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for EnvironmentName { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for EnvironmentName { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for EnvironmentName { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Azure => serializer.serialize_unit_variant("EnvironmentName", 0u32, "Azure"), - Self::Aws => serializer.serialize_unit_variant("EnvironmentName", 1u32, "AWS"), - Self::Gcp => serializer.serialize_unit_variant("EnvironmentName", 2u32, "GCP"), - Self::Github => serializer.serialize_unit_variant("EnvironmentName", 3u32, "Github"), - Self::AzureDevOps => serializer.serialize_unit_variant("EnvironmentName", 4u32, "AzureDevOps"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "List of security connectors response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SecurityConnectorsList { - #[doc = "The list of security connectors under the given scope."] - pub value: Vec, - #[doc = "The URI to fetch the next page."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for SecurityConnectorsList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl SecurityConnectorsList { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "A list of key value pairs that describe the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Tags { - #[doc = "A list of key value pairs that describe the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl Tags { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes an Azure tracked resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[serde(flatten)] - pub azure_tracked_resource_location: AzureTrackedResourceLocation, - #[serde(flatten)] - pub kind: Kind, - #[serde(flatten)] - pub e_tag: ETag, - #[serde(flatten)] - pub tags: Tags, -} -impl TrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The security offering details"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudOffering { - #[doc = "The type of the security offering."] - #[serde(rename = "offeringType")] - pub offering_type: cloud_offering::OfferingType, - #[doc = "The offering description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl CloudOffering { - pub fn new(offering_type: cloud_offering::OfferingType) -> Self { - Self { - offering_type, - description: None, - } - } -} -pub mod cloud_offering { - use super::*; - #[doc = "The type of the security offering."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OfferingType")] - pub enum OfferingType { - CspmMonitorAws, - DefenderForContainersAws, - DefenderForServersAws, - DefenderForDatabasesAws, - InformationProtectionAws, - CspmMonitorGcp, - CspmMonitorGithub, - CspmMonitorAzureDevOps, - DefenderForServersGcp, - DefenderForContainersGcp, - DefenderForDatabasesGcp, - DefenderCspmAws, - DefenderCspmGcp, - DefenderForDevOpsGithub, - DefenderForDevOpsAzureDevOps, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OfferingType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OfferingType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OfferingType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CspmMonitorAws => serializer.serialize_unit_variant("OfferingType", 0u32, "CspmMonitorAws"), - Self::DefenderForContainersAws => serializer.serialize_unit_variant("OfferingType", 1u32, "DefenderForContainersAws"), - Self::DefenderForServersAws => serializer.serialize_unit_variant("OfferingType", 2u32, "DefenderForServersAws"), - Self::DefenderForDatabasesAws => serializer.serialize_unit_variant("OfferingType", 3u32, "DefenderForDatabasesAws"), - Self::InformationProtectionAws => serializer.serialize_unit_variant("OfferingType", 4u32, "InformationProtectionAws"), - Self::CspmMonitorGcp => serializer.serialize_unit_variant("OfferingType", 5u32, "CspmMonitorGcp"), - Self::CspmMonitorGithub => serializer.serialize_unit_variant("OfferingType", 6u32, "CspmMonitorGithub"), - Self::CspmMonitorAzureDevOps => serializer.serialize_unit_variant("OfferingType", 7u32, "CspmMonitorAzureDevOps"), - Self::DefenderForServersGcp => serializer.serialize_unit_variant("OfferingType", 8u32, "DefenderForServersGcp"), - Self::DefenderForContainersGcp => serializer.serialize_unit_variant("OfferingType", 9u32, "DefenderForContainersGcp"), - Self::DefenderForDatabasesGcp => serializer.serialize_unit_variant("OfferingType", 10u32, "DefenderForDatabasesGcp"), - Self::DefenderCspmAws => serializer.serialize_unit_variant("OfferingType", 11u32, "DefenderCspmAws"), - Self::DefenderCspmGcp => serializer.serialize_unit_variant("OfferingType", 12u32, "DefenderCspmGcp"), - Self::DefenderForDevOpsGithub => serializer.serialize_unit_variant("OfferingType", 13u32, "DefenderForDevOpsGithub"), - Self::DefenderForDevOpsAzureDevOps => { - serializer.serialize_unit_variant("OfferingType", 14u32, "DefenderForDevOpsAzureDevOps") - } - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The CSPM monitoring for AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub native_cloud_connection: Option, -} -impl CspmMonitorAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - native_cloud_connection: None, - } - } -} -pub mod cspm_monitor_aws_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct NativeCloudConnection { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl NativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The CSPM monitoring for AzureDevOps offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorAzureDevOpsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl CspmMonitorAzureDevOpsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The CSPM monitoring for GCP offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub native_cloud_connection: Option, -} -impl CspmMonitorGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - native_cloud_connection: None, - } - } -} -pub mod cspm_monitor_gcp_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct NativeCloudConnection { - #[doc = "The GCP workload identity provider id for the offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - #[doc = "The service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - } - impl NativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The CSPM monitoring for github offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorGithubOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl CspmMonitorGithubOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The CSPM P1 for Aws offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderCspmAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] - pub vm_scanners: Option, -} -impl DefenderCspmAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - vm_scanners: None, - } - } -} -pub mod defender_cspm_aws_offering { - use super::*; - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VmScanners { - #[doc = "Is Microsoft Defender for Server VM scanning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VmScanners { - pub fn new() -> Self { - Self::default() - } - } - pub mod vm_scanners { - use super::*; - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - #[doc = "The scanning mode for the vm scan."] - #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] - pub scanning_mode: Option, - #[doc = "VM tags that indicates that VM should not be scanned"] - #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] - pub exclusion_tags: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The scanning mode for the vm scan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ScanningMode")] - pub enum ScanningMode { - Default, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ScanningMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ScanningMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ScanningMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } -} -#[doc = "The CSPM P1 for GCP offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderCspmGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderCspmGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for Databases AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderFoDatabasesAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The RDS configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rds: Option, -} -impl DefenderFoDatabasesAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - arc_auto_provisioning: None, - rds: None, - } - } -} -pub mod defender_fo_databases_aws_offering { - use super::*; - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The RDS configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Rds { - #[doc = "Is RDS protection enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl Rds { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Defender for Containers AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForContainersAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The kubernetes service connection configuration"] - #[serde(rename = "kubernetesService", default, skip_serializing_if = "Option::is_none")] - pub kubernetes_service: Option, - #[doc = "The kubernetes to scuba connection configuration"] - #[serde(rename = "kubernetesScubaReader", default, skip_serializing_if = "Option::is_none")] - pub kubernetes_scuba_reader: Option, - #[doc = "The cloudwatch to kinesis connection configuration"] - #[serde(rename = "cloudWatchToKinesis", default, skip_serializing_if = "Option::is_none")] - pub cloud_watch_to_kinesis: Option, - #[doc = "The kinesis to s3 connection configuration"] - #[serde(rename = "kinesisToS3", default, skip_serializing_if = "Option::is_none")] - pub kinesis_to_s3: Option, - #[doc = "The container vulnerability assessment configuration"] - #[serde(rename = "containerVulnerabilityAssessment", default, skip_serializing_if = "Option::is_none")] - pub container_vulnerability_assessment: Option, - #[doc = "The container vulnerability assessment task configuration"] - #[serde(rename = "containerVulnerabilityAssessmentTask", default, skip_serializing_if = "Option::is_none")] - pub container_vulnerability_assessment_task: Option, - #[doc = "Enable container vulnerability assessment feature"] - #[serde( - rename = "enableContainerVulnerabilityAssessment", - default, - skip_serializing_if = "Option::is_none" - )] - pub enable_container_vulnerability_assessment: Option, - #[doc = "Is audit logs pipeline auto provisioning enabled"] - #[serde(rename = "autoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub auto_provisioning: Option, - #[doc = "The retention time in days of kube audit logs set on the CloudWatch log group"] - #[serde(rename = "kubeAuditRetentionTime", default, skip_serializing_if = "Option::is_none")] - pub kube_audit_retention_time: Option, - #[doc = "The externalId used by the data reader to prevent the confused deputy attack"] - #[serde(rename = "scubaExternalId", default, skip_serializing_if = "Option::is_none")] - pub scuba_external_id: Option, -} -impl DefenderForContainersAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - kubernetes_service: None, - kubernetes_scuba_reader: None, - cloud_watch_to_kinesis: None, - kinesis_to_s3: None, - container_vulnerability_assessment: None, - container_vulnerability_assessment_task: None, - enable_container_vulnerability_assessment: None, - auto_provisioning: None, - kube_audit_retention_time: None, - scuba_external_id: None, - } - } -} -pub mod defender_for_containers_aws_offering { - use super::*; - #[doc = "The kubernetes service connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct KubernetesService { - #[doc = "The cloud role ARN in AWS for this feature used for provisioning resources"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl KubernetesService { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The kubernetes to scuba connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct KubernetesScubaReader { - #[doc = "The cloud role ARN in AWS for this feature used for reading data"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl KubernetesScubaReader { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The cloudwatch to kinesis connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct CloudWatchToKinesis { - #[doc = "The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl CloudWatchToKinesis { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The kinesis to s3 connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct KinesisToS3 { - #[doc = "The cloud role ARN in AWS used by Kinesis to transfer data into S3"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl KinesisToS3 { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The container vulnerability assessment configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ContainerVulnerabilityAssessment { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl ContainerVulnerabilityAssessment { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The container vulnerability assessment task configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ContainerVulnerabilityAssessmentTask { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl ContainerVulnerabilityAssessmentTask { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The containers GCP offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForContainersGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub native_cloud_connection: Option, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "dataPipelineNativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub data_pipeline_native_cloud_connection: Option, - #[doc = "Is audit logs data collection enabled"] - #[serde(rename = "auditLogsAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] - pub audit_logs_auto_provisioning_flag: Option, - #[doc = "Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled"] - #[serde(rename = "defenderAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] - pub defender_agent_auto_provisioning_flag: Option, - #[doc = "Is Policy Kubernetes agent auto provisioning enabled"] - #[serde(rename = "policyAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] - pub policy_agent_auto_provisioning_flag: Option, -} -impl DefenderForContainersGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - native_cloud_connection: None, - data_pipeline_native_cloud_connection: None, - audit_logs_auto_provisioning_flag: None, - defender_agent_auto_provisioning_flag: None, - policy_agent_auto_provisioning_flag: None, - } - } -} -pub mod defender_for_containers_gcp_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct NativeCloudConnection { - #[doc = "The service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The GCP workload identity provider id for this offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - } - impl NativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DataPipelineNativeCloudConnection { - #[doc = "The data collection service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The data collection GCP workload identity provider id for this offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - } - impl DataPipelineNativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Defender for Databases GCP offering configurations"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDatabasesGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The native cloud connection configuration"] - #[serde( - rename = "defenderForDatabasesArcAutoProvisioning", - default, - skip_serializing_if = "Option::is_none" - )] - pub defender_for_databases_arc_auto_provisioning: Option, -} -impl DefenderForDatabasesGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - arc_auto_provisioning: None, - defender_for_databases_arc_auto_provisioning: None, - } - } -} -pub mod defender_for_databases_gcp_offering { - use super::*; - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DefenderForDatabasesArcAutoProvisioning { - #[doc = "The service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The GCP workload identity provider id for this offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - } - impl DefenderForDatabasesArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Defender for DevOps for Azure DevOps offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDevOpsAzureDevOpsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderForDevOpsAzureDevOpsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for DevOps for Github offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDevOpsGithubOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderForDevOpsGithubOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for Servers AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForServersAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The Defender for servers connection configuration"] - #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] - pub defender_for_servers: Option, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub va_auto_provisioning: Option, - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub mde_auto_provisioning: Option, - #[doc = "configuration for the servers offering subPlan"] - #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] - pub sub_plan: Option, - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] - pub vm_scanners: Option, -} -impl DefenderForServersAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - defender_for_servers: None, - arc_auto_provisioning: None, - va_auto_provisioning: None, - mde_auto_provisioning: None, - sub_plan: None, - vm_scanners: None, - } - } -} -pub mod defender_for_servers_aws_offering { - use super::*; - #[doc = "The Defender for servers connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DefenderForServers { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl DefenderForServers { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VaAutoProvisioning { - #[doc = "Is Vulnerability Assessment auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VaAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod va_auto_provisioning { - use super::*; - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Qualys, - #[serde(rename = "TVM")] - Tvm, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), - Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct MdeAutoProvisioning { - #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl MdeAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "configuration for the servers offering subPlan"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct SubPlan { - #[doc = "The available sub plans"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl SubPlan { - pub fn new() -> Self { - Self::default() - } - } - pub mod sub_plan { - use super::*; - #[doc = "The available sub plans"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - P1, - P2, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), - Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VmScanners { - #[doc = "Is Microsoft Defender for Server VM scanning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VmScanners { - pub fn new() -> Self { - Self::default() - } - } - pub mod vm_scanners { - use super::*; - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - #[doc = "The scanning mode for the vm scan."] - #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] - pub scanning_mode: Option, - #[doc = "VM tags that indicates that VM should not be scanned"] - #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] - pub exclusion_tags: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The scanning mode for the vm scan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ScanningMode")] - pub enum ScanningMode { - Default, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ScanningMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ScanningMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ScanningMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } -} -#[doc = "The Defender for Servers GCP offering configurations"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForServersGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The Defender for servers connection configuration"] - #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] - pub defender_for_servers: Option, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub va_auto_provisioning: Option, - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub mde_auto_provisioning: Option, - #[doc = "configuration for the servers offering subPlan"] - #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] - pub sub_plan: Option, -} -impl DefenderForServersGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - defender_for_servers: None, - arc_auto_provisioning: None, - va_auto_provisioning: None, - mde_auto_provisioning: None, - sub_plan: None, - } - } -} -pub mod defender_for_servers_gcp_offering { - use super::*; - #[doc = "The Defender for servers connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DefenderForServers { - #[doc = "The workload identity provider id in GCP for this feature"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - #[doc = "The service account email address in GCP for this feature"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - } - impl DefenderForServers { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VaAutoProvisioning { - #[doc = "Is Vulnerability Assessment auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VaAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod va_auto_provisioning { - use super::*; - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Qualys, - #[serde(rename = "TVM")] - Tvm, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), - Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct MdeAutoProvisioning { - #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl MdeAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "configuration for the servers offering subPlan"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct SubPlan { - #[doc = "The available sub plans"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl SubPlan { - pub fn new() -> Self { - Self::default() - } - } - pub mod sub_plan { - use super::*; - #[doc = "The available sub plans"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - P1, - P2, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), - Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } -} -#[doc = "The information protection for AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct InformationProtectionAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "informationProtection", default, skip_serializing_if = "Option::is_none")] - pub information_protection: Option, -} -impl InformationProtectionAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - information_protection: None, - } - } -} -pub mod information_protection_aws_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct InformationProtection { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl InformationProtection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/security/src/package_preview_2022_11/models.rs b/services/mgmt/security/src/package_preview_2022_11/models.rs deleted file mode 100644 index f704244958..0000000000 --- a/services/mgmt/security/src/package_preview_2022_11/models.rs +++ /dev/null @@ -1,143 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "Describes the properties of an API collection."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ApiCollectionProperties { - #[doc = "The display name of the Azure API Management API."] - #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Additional data regarding the API collection."] - #[serde(rename = "additionalData", default, skip_serializing_if = "Option::is_none")] - pub additional_data: Option, -} -impl ApiCollectionProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "An API collection as represented by Defender for APIs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ApiCollectionResponse { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Describes the properties of an API collection."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ApiCollectionResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Page of a list of API collections as represented by Defender for APIs."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ApiCollectionResponseList { - #[doc = "API collections in this page."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for ApiCollectionResponseList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl ApiCollectionResponseList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorDetail { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl ErrorDetail { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes an Azure resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Resource Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} diff --git a/services/mgmt/security/src/package_preview_2023_02/mod.rs b/services/mgmt/security/src/package_preview_2023_02/mod.rs deleted file mode 100644 index b6e765b4dc..0000000000 --- a/services/mgmt/security/src/package_preview_2023_02/mod.rs +++ /dev/null @@ -1,1355 +0,0 @@ -#![allow(unused_mut)] -#![allow(unused_variables)] -#![allow(unused_imports)] -#![allow(clippy::redundant_clone)] -pub mod models; -#[derive(Clone)] -pub struct Client { - endpoint: String, - credential: std::sync::Arc, - scopes: Vec, - pipeline: azure_core::Pipeline, -} -#[derive(Clone)] -pub struct ClientBuilder { - credential: std::sync::Arc, - endpoint: Option, - scopes: Option>, - options: azure_core::ClientOptions, -} -pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD; -impl ClientBuilder { - #[doc = "Create a new instance of `ClientBuilder`."] - #[must_use] - pub fn new(credential: std::sync::Arc) -> Self { - Self { - credential, - endpoint: None, - scopes: None, - options: azure_core::ClientOptions::default(), - } - } - #[doc = "Set the endpoint."] - #[must_use] - pub fn endpoint(mut self, endpoint: impl Into) -> Self { - self.endpoint = Some(endpoint.into()); - self - } - #[doc = "Set the scopes."] - #[must_use] - pub fn scopes(mut self, scopes: &[&str]) -> Self { - self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect()); - self - } - #[doc = "Set the retry options."] - #[must_use] - pub fn retry(mut self, retry: impl Into) -> Self { - self.options = self.options.retry(retry); - self - } - #[doc = "Set the transport options."] - #[must_use] - pub fn transport(mut self, transport: impl Into) -> Self { - self.options = self.options.transport(transport); - self - } - #[doc = "Convert the builder into a `Client` instance."] - #[must_use] - pub fn build(self) -> Client { - let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned()); - let scopes = self.scopes.unwrap_or_else(|| vec![format!("{endpoint}/")]); - Client::new(endpoint, self.credential, scopes, self.options) - } -} -impl Client { - pub(crate) fn endpoint(&self) -> &str { - self.endpoint.as_str() - } - pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential { - self.credential.as_ref() - } - pub(crate) fn scopes(&self) -> Vec<&str> { - self.scopes.iter().map(String::as_str).collect() - } - pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result { - let mut context = azure_core::Context::default(); - self.pipeline.send(&mut context, request).await - } - #[doc = "Create a new `ClientBuilder`."] - #[must_use] - pub fn builder(credential: std::sync::Arc) -> ClientBuilder { - ClientBuilder::new(credential) - } - #[doc = "Create a new `Client`."] - #[must_use] - pub fn new( - endpoint: impl Into, - credential: std::sync::Arc, - scopes: Vec, - options: azure_core::ClientOptions, - ) -> Self { - let endpoint = endpoint.into(); - let pipeline = azure_core::Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options, - Vec::new(), - Vec::new(), - ); - Self { - endpoint, - credential, - scopes, - pipeline, - } - } - pub fn health_report_client(&self) -> health_report::Client { - health_report::Client(self.clone()) - } - pub fn health_reports_client(&self) -> health_reports::Client { - health_reports::Client(self.clone()) - } - pub fn sql_vulnerability_assessment_baseline_rules_client(&self) -> sql_vulnerability_assessment_baseline_rules::Client { - sql_vulnerability_assessment_baseline_rules::Client(self.clone()) - } - pub fn sql_vulnerability_assessment_scan_results_client(&self) -> sql_vulnerability_assessment_scan_results::Client { - sql_vulnerability_assessment_scan_results::Client(self.clone()) - } - pub fn sql_vulnerability_assessment_scans_client(&self) -> sql_vulnerability_assessment_scans::Client { - sql_vulnerability_assessment_scans::Client(self.clone()) - } -} -pub mod sql_vulnerability_assessment_baseline_rules { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the results for a given rule in the Baseline."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `rule_id`: The rule Id."] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn get( - &self, - rule_id: impl Into, - workspace_id: impl Into, - resource_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - rule_id: rule_id.into(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - #[doc = "Creates a Baseline for a rule in a database. Will overwrite any previously existing results."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `rule_id`: The rule Id."] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn create_or_update( - &self, - rule_id: impl Into, - workspace_id: impl Into, - resource_id: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - rule_id: rule_id.into(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - body: None, - } - } - #[doc = "Deletes a rule from the Baseline of a given database."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `rule_id`: The rule Id."] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn delete( - &self, - rule_id: impl Into, - workspace_id: impl Into, - resource_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - rule_id: rule_id.into(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - #[doc = "Gets the results for all rules in the Baseline."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - #[doc = "Add a list of baseline rules. Will overwrite any previously existing results (for all rules)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn add(&self, workspace_id: impl Into, resource_id: impl Into) -> add::RequestBuilder { - add::RequestBuilder { - client: self.0.clone(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - body: None, - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RuleResults = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) rule_id: String, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", - this.client.endpoint(), - &this.resource_id, - &this.rule_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod create_or_update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RuleResults = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) rule_id: String, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "The baseline results for this rule."] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", - this.client.endpoint(), - &this.resource_id, - &this.rule_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) rule_id: String, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{}", - this.client.endpoint(), - &this.resource_id, - &this.rule_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RulesResults = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", - this.client.endpoint(), - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod add { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RulesResults = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - pub(crate) body: Option, - } - impl RequestBuilder { - #[doc = "The baseline rules."] - pub fn body(mut self, body: impl Into) -> Self { - self.body = Some(body.into()); - self - } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", - this.client.endpoint(), - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = if let Some(body) = &this.body { - req.insert_header("content-type", "application/json"); - azure_core::to_json(body)? - } else { - azure_core::EMPTY_BODY - }; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod sql_vulnerability_assessment_scans { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the scan details of a single scan record."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan record for the latest scan."] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn get( - &self, - scan_id: impl Into, - workspace_id: impl Into, - resource_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - scan_id: scan_id.into(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - #[doc = "Gets a list of scan records."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn list(&self, workspace_id: impl Into, resource_id: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Scan = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scan_id: String, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}", - this.client.endpoint(), - &this.resource_id, - &this.scan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Scans = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans", - this.client.endpoint(), - &this.resource_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod sql_vulnerability_assessment_scan_results { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets the scan results of a single rule in a scan record."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] - #[doc = "* `scan_result_id`: The rule Id of the results."] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn get( - &self, - scan_id: impl Into, - scan_result_id: impl Into, - workspace_id: impl Into, - resource_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - scan_id: scan_id.into(), - scan_result_id: scan_result_id.into(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - #[doc = "Gets a list of scan results for a single scan record."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scan_id`: The scan Id. Type 'latest' to get the scan results for the latest scan."] - #[doc = "* `workspace_id`: The workspace Id."] - #[doc = "* `resource_id`: The identifier of the resource."] - pub fn list( - &self, - scan_id: impl Into, - workspace_id: impl Into, - resource_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - scan_id: scan_id.into(), - workspace_id: workspace_id.into(), - resource_id: resource_id.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScanResult = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scan_id: String, - pub(crate) scan_result_id: String, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults/{}", - this.client.endpoint(), - &this.resource_id, - &this.scan_id, - &this.scan_result_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::ScanResults = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scan_id: String, - pub(crate) workspace_id: String, - pub(crate) resource_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{}/scanResults", - this.client.endpoint(), - &this.resource_id, - &this.scan_id - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let workspace_id = &this.workspace_id; - req.url_mut().query_pairs_mut().append_pair("workspaceId", workspace_id); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod health_reports { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get a list of all health reports inside a scope. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `scope`: The scope at which the operation is performed."] - pub fn list(&self, scope: impl Into) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - scope: scope.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::HealthReportsList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) scope: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/healthReports", - this.client.endpoint(), - &this.scope - ))?; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } -} -pub mod health_report { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get health report of resource"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `resource_id`: The identifier of the resource."] - #[doc = "* `health_report_name`: The health report Key - Unique key for the health report type"] - pub fn get(&self, resource_id: impl Into, health_report_name: impl Into) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - resource_id: resource_id.into(), - health_report_name: health_report_name.into(), - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::HealthReport = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) resource_id: String, - pub(crate) health_report_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core::Url::parse(&format!( - "{}/{}/providers/Microsoft.Security/healthReports/{}", - this.client.endpoint(), - &this.resource_id, - &this.health_report_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2023-02-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} diff --git a/services/mgmt/security/src/package_preview_2023_02/models.rs b/services/mgmt/security/src/package_preview_2023_02/models.rs deleted file mode 100644 index 3b01e359b9..0000000000 --- a/services/mgmt/security/src/package_preview_2023_02/models.rs +++ /dev/null @@ -1,1048 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "Baseline details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Baseline { - #[doc = "Expected results."] - #[serde( - rename = "expectedResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub expected_results: Vec>, - #[doc = "Baseline update time (UTC)."] - #[serde(rename = "updatedTime", default, with = "azure_core::date::rfc3339::option")] - pub updated_time: Option, -} -impl Baseline { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The rule result adjusted with baseline."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BaselineAdjustedResult { - #[doc = "Baseline details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub baseline: Option, - #[doc = "The rule result status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Results the are not in baseline."] - #[serde( - rename = "resultsNotInBaseline", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub results_not_in_baseline: Vec>, - #[doc = "Results the are in baseline."] - #[serde( - rename = "resultsOnlyInBaseline", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub results_only_in_baseline: Vec>, -} -impl BaselineAdjustedResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The benchmark references."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct BenchmarkReference { - #[doc = "The benchmark name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub benchmark: Option, - #[doc = "The benchmark reference."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reference: Option, -} -impl BenchmarkReference { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudError { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl CloudError { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudErrorBody { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl CloudErrorBody { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorDetail { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl ErrorDetail { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for ErrorResponse { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl ErrorResponse { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The health report resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HealthReport { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Describes properties of the health report"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl HealthReport { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes properties of the health report"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HealthReportProperties { - #[doc = "The resource details of the health report"] - #[serde(rename = "resourceDetails", default, skip_serializing_if = "Option::is_none")] - pub resource_details: Option, - #[doc = "The environment details of the resource"] - #[serde(rename = "environmentDetails", default, skip_serializing_if = "Option::is_none")] - pub environment_details: Option, - #[doc = "The classification of the health report"] - #[serde(rename = "healthDataClassification", default, skip_serializing_if = "Option::is_none")] - pub health_data_classification: Option, - #[doc = "The status of the health report"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The affected defenders plans by unhealthy report"] - #[serde( - rename = "affectedDefendersPlans", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub affected_defenders_plans: Vec, - #[doc = "A collection of the issues in the report"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub issues: Vec, -} -impl HealthReportProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Page of health reports list"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HealthReportsList { - #[doc = "Collection of health reports in this page"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, - #[doc = "The URI to fetch the next page"] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for HealthReportsList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl HealthReportsList { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The rule query details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct QueryCheck { - #[doc = "The rule query."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, - #[doc = "Expected result."] - #[serde( - rename = "expectedResult", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub expected_result: Vec>, - #[doc = "Column names of expected result."] - #[serde( - rename = "columnNames", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub column_names: Vec, -} -impl QueryCheck { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Remediation details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Remediation { - #[doc = "Remediation description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Remediation script."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub scripts: Vec, - #[doc = "Is remediation automated."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub automated: Option, - #[doc = "Optional link to remediate in Azure Portal."] - #[serde(rename = "portalLink", default, skip_serializing_if = "Option::is_none")] - pub portal_link: Option, -} -impl Remediation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes an Azure resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Resource Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Rule results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RuleResults { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Rule results properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl RuleResults { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Rule results input."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RuleResultsInput { - #[doc = "Take results from latest scan."] - #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] - pub latest_scan: Option, - #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub results: Vec>, -} -impl RuleResultsInput { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Rule results properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RuleResultsProperties { - #[doc = "Expected results in the baseline."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub results: Vec>, -} -impl RuleResultsProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The rule severity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleSeverity")] -pub enum RuleSeverity { - High, - Medium, - Low, - Informational, - Obsolete, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleSeverity { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleSeverity { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleSeverity { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::High => serializer.serialize_unit_variant("RuleSeverity", 0u32, "High"), - Self::Medium => serializer.serialize_unit_variant("RuleSeverity", 1u32, "Medium"), - Self::Low => serializer.serialize_unit_variant("RuleSeverity", 2u32, "Low"), - Self::Informational => serializer.serialize_unit_variant("RuleSeverity", 3u32, "Informational"), - Self::Obsolete => serializer.serialize_unit_variant("RuleSeverity", 4u32, "Obsolete"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The rule result status."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleStatus")] -pub enum RuleStatus { - NonFinding, - Finding, - InternalError, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleStatus { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleStatus { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleStatus { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::NonFinding => serializer.serialize_unit_variant("RuleStatus", 0u32, "NonFinding"), - Self::Finding => serializer.serialize_unit_variant("RuleStatus", 1u32, "Finding"), - Self::InternalError => serializer.serialize_unit_variant("RuleStatus", 2u32, "InternalError"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The rule type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "RuleType")] -pub enum RuleType { - Binary, - BaselineExpected, - PositiveList, - NegativeList, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for RuleType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for RuleType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for RuleType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Binary => serializer.serialize_unit_variant("RuleType", 0u32, "Binary"), - Self::BaselineExpected => serializer.serialize_unit_variant("RuleType", 1u32, "BaselineExpected"), - Self::PositiveList => serializer.serialize_unit_variant("RuleType", 2u32, "PositiveList"), - Self::NegativeList => serializer.serialize_unit_variant("RuleType", 3u32, "NegativeList"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A list of rules results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RulesResults { - #[doc = "List of rule results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl RulesResults { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Rules results input."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct RulesResultsInput { - #[doc = "Take results from latest scan."] - #[serde(rename = "latestScan", default, skip_serializing_if = "Option::is_none")] - pub latest_scan: Option, - #[doc = "Expected results to be inserted into the baseline.\r\nLeave this field empty it LatestScan == true."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option, -} -impl RulesResultsInput { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A vulnerability assessment scan record."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Scan { - #[serde(flatten)] - pub resource: Resource, - #[doc = "A vulnerability assessment scan record properties."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl Scan { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A vulnerability assessment scan record properties."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScanProperties { - #[doc = "The scan trigger type."] - #[serde(rename = "triggerType", default, skip_serializing_if = "Option::is_none")] - pub trigger_type: Option, - #[doc = "The scan status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, - #[doc = "The server name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub server: Option, - #[doc = "The database name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub database: Option, - #[doc = "The SQL version."] - #[serde(rename = "sqlVersion", default, skip_serializing_if = "Option::is_none")] - pub sql_version: Option, - #[doc = "The scan start time (UTC)."] - #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")] - pub start_time: Option, - #[doc = "Scan results are valid until end time (UTC)."] - #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")] - pub end_time: Option, - #[doc = "The number of failed rules with high severity."] - #[serde(rename = "highSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] - pub high_severity_failed_rules_count: Option, - #[doc = "The number of failed rules with medium severity."] - #[serde(rename = "mediumSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] - pub medium_severity_failed_rules_count: Option, - #[doc = "The number of failed rules with low severity."] - #[serde(rename = "lowSeverityFailedRulesCount", default, skip_serializing_if = "Option::is_none")] - pub low_severity_failed_rules_count: Option, - #[doc = "The number of total passed rules."] - #[serde(rename = "totalPassedRulesCount", default, skip_serializing_if = "Option::is_none")] - pub total_passed_rules_count: Option, - #[doc = "The number of total failed rules."] - #[serde(rename = "totalFailedRulesCount", default, skip_serializing_if = "Option::is_none")] - pub total_failed_rules_count: Option, - #[doc = "The number of total rules assessed."] - #[serde(rename = "totalRulesCount", default, skip_serializing_if = "Option::is_none")] - pub total_rules_count: Option, - #[doc = "Baseline created for this database, and has one or more rules."] - #[serde(rename = "isBaselineApplied", default, skip_serializing_if = "Option::is_none")] - pub is_baseline_applied: Option, - #[doc = "Last scan time."] - #[serde(rename = "lastScanTime", default, with = "azure_core::date::rfc3339::option")] - pub last_scan_time: Option, -} -impl ScanProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A vulnerability assessment scan result for a single rule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScanResult { - #[serde(flatten)] - pub resource: Resource, - #[doc = "A vulnerability assessment scan result properties for a single rule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl ScanResult { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A vulnerability assessment scan result properties for a single rule."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScanResultProperties { - #[doc = "The rule Id."] - #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] - pub rule_id: Option, - #[doc = "The rule result status."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Indicated whether the results specified here are trimmed."] - #[serde(rename = "isTrimmed", default, skip_serializing_if = "Option::is_none")] - pub is_trimmed: Option, - #[doc = "The results of the query that was run."] - #[serde( - rename = "queryResults", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub query_results: Vec>, - #[doc = "Remediation details."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub remediation: Option, - #[doc = "The rule result adjusted with baseline."] - #[serde(rename = "baselineAdjustedResult", default, skip_serializing_if = "Option::is_none")] - pub baseline_adjusted_result: Option, - #[doc = "vulnerability assessment rule metadata details."] - #[serde(rename = "ruleMetadata", default, skip_serializing_if = "Option::is_none")] - pub rule_metadata: Option, -} -impl ScanResultProperties { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A list of vulnerability assessment scan results."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ScanResults { - #[doc = "List of vulnerability assessment scan results."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl ScanResults { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The scan status."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScanState")] -pub enum ScanState { - Failed, - FailedToRun, - InProgress, - Passed, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScanState { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScanState { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScanState { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Failed => serializer.serialize_unit_variant("ScanState", 0u32, "Failed"), - Self::FailedToRun => serializer.serialize_unit_variant("ScanState", 1u32, "FailedToRun"), - Self::InProgress => serializer.serialize_unit_variant("ScanState", 2u32, "InProgress"), - Self::Passed => serializer.serialize_unit_variant("ScanState", 3u32, "Passed"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "The scan trigger type."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(remote = "ScanTriggerType")] -pub enum ScanTriggerType { - OnDemand, - Recurring, - #[serde(skip_deserializing)] - UnknownValue(String), -} -impl FromStr for ScanTriggerType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } -} -impl<'de> Deserialize<'de> for ScanTriggerType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } -} -impl Serialize for ScanTriggerType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::OnDemand => serializer.serialize_unit_variant("ScanTriggerType", 0u32, "OnDemand"), - Self::Recurring => serializer.serialize_unit_variant("ScanTriggerType", 1u32, "Recurring"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } -} -#[doc = "A list of vulnerability assessment scan records."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Scans { - #[doc = "List of vulnerability assessment scan records."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub value: Vec, -} -impl Scans { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "vulnerability assessment rule metadata details."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct VaRule { - #[doc = "The rule Id."] - #[serde(rename = "ruleId", default, skip_serializing_if = "Option::is_none")] - pub rule_id: Option, - #[doc = "The rule severity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub severity: Option, - #[doc = "The rule category."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, - #[doc = "The rule type."] - #[serde(rename = "ruleType", default, skip_serializing_if = "Option::is_none")] - pub rule_type: Option, - #[doc = "The rule title."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option, - #[doc = "The rule description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The rule rationale."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rationale: Option, - #[doc = "The rule query details."] - #[serde(rename = "queryCheck", default, skip_serializing_if = "Option::is_none")] - pub query_check: Option, - #[doc = "The benchmark references."] - #[serde( - rename = "benchmarkReferences", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub benchmark_references: Vec, -} -impl VaRule { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The environment details of the resource"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct EnvironmentDetails { - #[doc = "The native resource id of the resource (in case of Azure - the resource Id, in case of MC - the native resource id)"] - #[serde(rename = "nativeResourceId", default, skip_serializing_if = "Option::is_none")] - pub native_resource_id: Option, - #[doc = "The hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the hierarchyId id)"] - #[serde(rename = "environmentHierarchyId", default, skip_serializing_if = "Option::is_none")] - pub environment_hierarchy_id: Option, - #[doc = "The organizational hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the organizational hierarchyId id)"] - #[serde(rename = "organizationalHierarchyId", default, skip_serializing_if = "Option::is_none")] - pub organizational_hierarchy_id: Option, - #[doc = "The subscription Id"] - #[serde(rename = "subscriptionId", default, skip_serializing_if = "Option::is_none")] - pub subscription_id: Option, - #[doc = "The tenant Id"] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, -} -impl EnvironmentDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The classification of the health report"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct HealthDataClassification { - #[doc = "The component describes the name of the agent/service that scans the issue"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub component: Option, - #[doc = "The scenario describes the health scenario issue of the component"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scenario: Option, - #[doc = "The resource scope of the health report"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scope: Option, -} -impl HealthDataClassification { - pub fn new() -> Self { - Self::default() - } -} -pub mod health_data_classification { - use super::*; - #[doc = "The resource scope of the health report"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Scope")] - pub enum Scope { - Connectors, - Clusters, - VirtualMachines, - Unknown, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Scope { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Scope { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Scope { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Connectors => serializer.serialize_unit_variant("Scope", 0u32, "Connectors"), - Self::Clusters => serializer.serialize_unit_variant("Scope", 1u32, "Clusters"), - Self::VirtualMachines => serializer.serialize_unit_variant("Scope", 2u32, "VirtualMachines"), - Self::Unknown => serializer.serialize_unit_variant("Scope", 3u32, "Unknown"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The issue that caused the resource to by unhealthy"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct Issue { - #[doc = "The unique issue key"] - #[serde(rename = "issueKey")] - pub issue_key: String, - #[doc = "The issue name"] - #[serde(rename = "issueName", default, skip_serializing_if = "Option::is_none")] - pub issue_name: Option, - #[doc = "The affected security values that MDC offers that will be affected by the issue, for example: recommendations, alerts, etc"] - #[serde( - rename = "securityValues", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub security_values: Vec, - #[doc = "The issue description"] - #[serde(rename = "issueDescription", default, skip_serializing_if = "Option::is_none")] - pub issue_description: Option, - #[doc = "Human readable description of what you should do to mitigate this health issue"] - #[serde(rename = "remediationSteps", default, skip_serializing_if = "Option::is_none")] - pub remediation_steps: Option, - #[doc = "The remediation script to solve this issue"] - #[serde(rename = "remediationScript", default, skip_serializing_if = "Option::is_none")] - pub remediation_script: Option, - #[doc = "Additional data for the given issue. The additional data depends on the issue type"] - #[serde(rename = "issueAdditionalData", default, skip_serializing_if = "Option::is_none")] - pub issue_additional_data: Option, -} -impl Issue { - pub fn new(issue_key: String) -> Self { - Self { - issue_key, - issue_name: None, - security_values: Vec::new(), - issue_description: None, - remediation_steps: None, - remediation_script: None, - issue_additional_data: None, - } - } -} -#[doc = "The resource details of the health report"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ResourceDetails { - #[doc = "The status of the health report"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub source: Option, - #[doc = "The azure id of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The id of the connector"] - #[serde(rename = "connectorId", default, skip_serializing_if = "Option::is_none")] - pub connector_id: Option, -} -impl ResourceDetails { - pub fn new() -> Self { - Self::default() - } -} -pub mod resource_details { - use super::*; - #[doc = "The status of the health report"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Source")] - pub enum Source { - Aws, - Gcp, - Azure, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Source { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Source { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Source { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Aws => serializer.serialize_unit_variant("Source", 0u32, "Aws"), - Self::Gcp => serializer.serialize_unit_variant("Source", 1u32, "Gcp"), - Self::Azure => serializer.serialize_unit_variant("Source", 2u32, "Azure"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The status of the health report"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Status { - #[doc = "The status of the health report"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The date of when the status of the health report was changed in the last time"] - #[serde(rename = "statusChangeDate", default, with = "azure_core::date::rfc3339::option")] - pub status_change_date: Option, - #[doc = "The date of when the resource of the health report was scanned in the first time"] - #[serde(rename = "firstEvaluationDate", default, with = "azure_core::date::rfc3339::option")] - pub first_evaluation_date: Option, -} -impl Status { - pub fn new() -> Self { - Self::default() - } -} -pub mod status { - use super::*; - #[doc = "The status of the health report"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Code")] - pub enum Code { - Healthy, - NotHealthy, - NotApplicable, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Code { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Code { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Code { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Healthy => serializer.serialize_unit_variant("Code", 0u32, "Healthy"), - Self::NotHealthy => serializer.serialize_unit_variant("Code", 1u32, "NotHealthy"), - Self::NotApplicable => serializer.serialize_unit_variant("Code", 2u32, "NotApplicable"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/security/src/package_preview_2023_03/models.rs b/services/mgmt/security/src/package_preview_2023_03/models.rs deleted file mode 100644 index e2258d6f47..0000000000 --- a/services/mgmt/security/src/package_preview_2023_03/models.rs +++ /dev/null @@ -1,2165 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(unused_imports)] -use serde::de::{value, Deserializer, IntoDeserializer}; -use serde::{Deserialize, Serialize, Serializer}; -use std::str::FromStr; -#[doc = "The AWS connector environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, - #[doc = "The AWS organization data"] - #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, - #[doc = "list of regions to scan"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub regions: Vec, - #[doc = "The AWS account name"] - #[serde(rename = "accountName", default, skip_serializing_if = "Option::is_none")] - pub account_name: Option, -} -impl AwsEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { - environment_data, - organizational_data: None, - regions: Vec::new(), - account_name: None, - } - } -} -#[doc = "The AWS organization data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsOrganizationalData { - #[doc = "The multi cloud account's membership type in the organization"] - #[serde(rename = "organizationMembershipType")] - pub organization_membership_type: aws_organizational_data::OrganizationMembershipType, -} -impl AwsOrganizationalData { - pub fn new(organization_membership_type: aws_organizational_data::OrganizationMembershipType) -> Self { - Self { - organization_membership_type, - } - } -} -pub mod aws_organizational_data { - use super::*; - #[doc = "The multi cloud account's membership type in the organization"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OrganizationMembershipType")] - pub enum OrganizationMembershipType { - Member, - Organization, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OrganizationMembershipType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OrganizationMembershipType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OrganizationMembershipType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), - Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The AWS organization data for the master account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsOrganizationalDataMaster { - #[serde(flatten)] - pub aws_organizational_data: AwsOrganizationalData, - #[doc = "If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset"] - #[serde(rename = "stacksetName", default, skip_serializing_if = "Option::is_none")] - pub stackset_name: Option, - #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] - #[serde( - rename = "excludedAccountIds", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_account_ids: Vec, -} -impl AwsOrganizationalDataMaster { - pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { - Self { - aws_organizational_data, - stackset_name: None, - excluded_account_ids: Vec::new(), - } - } -} -#[doc = "The AWS organization data for the member account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AwsOrganizationalDataMember { - #[serde(flatten)] - pub aws_organizational_data: AwsOrganizationalData, - #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the account's parent"] - #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] - pub parent_hierarchy_id: Option, -} -impl AwsOrganizationalDataMember { - pub fn new(aws_organizational_data: AwsOrganizationalData) -> Self { - Self { - aws_organizational_data, - parent_hierarchy_id: None, - } - } -} -#[doc = "The AzureDevOps scope connector's environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AzureDevOpsScopeEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, -} -impl AzureDevOpsScopeEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { environment_data } - } -} -#[doc = "Describes an Azure resource with location"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct AzureTrackedResourceLocation { - #[doc = "Location where the resource is stored"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, -} -impl AzureTrackedResourceLocation { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudError { - #[doc = "The error detail."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, -} -impl azure_core::Continuable for CloudError { - type Continuation = String; - fn continuation(&self) -> Option { - None - } -} -impl CloudError { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The error detail."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct CloudErrorBody { - #[doc = "The error code."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub code: Option, - #[doc = "The error message."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, - #[doc = "The error target."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target: Option, - #[doc = "The error details."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub details: Vec, - #[doc = "The error additional info."] - #[serde( - rename = "additionalInfo", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub additional_info: Vec, -} -impl CloudErrorBody { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ETag { - #[doc = "Entity tag is used for comparing two or more entities from the same requested resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub etag: Option, -} -impl ETag { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The security connector environment data."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnvironmentData { - #[doc = "The type of the environment data."] - #[serde(rename = "environmentType")] - pub environment_type: environment_data::EnvironmentType, -} -impl EnvironmentData { - pub fn new(environment_type: environment_data::EnvironmentType) -> Self { - Self { environment_type } - } -} -pub mod environment_data { - use super::*; - #[doc = "The type of the environment data."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "EnvironmentType")] - pub enum EnvironmentType { - AwsAccount, - GcpProject, - GithubScope, - AzureDevOpsScope, - GitlabScope, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for EnvironmentType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for EnvironmentType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for EnvironmentType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::AwsAccount => serializer.serialize_unit_variant("EnvironmentType", 0u32, "AwsAccount"), - Self::GcpProject => serializer.serialize_unit_variant("EnvironmentType", 1u32, "GcpProject"), - Self::GithubScope => serializer.serialize_unit_variant("EnvironmentType", 2u32, "GithubScope"), - Self::AzureDevOpsScope => serializer.serialize_unit_variant("EnvironmentType", 3u32, "AzureDevOpsScope"), - Self::GitlabScope => serializer.serialize_unit_variant("EnvironmentType", 4u32, "GitlabScope"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The resource management error additional info."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct ErrorAdditionalInfo { - #[doc = "The additional info type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The additional info."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub info: Option, -} -impl ErrorAdditionalInfo { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The gcpOrganization data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpOrganizationalData { - #[doc = "The multi cloud account's membership type in the organization"] - #[serde(rename = "organizationMembershipType")] - pub organization_membership_type: gcp_organizational_data::OrganizationMembershipType, -} -impl GcpOrganizationalData { - pub fn new(organization_membership_type: gcp_organizational_data::OrganizationMembershipType) -> Self { - Self { - organization_membership_type, - } - } -} -pub mod gcp_organizational_data { - use super::*; - #[doc = "The multi cloud account's membership type in the organization"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OrganizationMembershipType")] - pub enum OrganizationMembershipType { - Member, - Organization, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OrganizationMembershipType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OrganizationMembershipType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OrganizationMembershipType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Member => serializer.serialize_unit_variant("OrganizationMembershipType", 0u32, "Member"), - Self::Organization => serializer.serialize_unit_variant("OrganizationMembershipType", 1u32, "Organization"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The gcpOrganization data for the member account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpOrganizationalDataMember { - #[serde(flatten)] - pub gcp_organizational_data: GcpOrganizationalData, - #[doc = "If the multi cloud account is not of membership type organization, this will be the ID of the project's parent"] - #[serde(rename = "parentHierarchyId", default, skip_serializing_if = "Option::is_none")] - pub parent_hierarchy_id: Option, - #[doc = "The GCP management project number from organizational onboarding"] - #[serde(rename = "managementProjectNumber", default, skip_serializing_if = "Option::is_none")] - pub management_project_number: Option, -} -impl GcpOrganizationalDataMember { - pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { - Self { - gcp_organizational_data, - parent_hierarchy_id: None, - management_project_number: None, - } - } -} -#[doc = "The gcpOrganization data for the parent account"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpOrganizationalDataOrganization { - #[serde(flatten)] - pub gcp_organizational_data: GcpOrganizationalData, - #[doc = "If the multi cloud account is of membership type organization, list of accounts excluded from offering"] - #[serde( - rename = "excludedProjectNumbers", - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub excluded_project_numbers: Vec, - #[doc = "The service account email address which represents the organization level permissions container."] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The GCP workload identity provider id which represents the permissions required to auto provision security connectors"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - #[doc = "GCP organization name"] - #[serde(rename = "organizationName", default, skip_serializing_if = "Option::is_none")] - pub organization_name: Option, -} -impl GcpOrganizationalDataOrganization { - pub fn new(gcp_organizational_data: GcpOrganizationalData) -> Self { - Self { - gcp_organizational_data, - excluded_project_numbers: Vec::new(), - service_account_email_address: None, - workload_identity_provider_id: None, - organization_name: None, - } - } -} -#[doc = "The details about the project represented by the security connector"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct GcpProjectDetails { - #[doc = "The unique GCP Project number"] - #[serde(rename = "projectNumber", default, skip_serializing_if = "Option::is_none")] - pub project_number: Option, - #[doc = "The GCP Project id"] - #[serde(rename = "projectId", default, skip_serializing_if = "Option::is_none")] - pub project_id: Option, - #[doc = "The GCP workload identity federation pool id"] - #[serde(rename = "workloadIdentityPoolId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_pool_id: Option, - #[doc = "GCP project name"] - #[serde(rename = "projectName", default, skip_serializing_if = "Option::is_none")] - pub project_name: Option, -} -impl GcpProjectDetails { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The GCP project connector environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GcpProjectEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, - #[doc = "The gcpOrganization data"] - #[serde(rename = "organizationalData", default, skip_serializing_if = "Option::is_none")] - pub organizational_data: Option, - #[doc = "The details about the project represented by the security connector"] - #[serde(rename = "projectDetails", default, skip_serializing_if = "Option::is_none")] - pub project_details: Option, -} -impl GcpProjectEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { - environment_data, - organizational_data: None, - project_details: None, - } - } -} -#[doc = "The github scope connector's environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GithubScopeEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, -} -impl GithubScopeEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { environment_data } - } -} -#[doc = "The GitLab scope connector's environment data"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct GitlabScopeEnvironmentData { - #[serde(flatten)] - pub environment_data: EnvironmentData, -} -impl GitlabScopeEnvironmentData { - pub fn new(environment_data: EnvironmentData) -> Self { - Self { environment_data } - } -} -#[doc = "Identity for the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Identity { - #[doc = "The principal ID of resource identity."] - #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")] - pub principal_id: Option, - #[doc = "The tenant ID of resource."] - #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[doc = "The identity type."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Identity { - pub fn new() -> Self { - Self::default() - } -} -pub mod identity { - use super::*; - #[doc = "The identity type."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - pub enum Type { - SystemAssigned, - } -} -#[doc = "Describes an Azure resource with kind"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Kind { - #[doc = "Kind of the resource"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kind: Option, -} -impl Kind { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes an Azure resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Resource { - #[doc = "Resource Id"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Resource name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Resource type"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} -impl Resource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The security connector resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecurityConnector { - #[serde(flatten)] - pub tracked_resource: TrackedResource, - #[doc = "Metadata pertaining to creation and last modification of the resource."] - #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")] - pub system_data: Option, - #[doc = "A set of properties that defines the security connector configuration."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl SecurityConnector { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "A set of properties that defines the security connector configuration."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecurityConnectorProperties { - #[doc = "The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector)."] - #[serde(rename = "hierarchyIdentifier", default, skip_serializing_if = "Option::is_none")] - pub hierarchy_identifier: Option, - #[doc = "The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings."] - #[serde(rename = "hierarchyIdentifierTrialEndDate", default, with = "azure_core::date::rfc3339::option")] - pub hierarchy_identifier_trial_end_date: Option, - #[doc = "The multi cloud resource's cloud name."] - #[serde(rename = "environmentName", default, skip_serializing_if = "Option::is_none")] - pub environment_name: Option, - #[doc = "A collection of offerings for the security connector."] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub offerings: Vec, - #[doc = "The security connector environment data."] - #[serde(rename = "environmentData", default, skip_serializing_if = "Option::is_none")] - pub environment_data: Option, -} -impl SecurityConnectorProperties { - pub fn new() -> Self { - Self::default() - } -} -pub mod security_connector_properties { - use super::*; - #[doc = "The multi cloud resource's cloud name."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "EnvironmentName")] - pub enum EnvironmentName { - Azure, - #[serde(rename = "AWS")] - Aws, - #[serde(rename = "GCP")] - Gcp, - Github, - AzureDevOps, - GitLab, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for EnvironmentName { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for EnvironmentName { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for EnvironmentName { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Azure => serializer.serialize_unit_variant("EnvironmentName", 0u32, "Azure"), - Self::Aws => serializer.serialize_unit_variant("EnvironmentName", 1u32, "AWS"), - Self::Gcp => serializer.serialize_unit_variant("EnvironmentName", 2u32, "GCP"), - Self::Github => serializer.serialize_unit_variant("EnvironmentName", 3u32, "Github"), - Self::AzureDevOps => serializer.serialize_unit_variant("EnvironmentName", 4u32, "AzureDevOps"), - Self::GitLab => serializer.serialize_unit_variant("EnvironmentName", 5u32, "GitLab"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "List of security connectors response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SecurityConnectorsList { - #[doc = "The list of security connectors under the given scope."] - pub value: Vec, - #[doc = "The URI to fetch the next page."] - #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} -impl azure_core::Continuable for SecurityConnectorsList { - type Continuation = String; - fn continuation(&self) -> Option { - self.next_link.clone() - } -} -impl SecurityConnectorsList { - pub fn new(value: Vec) -> Self { - Self { value, next_link: None } - } -} -#[doc = "Security operator under a given subscription and pricing"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SecurityOperator { - #[serde(flatten)] - pub resource: Resource, - #[doc = "Identity for the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub identity: Option, -} -impl SecurityOperator { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "List of SecurityOperator response."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct SecurityOperatorList { - #[doc = "List of SecurityOperator configurations"] - pub value: Vec, -} -impl SecurityOperatorList { - pub fn new(value: Vec) -> Self { - Self { value } - } -} -#[doc = "A list of key value pairs that describe the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct Tags { - #[doc = "A list of key value pairs that describe the resource."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, -} -impl Tags { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "Describes an Azure tracked resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct TrackedResource { - #[serde(flatten)] - pub resource: Resource, - #[serde(flatten)] - pub azure_tracked_resource_location: AzureTrackedResourceLocation, - #[serde(flatten)] - pub kind: Kind, - #[serde(flatten)] - pub e_tag: ETag, - #[serde(flatten)] - pub tags: Tags, -} -impl TrackedResource { - pub fn new() -> Self { - Self::default() - } -} -#[doc = "The security offering details"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudOffering { - #[doc = "The type of the security offering."] - #[serde(rename = "offeringType")] - pub offering_type: cloud_offering::OfferingType, - #[doc = "The offering description."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, -} -impl CloudOffering { - pub fn new(offering_type: cloud_offering::OfferingType) -> Self { - Self { - offering_type, - description: None, - } - } -} -pub mod cloud_offering { - use super::*; - #[doc = "The type of the security offering."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "OfferingType")] - pub enum OfferingType { - CspmMonitorAws, - DefenderForContainersAws, - DefenderForServersAws, - DefenderForDatabasesAws, - InformationProtectionAws, - CspmMonitorGcp, - CspmMonitorGithub, - CspmMonitorAzureDevOps, - DefenderForServersGcp, - DefenderForContainersGcp, - DefenderForDatabasesGcp, - DefenderCspmAws, - DefenderCspmGcp, - DefenderForDevOpsGithub, - DefenderForDevOpsAzureDevOps, - CspmMonitorGitLab, - DefenderForDevOpsGitLab, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for OfferingType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for OfferingType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for OfferingType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::CspmMonitorAws => serializer.serialize_unit_variant("OfferingType", 0u32, "CspmMonitorAws"), - Self::DefenderForContainersAws => serializer.serialize_unit_variant("OfferingType", 1u32, "DefenderForContainersAws"), - Self::DefenderForServersAws => serializer.serialize_unit_variant("OfferingType", 2u32, "DefenderForServersAws"), - Self::DefenderForDatabasesAws => serializer.serialize_unit_variant("OfferingType", 3u32, "DefenderForDatabasesAws"), - Self::InformationProtectionAws => serializer.serialize_unit_variant("OfferingType", 4u32, "InformationProtectionAws"), - Self::CspmMonitorGcp => serializer.serialize_unit_variant("OfferingType", 5u32, "CspmMonitorGcp"), - Self::CspmMonitorGithub => serializer.serialize_unit_variant("OfferingType", 6u32, "CspmMonitorGithub"), - Self::CspmMonitorAzureDevOps => serializer.serialize_unit_variant("OfferingType", 7u32, "CspmMonitorAzureDevOps"), - Self::DefenderForServersGcp => serializer.serialize_unit_variant("OfferingType", 8u32, "DefenderForServersGcp"), - Self::DefenderForContainersGcp => serializer.serialize_unit_variant("OfferingType", 9u32, "DefenderForContainersGcp"), - Self::DefenderForDatabasesGcp => serializer.serialize_unit_variant("OfferingType", 10u32, "DefenderForDatabasesGcp"), - Self::DefenderCspmAws => serializer.serialize_unit_variant("OfferingType", 11u32, "DefenderCspmAws"), - Self::DefenderCspmGcp => serializer.serialize_unit_variant("OfferingType", 12u32, "DefenderCspmGcp"), - Self::DefenderForDevOpsGithub => serializer.serialize_unit_variant("OfferingType", 13u32, "DefenderForDevOpsGithub"), - Self::DefenderForDevOpsAzureDevOps => { - serializer.serialize_unit_variant("OfferingType", 14u32, "DefenderForDevOpsAzureDevOps") - } - Self::CspmMonitorGitLab => serializer.serialize_unit_variant("OfferingType", 15u32, "CspmMonitorGitLab"), - Self::DefenderForDevOpsGitLab => serializer.serialize_unit_variant("OfferingType", 16u32, "DefenderForDevOpsGitLab"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} -#[doc = "The CSPM monitoring for AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub native_cloud_connection: Option, -} -impl CspmMonitorAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - native_cloud_connection: None, - } - } -} -pub mod cspm_monitor_aws_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct NativeCloudConnection { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl NativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The CSPM monitoring for AzureDevOps offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorAzureDevOpsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl CspmMonitorAzureDevOpsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The CSPM monitoring for GCP offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub native_cloud_connection: Option, -} -impl CspmMonitorGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - native_cloud_connection: None, - } - } -} -pub mod cspm_monitor_gcp_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct NativeCloudConnection { - #[doc = "The GCP workload identity provider id for the offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - #[doc = "The service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - } - impl NativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The CSPM (Cloud security posture management) monitoring for gitlab offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorGitLabOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl CspmMonitorGitLabOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The CSPM monitoring for github offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct CspmMonitorGithubOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl CspmMonitorGithubOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The CSPM P1 for AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderCspmAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] - pub vm_scanners: Option, - #[doc = "The Microsoft Defender Data Sensitivity discovery configuration"] - #[serde(rename = "dataSensitivityDiscovery", default, skip_serializing_if = "Option::is_none")] - pub data_sensitivity_discovery: Option, - #[doc = "The databases DSPM configuration"] - #[serde(rename = "databasesDspm", default, skip_serializing_if = "Option::is_none")] - pub databases_dspm: Option, -} -impl DefenderCspmAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - vm_scanners: None, - data_sensitivity_discovery: None, - databases_dspm: None, - } - } -} -pub mod defender_cspm_aws_offering { - use super::*; - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VmScanners { - #[doc = "Is Microsoft Defender for Server VM scanning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VmScanners { - pub fn new() -> Self { - Self::default() - } - } - pub mod vm_scanners { - use super::*; - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - #[doc = "The scanning mode for the VM scan."] - #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] - pub scanning_mode: Option, - #[doc = "VM tags that indicates that VM should not be scanned"] - #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] - pub exclusion_tags: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The scanning mode for the VM scan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ScanningMode")] - pub enum ScanningMode { - Default, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ScanningMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ScanningMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ScanningMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } - #[doc = "The Microsoft Defender Data Sensitivity discovery configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DataSensitivityDiscovery { - #[doc = "Is Microsoft Defender Data Sensitivity discovery enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl DataSensitivityDiscovery { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The databases DSPM configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DatabasesDspm { - #[doc = "Is databases DSPM protection enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl DatabasesDspm { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The CSPM P1 for GCP offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderCspmGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderCspmGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for Databases AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderFoDatabasesAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The RDS configuration"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rds: Option, - #[doc = "The databases data security posture management (DSPM) configuration"] - #[serde(rename = "databasesDspm", default, skip_serializing_if = "Option::is_none")] - pub databases_dspm: Option, -} -impl DefenderFoDatabasesAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - arc_auto_provisioning: None, - rds: None, - databases_dspm: None, - } - } -} -pub mod defender_fo_databases_aws_offering { - use super::*; - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - #[doc = "Configuration for servers Arc auto provisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod arc_auto_provisioning { - use super::*; - #[doc = "Configuration for servers Arc auto provisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "Optional http proxy endpoint to use for the Arc agent"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub proxy: Option, - #[doc = "Optional Arc private link scope resource id to link the Arc agent"] - #[serde(rename = "privateLinkScope", default, skip_serializing_if = "Option::is_none")] - pub private_link_scope: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - } - #[doc = "The RDS configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Rds { - #[doc = "Is RDS protection enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl Rds { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The databases data security posture management (DSPM) configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DatabasesDspm { - #[doc = "Is databases data security posture management (DSPM) protection enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl DatabasesDspm { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Defender for Containers AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForContainersAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The kubernetes service connection configuration"] - #[serde(rename = "kubernetesService", default, skip_serializing_if = "Option::is_none")] - pub kubernetes_service: Option, - #[doc = "The kubernetes to scuba connection configuration"] - #[serde(rename = "kubernetesScubaReader", default, skip_serializing_if = "Option::is_none")] - pub kubernetes_scuba_reader: Option, - #[doc = "The cloudwatch to kinesis connection configuration"] - #[serde(rename = "cloudWatchToKinesis", default, skip_serializing_if = "Option::is_none")] - pub cloud_watch_to_kinesis: Option, - #[doc = "The kinesis to s3 connection configuration"] - #[serde(rename = "kinesisToS3", default, skip_serializing_if = "Option::is_none")] - pub kinesis_to_s3: Option, - #[doc = "The container vulnerability assessment configuration"] - #[serde(rename = "containerVulnerabilityAssessment", default, skip_serializing_if = "Option::is_none")] - pub container_vulnerability_assessment: Option, - #[doc = "The container vulnerability assessment task configuration"] - #[serde(rename = "containerVulnerabilityAssessmentTask", default, skip_serializing_if = "Option::is_none")] - pub container_vulnerability_assessment_task: Option, - #[doc = "Enable container vulnerability assessment feature"] - #[serde( - rename = "enableContainerVulnerabilityAssessment", - default, - skip_serializing_if = "Option::is_none" - )] - pub enable_container_vulnerability_assessment: Option, - #[doc = "Is audit logs pipeline auto provisioning enabled"] - #[serde(rename = "autoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub auto_provisioning: Option, - #[doc = "The retention time in days of kube audit logs set on the CloudWatch log group"] - #[serde(rename = "kubeAuditRetentionTime", default, skip_serializing_if = "Option::is_none")] - pub kube_audit_retention_time: Option, - #[doc = "The externalId used by the data reader to prevent the confused deputy attack"] - #[serde(rename = "scubaExternalId", default, skip_serializing_if = "Option::is_none")] - pub scuba_external_id: Option, -} -impl DefenderForContainersAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - kubernetes_service: None, - kubernetes_scuba_reader: None, - cloud_watch_to_kinesis: None, - kinesis_to_s3: None, - container_vulnerability_assessment: None, - container_vulnerability_assessment_task: None, - enable_container_vulnerability_assessment: None, - auto_provisioning: None, - kube_audit_retention_time: None, - scuba_external_id: None, - } - } -} -pub mod defender_for_containers_aws_offering { - use super::*; - #[doc = "The kubernetes service connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct KubernetesService { - #[doc = "The cloud role ARN in AWS for this feature used for provisioning resources"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl KubernetesService { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The kubernetes to scuba connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct KubernetesScubaReader { - #[doc = "The cloud role ARN in AWS for this feature used for reading data"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl KubernetesScubaReader { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The cloudwatch to kinesis connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct CloudWatchToKinesis { - #[doc = "The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl CloudWatchToKinesis { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The kinesis to s3 connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct KinesisToS3 { - #[doc = "The cloud role ARN in AWS used by Kinesis to transfer data into S3"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl KinesisToS3 { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The container vulnerability assessment configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ContainerVulnerabilityAssessment { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl ContainerVulnerabilityAssessment { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The container vulnerability assessment task configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ContainerVulnerabilityAssessmentTask { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl ContainerVulnerabilityAssessmentTask { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The containers GCP offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForContainersGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "nativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub native_cloud_connection: Option, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "dataPipelineNativeCloudConnection", default, skip_serializing_if = "Option::is_none")] - pub data_pipeline_native_cloud_connection: Option, - #[doc = "Is audit logs data collection enabled"] - #[serde(rename = "auditLogsAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] - pub audit_logs_auto_provisioning_flag: Option, - #[doc = "Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled"] - #[serde(rename = "defenderAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] - pub defender_agent_auto_provisioning_flag: Option, - #[doc = "Is Policy Kubernetes agent auto provisioning enabled"] - #[serde(rename = "policyAgentAutoProvisioningFlag", default, skip_serializing_if = "Option::is_none")] - pub policy_agent_auto_provisioning_flag: Option, -} -impl DefenderForContainersGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - native_cloud_connection: None, - data_pipeline_native_cloud_connection: None, - audit_logs_auto_provisioning_flag: None, - defender_agent_auto_provisioning_flag: None, - policy_agent_auto_provisioning_flag: None, - } - } -} -pub mod defender_for_containers_gcp_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct NativeCloudConnection { - #[doc = "The service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The GCP workload identity provider id for this offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - } - impl NativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DataPipelineNativeCloudConnection { - #[doc = "The data collection service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The data collection GCP workload identity provider id for this offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - } - impl DataPipelineNativeCloudConnection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Defender for Databases GCP offering configurations"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDatabasesGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The native cloud connection configuration"] - #[serde( - rename = "defenderForDatabasesArcAutoProvisioning", - default, - skip_serializing_if = "Option::is_none" - )] - pub defender_for_databases_arc_auto_provisioning: Option, -} -impl DefenderForDatabasesGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - arc_auto_provisioning: None, - defender_for_databases_arc_auto_provisioning: None, - } - } -} -pub mod defender_for_databases_gcp_offering { - use super::*; - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Configuration for servers Arc auto provisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod arc_auto_provisioning { - use super::*; - #[doc = "Configuration for servers Arc auto provisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "Optional http proxy endpoint to use for the Arc agent"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub proxy: Option, - #[doc = "Optional Arc private link scope resource id to link the Arc agent"] - #[serde(rename = "privateLinkScope", default, skip_serializing_if = "Option::is_none")] - pub private_link_scope: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - } - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DefenderForDatabasesArcAutoProvisioning { - #[doc = "The service account email address in GCP for this offering"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - #[doc = "The GCP workload identity provider id for this offering"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - } - impl DefenderForDatabasesArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "The Defender for DevOps for Azure DevOps offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDevOpsAzureDevOpsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderForDevOpsAzureDevOpsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for DevOps for Gitlab offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDevOpsGitLabOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderForDevOpsGitLabOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for DevOps for Github offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForDevOpsGithubOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, -} -impl DefenderForDevOpsGithubOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { cloud_offering } - } -} -#[doc = "The Defender for Servers AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForServersAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The Defender for servers connection configuration"] - #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] - pub defender_for_servers: Option, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub va_auto_provisioning: Option, - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub mde_auto_provisioning: Option, - #[doc = "configuration for the servers offering subPlan"] - #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] - pub sub_plan: Option, - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] - pub vm_scanners: Option, -} -impl DefenderForServersAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - defender_for_servers: None, - arc_auto_provisioning: None, - va_auto_provisioning: None, - mde_auto_provisioning: None, - sub_plan: None, - vm_scanners: None, - } - } -} -pub mod defender_for_servers_aws_offering { - use super::*; - #[doc = "The Defender for servers connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DefenderForServers { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl DefenderForServers { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - #[doc = "Configuration for servers Arc auto provisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod arc_auto_provisioning { - use super::*; - #[doc = "Configuration for servers Arc auto provisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "Optional HTTP proxy endpoint to use for the Arc agent"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub proxy: Option, - #[doc = "Optional Arc private link scope resource id to link the Arc agent"] - #[serde(rename = "privateLinkScope", default, skip_serializing_if = "Option::is_none")] - pub private_link_scope: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - } - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VaAutoProvisioning { - #[doc = "Is Vulnerability Assessment auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VaAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod va_auto_provisioning { - use super::*; - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Qualys, - #[serde(rename = "TVM")] - Tvm, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), - Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct MdeAutoProvisioning { - #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl MdeAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "configuration for the servers offering subPlan"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct SubPlan { - #[doc = "The available sub plans"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl SubPlan { - pub fn new() -> Self { - Self::default() - } - } - pub mod sub_plan { - use super::*; - #[doc = "The available sub plans"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - P1, - P2, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), - Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VmScanners { - #[doc = "Is Microsoft Defender for Server VM scanning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VmScanners { - pub fn new() -> Self { - Self::default() - } - } - pub mod vm_scanners { - use super::*; - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - #[doc = "The scanning mode for the VM scan."] - #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] - pub scanning_mode: Option, - #[doc = "VM tags that indicates that VM should not be scanned"] - #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] - pub exclusion_tags: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The scanning mode for the VM scan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ScanningMode")] - pub enum ScanningMode { - Default, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ScanningMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ScanningMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ScanningMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } -} -#[doc = "The Defender for Servers GCP offering configurations"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct DefenderForServersGcpOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The Defender for servers connection configuration"] - #[serde(rename = "defenderForServers", default, skip_serializing_if = "Option::is_none")] - pub defender_for_servers: Option, - #[doc = "The ARC autoprovisioning configuration"] - #[serde(rename = "arcAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub arc_auto_provisioning: Option, - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[serde(rename = "vaAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub va_auto_provisioning: Option, - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[serde(rename = "mdeAutoProvisioning", default, skip_serializing_if = "Option::is_none")] - pub mde_auto_provisioning: Option, - #[doc = "configuration for the servers offering subPlan"] - #[serde(rename = "subPlan", default, skip_serializing_if = "Option::is_none")] - pub sub_plan: Option, - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[serde(rename = "vmScanners", default, skip_serializing_if = "Option::is_none")] - pub vm_scanners: Option, -} -impl DefenderForServersGcpOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - defender_for_servers: None, - arc_auto_provisioning: None, - va_auto_provisioning: None, - mde_auto_provisioning: None, - sub_plan: None, - vm_scanners: None, - } - } -} -pub mod defender_for_servers_gcp_offering { - use super::*; - #[doc = "The Defender for servers connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct DefenderForServers { - #[doc = "The workload identity provider id in GCP for this feature"] - #[serde(rename = "workloadIdentityProviderId", default, skip_serializing_if = "Option::is_none")] - pub workload_identity_provider_id: Option, - #[doc = "The service account email address in GCP for this feature"] - #[serde(rename = "serviceAccountEmailAddress", default, skip_serializing_if = "Option::is_none")] - pub service_account_email_address: Option, - } - impl DefenderForServers { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "The ARC autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct ArcAutoProvisioning { - #[doc = "Is arc auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "Configuration for servers Arc auto provisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl ArcAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod arc_auto_provisioning { - use super::*; - #[doc = "Configuration for servers Arc auto provisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "Optional HTTP proxy endpoint to use for the Arc agent"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub proxy: Option, - #[doc = "Optional Arc private link scope resource id to link the Arc agent"] - #[serde(rename = "privateLinkScope", default, skip_serializing_if = "Option::is_none")] - pub private_link_scope: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - } - #[doc = "The Vulnerability Assessment autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VaAutoProvisioning { - #[doc = "Is Vulnerability Assessment auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VaAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - pub mod va_auto_provisioning { - use super::*; - #[doc = "configuration for Vulnerability Assessment autoprovisioning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - Qualys, - #[serde(rename = "TVM")] - Tvm, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Qualys => serializer.serialize_unit_variant("Type", 0u32, "Qualys"), - Self::Tvm => serializer.serialize_unit_variant("Type", 1u32, "TVM"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } - #[doc = "The Microsoft Defender for Endpoint autoprovisioning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct MdeAutoProvisioning { - #[doc = "Is Microsoft Defender for Endpoint auto provisioning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Endpoint autoprovisioning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl MdeAutoProvisioning { - pub fn new() -> Self { - Self::default() - } - } - #[doc = "configuration for the servers offering subPlan"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct SubPlan { - #[doc = "The available sub plans"] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - } - impl SubPlan { - pub fn new() -> Self { - Self::default() - } - } - pub mod sub_plan { - use super::*; - #[doc = "The available sub plans"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "Type")] - pub enum Type { - P1, - P2, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for Type { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for Type { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for Type { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::P1 => serializer.serialize_unit_variant("Type", 0u32, "P1"), - Self::P2 => serializer.serialize_unit_variant("Type", 1u32, "P2"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - #[doc = "The Microsoft Defender for Server VM scanning configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct VmScanners { - #[doc = "Is Microsoft Defender for Server VM scanning enabled"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub configuration: Option, - } - impl VmScanners { - pub fn new() -> Self { - Self::default() - } - } - pub mod vm_scanners { - use super::*; - #[doc = "configuration for Microsoft Defender for Server VM scanning"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct Configuration { - #[doc = "The scanning mode for the VM scan."] - #[serde(rename = "scanningMode", default, skip_serializing_if = "Option::is_none")] - pub scanning_mode: Option, - #[doc = "VM tags that indicate that VM should not be scanned"] - #[serde(rename = "exclusionTags", default, skip_serializing_if = "Option::is_none")] - pub exclusion_tags: Option, - } - impl Configuration { - pub fn new() -> Self { - Self::default() - } - } - pub mod configuration { - use super::*; - #[doc = "The scanning mode for the VM scan."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "ScanningMode")] - pub enum ScanningMode { - Default, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for ScanningMode { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for ScanningMode { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for ScanningMode { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::Default => serializer.serialize_unit_variant("ScanningMode", 0u32, "Default"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - } - } -} -#[doc = "The information protection for AWS offering"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct InformationProtectionAwsOffering { - #[serde(flatten)] - pub cloud_offering: CloudOffering, - #[doc = "The native cloud connection configuration"] - #[serde(rename = "informationProtection", default, skip_serializing_if = "Option::is_none")] - pub information_protection: Option, -} -impl InformationProtectionAwsOffering { - pub fn new(cloud_offering: CloudOffering) -> Self { - Self { - cloud_offering, - information_protection: None, - } - } -} -pub mod information_protection_aws_offering { - use super::*; - #[doc = "The native cloud connection configuration"] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] - pub struct InformationProtection { - #[doc = "The cloud role ARN in AWS for this feature"] - #[serde(rename = "cloudRoleArn", default, skip_serializing_if = "Option::is_none")] - pub cloud_role_arn: Option, - } - impl InformationProtection { - pub fn new() -> Self { - Self::default() - } - } -} -#[doc = "Metadata pertaining to creation and last modification of the resource."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] -pub struct SystemData { - #[doc = "The identity that created the resource."] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The type of identity that created the resource."] - #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")] - pub created_by_type: Option, - #[doc = "The timestamp of resource creation (UTC)."] - #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")] - pub created_at: Option, - #[doc = "The identity that last modified the resource."] - #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by: Option, - #[doc = "The type of identity that last modified the resource."] - #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] - pub last_modified_by_type: Option, - #[doc = "The timestamp of resource last modification (UTC)"] - #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")] - pub last_modified_at: Option, -} -impl SystemData { - pub fn new() -> Self { - Self::default() - } -} -pub mod system_data { - use super::*; - #[doc = "The type of identity that created the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "CreatedByType")] - pub enum CreatedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for CreatedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for CreatedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for CreatedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } - #[doc = "The type of identity that last modified the resource."] - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] - #[serde(remote = "LastModifiedByType")] - pub enum LastModifiedByType { - User, - Application, - ManagedIdentity, - Key, - #[serde(skip_deserializing)] - UnknownValue(String), - } - impl FromStr for LastModifiedByType { - type Err = value::Error; - fn from_str(s: &str) -> std::result::Result { - Self::deserialize(s.into_deserializer()) - } - } - impl<'de> Deserialize<'de> for LastModifiedByType { - fn deserialize(deserializer: D) -> std::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); - Ok(deserialized) - } - } - impl Serialize for LastModifiedByType { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - match self { - Self::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"), - Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"), - Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"), - Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"), - Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), - } - } - } -} diff --git a/services/mgmt/securityinsights/Cargo.toml b/services/mgmt/securityinsights/Cargo.toml index d8de8308a7..0cc336e8fd 100644 --- a/services/mgmt/securityinsights/Cargo.toml +++ b/services/mgmt/securityinsights/Cargo.toml @@ -32,12 +32,12 @@ env_logger = "0.10" all-features = true [features] -default = ["package-preview-2023-04", "enable_reqwest"] +default = ["package-preview-2023-05", "enable_reqwest"] enable_reqwest = ["azure_core/enable_reqwest"] enable_reqwest_rustls = ["azure_core/enable_reqwest_rustls"] no-default-tag = [] +"package-preview-2023-05" = [] "package-preview-2023-04" = [] "package-preview-2023-03" = [] "package-preview-2023-02" = [] -"package-preview-2022-12" = [] -"package-preview-2022-11" = [] \ No newline at end of file +"package-preview-2022-12" = [] \ No newline at end of file diff --git a/services/mgmt/securityinsights/README.md b/services/mgmt/securityinsights/README.md index d164a43298..3a10748431 100644 --- a/services/mgmt/securityinsights/README.md +++ b/services/mgmt/securityinsights/README.md @@ -6,12 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/securityin To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples). -The default tag is `package-preview-2023-04`. +The default tag is `package-preview-2023-05`. The following [tags](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/tags.md) are available: +- `package-preview-2023-05` has 167 operations from 1 API versions: `2023-05-01-preview`. Use crate feature `package-preview-2023-05` to enable. The operations will be in the `package_preview_2023_05` module. - `package-preview-2023-04` has 165 operations from 1 API versions: `2023-04-01-preview`. Use crate feature `package-preview-2023-04` to enable. The operations will be in the `package_preview_2023_04` module. - `package-preview-2023-03` has 121 operations from 1 API versions: `2023-03-01-preview`. Use crate feature `package-preview-2023-03` to enable. The operations will be in the `package_preview_2023_03` module. - `package-preview-2023-02` has 120 operations from 1 API versions: `2023-02-01-preview`. Use crate feature `package-preview-2023-02` to enable. The operations will be in the `package_preview_2023_02` module. -- `package-preview-2022-12` has 117 operations from 1 API versions: `2022-12-01-preview`. Use crate feature `package-preview-2022-12` to enable. The operations will be in the `package_preview_2022_12` module. -- `package-preview-2022-11` has 113 operations from 1 API versions: `2022-11-01-preview`. Use crate feature `package-preview-2022-11` to enable. The operations will be in the `package_preview_2022_11` module. \ No newline at end of file +- `package-preview-2022-12` has 117 operations from 1 API versions: `2022-12-01-preview`. Use crate feature `package-preview-2022-12` to enable. The operations will be in the `package_preview_2022_12` module. \ No newline at end of file diff --git a/services/mgmt/securityinsights/src/lib.rs b/services/mgmt/securityinsights/src/lib.rs index e387ac86bd..79c0775276 100644 --- a/services/mgmt/securityinsights/src/lib.rs +++ b/services/mgmt/securityinsights/src/lib.rs @@ -3,6 +3,10 @@ #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![allow(clippy::derive_partial_eq_without_eq)] +#[cfg(feature = "package-preview-2023-05")] +pub mod package_preview_2023_05; +#[cfg(all(feature = "package-preview-2023-05", not(feature = "no-default-tag")))] +pub use package_preview_2023_05::*; #[cfg(feature = "package-preview-2023-04")] pub mod package_preview_2023_04; #[cfg(all(feature = "package-preview-2023-04", not(feature = "no-default-tag")))] @@ -19,7 +23,3 @@ pub use package_preview_2023_02::*; pub mod package_preview_2022_12; #[cfg(all(feature = "package-preview-2022-12", not(feature = "no-default-tag")))] pub use package_preview_2022_12::*; -#[cfg(feature = "package-preview-2022-11")] -pub mod package_preview_2022_11; -#[cfg(all(feature = "package-preview-2022-11", not(feature = "no-default-tag")))] -pub use package_preview_2022_11::*; diff --git a/services/mgmt/securityinsights/src/package_preview_2022_11/mod.rs b/services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs similarity index 66% rename from services/mgmt/securityinsights/src/package_preview_2022_11/mod.rs rename to services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs index f35faec741..a90b0242e0 100644 --- a/services/mgmt/securityinsights/src/package_preview_2022_11/mod.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_05/mod.rs @@ -106,6 +106,9 @@ impl Client { pub fn actions_client(&self) -> actions::Client { actions::Client(self.clone()) } + pub fn alert_rule_client(&self) -> alert_rule::Client { + alert_rule::Client(self.clone()) + } pub fn alert_rule_templates_client(&self) -> alert_rule_templates::Client { alert_rule_templates::Client(self.clone()) } @@ -115,6 +118,9 @@ impl Client { pub fn automation_rules_client(&self) -> automation_rules::Client { automation_rules::Client(self.clone()) } + pub fn billing_statistics_client(&self) -> billing_statistics::Client { + billing_statistics::Client(self.clone()) + } pub fn bookmark_client(&self) -> bookmark::Client { bookmark::Client(self.clone()) } @@ -124,6 +130,18 @@ impl Client { pub fn bookmarks_client(&self) -> bookmarks::Client { bookmarks::Client(self.clone()) } + pub fn content_package_client(&self) -> content_package::Client { + content_package::Client(self.clone()) + } + pub fn content_packages_client(&self) -> content_packages::Client { + content_packages::Client(self.clone()) + } + pub fn content_template_client(&self) -> content_template::Client { + content_template::Client(self.clone()) + } + pub fn content_templates_client(&self) -> content_templates::Client { + content_templates::Client(self.clone()) + } pub fn data_connectors_client(&self) -> data_connectors::Client { data_connectors::Client(self.clone()) } @@ -160,12 +178,27 @@ impl Client { pub fn get_recommendations_client(&self) -> get_recommendations::Client { get_recommendations::Client(self.clone()) } + pub fn get_triggered_analytics_rule_runs_client(&self) -> get_triggered_analytics_rule_runs::Client { + get_triggered_analytics_rule_runs::Client(self.clone()) + } + pub fn hunt_comments_client(&self) -> hunt_comments::Client { + hunt_comments::Client(self.clone()) + } + pub fn hunt_relations_client(&self) -> hunt_relations::Client { + hunt_relations::Client(self.clone()) + } + pub fn hunts_client(&self) -> hunts::Client { + hunts::Client(self.clone()) + } pub fn incident_comments_client(&self) -> incident_comments::Client { incident_comments::Client(self.clone()) } pub fn incident_relations_client(&self) -> incident_relations::Client { incident_relations::Client(self.clone()) } + pub fn incident_tasks_client(&self) -> incident_tasks::Client { + incident_tasks::Client(self.clone()) + } pub fn incidents_client(&self) -> incidents::Client { incidents::Client(self.clone()) } @@ -181,9 +214,21 @@ impl Client { pub fn operations_client(&self) -> operations::Client { operations::Client(self.clone()) } + pub fn product_package_client(&self) -> product_package::Client { + product_package::Client(self.clone()) + } + pub fn product_packages_client(&self) -> product_packages::Client { + product_packages::Client(self.clone()) + } pub fn product_settings_client(&self) -> product_settings::Client { product_settings::Client(self.clone()) } + pub fn product_template_client(&self) -> product_template::Client { + product_template::Client(self.clone()) + } + pub fn product_templates_client(&self) -> product_templates::Client { + product_templates::Client(self.clone()) + } pub fn security_ml_analytics_settings_client(&self) -> security_ml_analytics_settings::Client { security_ml_analytics_settings::Client(self.clone()) } @@ -205,6 +250,9 @@ impl Client { pub fn threat_intelligence_indicators_client(&self) -> threat_intelligence_indicators::Client { threat_intelligence_indicators::Client(self.clone()) } + pub fn triggered_analytics_rule_run_client(&self) -> triggered_analytics_rule_run::Client { + triggered_analytics_rule_run::Client(self.clone()) + } pub fn update_client(&self) -> update::Client { update::Client(self.clone()) } @@ -214,6 +262,21 @@ impl Client { pub fn watchlists_client(&self) -> watchlists::Client { watchlists::Client(self.clone()) } + pub fn workspace_manager_assignment_jobs_client(&self) -> workspace_manager_assignment_jobs::Client { + workspace_manager_assignment_jobs::Client(self.clone()) + } + pub fn workspace_manager_assignments_client(&self) -> workspace_manager_assignments::Client { + workspace_manager_assignments::Client(self.clone()) + } + pub fn workspace_manager_configurations_client(&self) -> workspace_manager_configurations::Client { + workspace_manager_configurations::Client(self.clone()) + } + pub fn workspace_manager_groups_client(&self) -> workspace_manager_groups::Client { + workspace_manager_groups::Client(self.clone()) + } + pub fn workspace_manager_members_client(&self) -> workspace_manager_members::Client { + workspace_manager_members::Client(self.clone()) + } } pub mod alert_rules { use super::models; @@ -377,7 +440,7 @@ pub mod alert_rules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -393,7 +456,7 @@ pub mod alert_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -480,7 +543,7 @@ pub mod alert_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -569,7 +632,7 @@ pub mod alert_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.alert_rule)?; req.set_body(req_body); @@ -635,7 +698,7 @@ pub mod alert_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -820,7 +883,7 @@ pub mod actions { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -836,7 +899,7 @@ pub mod actions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -924,7 +987,7 @@ pub mod actions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1014,7 +1077,7 @@ pub mod actions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.action)?; req.set_body(req_body); @@ -1081,7 +1144,7 @@ pub mod actions { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1206,7 +1269,7 @@ pub mod alert_rule_templates { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1222,7 +1285,7 @@ pub mod alert_rule_templates { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1309,7 +1372,7 @@ pub mod alert_rule_templates { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1489,7 +1552,7 @@ pub mod automation_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1583,7 +1646,7 @@ pub mod automation_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = if let Some(automation_rule_to_upsert) = &this.automation_rule_to_upsert { req.insert_header("content-type", "application/json"); azure_core::to_json(automation_rule_to_upsert)? @@ -1676,7 +1739,7 @@ pub mod automation_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -1766,7 +1829,7 @@ pub mod automation_rules { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -1782,7 +1845,7 @@ pub mod automation_rules { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -1803,33 +1866,34 @@ pub mod automation_rules { } } } -pub mod incidents { +pub mod entities { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Triggers playbook on a specific incident"] + #[doc = "Triggers playbook on a specific entity."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_identifier`: Entity identifier."] pub fn run_playbook( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_identifier: impl Into, + entity_identifier: impl Into, ) -> run_playbook::RequestBuilder { run_playbook::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_identifier: incident_identifier.into(), + entity_identifier: entity_identifier.into(), request_body: None, } } - #[doc = "Gets all incidents."] + #[doc = "Gets all entities."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -1846,199 +1910,109 @@ pub mod incidents { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - filter: None, - orderby: None, - top: None, - skip_token: None, } } - #[doc = "Gets an incident."] + #[doc = "Gets an entity."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `entity_id`: entity ID"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, + entity_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - } - } - #[doc = "Creates or updates the incident."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `incident`: The incident"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - incident: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - incident: incident.into(), - } - } - #[doc = "Delete the incident."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - } - } - #[doc = "Creates a Microsoft team to investigate the incident by sharing information and insights between participants."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `team_properties`: Team properties"] - pub fn create_team( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - team_properties: impl Into, - ) -> create_team::RequestBuilder { - create_team::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - team_properties: team_properties.into(), + entity_id: entity_id.into(), } } - #[doc = "Gets all incident alerts."] + #[doc = "Expands an entity."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - pub fn list_alerts( + #[doc = "* `entity_id`: entity ID"] + #[doc = "* `parameters`: The parameters required to execute an expand operation on the given entity."] + pub fn expand( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, - ) -> list_alerts::RequestBuilder { - list_alerts::RequestBuilder { + entity_id: impl Into, + parameters: impl Into, + ) -> expand::RequestBuilder { + expand::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), + entity_id: entity_id.into(), + parameters: parameters.into(), } } - #[doc = "Gets all incident bookmarks."] + #[doc = "Get Insights and Activities for an entity."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - pub fn list_bookmarks( + #[doc = "* `entity_id`: entity ID"] + #[doc = "* `kind`: The Kind parameter for queries"] + pub fn queries( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, - ) -> list_bookmarks::RequestBuilder { - list_bookmarks::RequestBuilder { + entity_id: impl Into, + kind: impl Into, + ) -> queries::RequestBuilder { + queries::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), + entity_id: entity_id.into(), + kind: kind.into(), } } - #[doc = "Gets all incident related entities."] + #[doc = "Execute Insights for an entity."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - pub fn list_entities( + #[doc = "* `entity_id`: entity ID"] + #[doc = "* `parameters`: The parameters required to execute insights on the given entity."] + pub fn get_insights( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, - ) -> list_entities::RequestBuilder { - list_entities::RequestBuilder { + entity_id: impl Into, + parameters: impl Into, + ) -> get_insights::RequestBuilder { + get_insights::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), + entity_id: entity_id.into(), + parameters: parameters.into(), } } } pub mod run_playbook { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: serde_json::Value = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -2059,11 +2033,12 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_identifier: String, - pub(crate) request_body: Option, + pub(crate) entity_identifier: String, + pub(crate) request_body: Option, } impl RequestBuilder { - pub fn request_body(mut self, request_body: impl Into) -> Self { + #[doc = "Describes the request body for triggering a playbook on an entity."] + pub fn request_body(mut self, request_body: impl Into) -> Self { self.request_body = Some(request_body.into()); self } @@ -2075,7 +2050,7 @@ pub mod incidents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/runPlaybook" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_identifier)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/runPlaybook" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_identifier)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -2085,7 +2060,7 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = if let Some(request_body) = &this.request_body { req.insert_header("content-type", "application/json"); azure_core::to_json(request_body)? @@ -2098,26 +2073,14 @@ pub mod incidents { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IncidentList = serde_json::from_slice(&bytes)?; + let body: models::EntityList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2157,37 +2120,13 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) filter: Option, - pub(crate) orderby: Option, - pub(crate) top: Option, - pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Sorts the results. Optional."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "Returns only the first n results. Optional."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] - pub fn skip_token(mut self, skip_token: impl Into) -> Self { - self.skip_token = Some(skip_token.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -2204,7 +2143,7 @@ pub mod incidents { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -2220,19 +2159,7 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip_token) = &this.skip_token { - req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -2256,9 +2183,9 @@ pub mod incidents { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Incident = serde_json::from_slice(&bytes)?; + let body: models::Entity = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2298,7 +2225,7 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, + pub(crate) entity_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2309,7 +2236,7 @@ pub mod incidents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -2319,7 +2246,7 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -2328,9 +2255,9 @@ pub mod incidents { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] #[doc = ""] @@ -2340,13 +2267,13 @@ pub mod incidents { } } } - pub mod create_or_update { + pub mod expand { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Incident = serde_json::from_slice(&bytes)?; + let body: models::EntityExpandResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2386,8 +2313,8 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) incident: models::Incident, + pub(crate) entity_id: String, + pub(crate) parameters: models::EntityExpandParameters, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2398,8 +2325,8 @@ pub mod incidents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/expand" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2408,9 +2335,9 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.incident)?; + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2418,8 +2345,8 @@ pub mod incidents { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2430,66 +2357,13 @@ pub mod incidents { } } } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) incident_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } - pub mod create_team { + pub mod queries { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::TeamInformation = serde_json::from_slice(&bytes)?; + let body: models::GetQueriesResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2529,8 +2403,8 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) team_properties: models::TeamProperties, + pub(crate) entity_id: String, + pub(crate) kind: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2541,8 +2415,8 @@ pub mod incidents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/createTeam" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/queries" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -2551,9 +2425,10 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.team_properties)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let kind = &this.kind; + req.url_mut().query_pairs_mut().append_pair("kind", kind); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2561,8 +2436,8 @@ pub mod incidents { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2573,13 +2448,13 @@ pub mod incidents { } } } - pub mod list_alerts { + pub mod get_insights { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IncidentAlertList = serde_json::from_slice(&bytes)?; + let body: models::EntityGetInsightsResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2619,7 +2494,8 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, + pub(crate) entity_id: String, + pub(crate) parameters: models::EntityGetInsightsParameters, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -2630,7 +2506,7 @@ pub mod incidents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/alerts" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/getInsights" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -2640,9 +2516,9 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2650,8 +2526,8 @@ pub mod incidents { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2662,102 +2538,224 @@ pub mod incidents { } } } - pub mod list_bookmarks { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::IncidentBookmarkList = serde_json::from_slice(&bytes)?; - Ok(body) +} +pub mod incidents { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Triggers playbook on a specific incident"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn run_playbook( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_identifier: impl Into, + ) -> run_playbook::RequestBuilder { + run_playbook::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_identifier: incident_identifier.into(), + request_body: None, } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 + } + #[doc = "Gets all incidents."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 + } + #[doc = "Gets an incident."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), } } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() + #[doc = "Creates or updates the incident."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident`: The incident"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident: incident.into(), } } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + #[doc = "Delete the incident."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), } } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) incident_id: String, + #[doc = "Creates a Microsoft team to investigate the incident by sharing information and insights between participants."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `team_properties`: Team properties"] + pub fn create_team( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + team_properties: impl Into, + ) -> create_team::RequestBuilder { + create_team::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + team_properties: team_properties.into(), + } } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/bookmarks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + #[doc = "Gets all incident alerts."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn list_alerts( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> list_alerts::RequestBuilder { + list_alerts::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + #[doc = "Gets all incident bookmarks."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn list_bookmarks( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> list_bookmarks::RequestBuilder { + list_bookmarks::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + } + } + #[doc = "Gets all incident related entities."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn list_entities( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> list_entities::RequestBuilder { + list_entities::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), } } } - pub mod list_entities { + pub mod run_playbook { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IncidentEntitiesResponse = serde_json::from_slice(&bytes)?; + let body: serde_json::Value = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2797,9 +2795,14 @@ pub mod incidents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, + pub(crate) incident_identifier: String, + pub(crate) request_body: Option, } impl RequestBuilder { + pub fn request_body(mut self, request_body: impl Into) -> Self { + self.request_body = Some(request_body.into()); + self + } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2808,7 +2811,7 @@ pub mod incidents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/entities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/runPlaybook" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_identifier)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -2818,9 +2821,13 @@ pub mod incidents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(request_body) = &this.request_body { + req.insert_header("content-type", "application/json"); + azure_core::to_json(request_body)? + } else { + azure_core::EMPTY_BODY + }; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -2828,8 +2835,8 @@ pub mod incidents { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -2840,107 +2847,13 @@ pub mod incidents { } } } -} -pub mod bookmarks { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all bookmarks."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - } - } - #[doc = "Gets a bookmark."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - } - } - #[doc = "Creates or updates the bookmark."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - #[doc = "* `bookmark`: The bookmark"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - bookmark: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - bookmark: bookmark.into(), - } - } - #[doc = "Delete the bookmark."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - } - } - } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BookmarkList = serde_json::from_slice(&bytes)?; + let body: models::IncidentList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -2980,13 +2893,37 @@ pub mod bookmarks { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - } + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -3003,7 +2940,7 @@ pub mod bookmarks { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -3019,7 +2956,19 @@ pub mod bookmarks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -3043,9 +2992,9 @@ pub mod bookmarks { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Bookmark = serde_json::from_slice(&bytes)?; + let body: models::Incident = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3085,7 +3034,7 @@ pub mod bookmarks { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, + pub(crate) incident_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3096,7 +3045,7 @@ pub mod bookmarks { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -3106,7 +3055,7 @@ pub mod bookmarks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3115,8 +3064,8 @@ pub mod bookmarks { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3131,9 +3080,9 @@ pub mod bookmarks { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Bookmark = serde_json::from_slice(&bytes)?; + let body: models::Incident = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3173,8 +3122,8 @@ pub mod bookmarks { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, - pub(crate) bookmark: models::Bookmark, + pub(crate) incident_id: String, + pub(crate) incident: models::Incident, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3185,7 +3134,7 @@ pub mod bookmarks { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -3195,9 +3144,9 @@ pub mod bookmarks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.bookmark)?; + let req_body = azure_core::to_json(&this.incident)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3205,8 +3154,8 @@ pub mod bookmarks { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3240,7 +3189,7 @@ pub mod bookmarks { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, + pub(crate) incident_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3251,7 +3200,7 @@ pub mod bookmarks { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -3261,7 +3210,7 @@ pub mod bookmarks { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -3270,123 +3219,13 @@ pub mod bookmarks { } } } -} -pub mod bookmark_relations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all bookmark relations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - filter: None, - orderby: None, - top: None, - skip_token: None, - } - } - #[doc = "Gets a bookmark relation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - #[doc = "* `relation_name`: Relation Name"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - relation_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - relation_name: relation_name.into(), - } - } - #[doc = "Creates the bookmark relation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - #[doc = "* `relation_name`: Relation Name"] - #[doc = "* `relation`: The relation model"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - relation_name: impl Into, - relation: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - relation_name: relation_name.into(), - relation: relation.into(), - } - } - #[doc = "Delete the bookmark relation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - #[doc = "* `relation_name`: Relation Name"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - relation_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - relation_name: relation_name.into(), - } - } - } - pub mod list { + pub mod create_team { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RelationList = serde_json::from_slice(&bytes)?; + let body: models::TeamInformation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3426,110 +3265,58 @@ pub mod bookmark_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, - pub(crate) filter: Option, - pub(crate) orderby: Option, - pub(crate) top: Option, - pub(crate) skip_token: Option, + pub(crate) incident_id: String, + pub(crate) team_properties: models::TeamInformation, } impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/createTeam" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.team_properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } - #[doc = "Sorts the results. Optional."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } - #[doc = "Returns only the first n results. Optional."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] - pub fn skip_token(mut self, skip_token: impl Into) -> Self { - self.skip_token = Some(skip_token.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip_token) = &this.skip_token { - req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } - }; - azure_core::Pageable::new(make_request) - } - } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Relation = serde_json::from_slice(&bytes)?; - Ok(body) + } + } + pub mod list_alerts { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentAlertList = serde_json::from_slice(&bytes)?; + Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { self.0 @@ -3568,8 +3355,7 @@ pub mod bookmark_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, - pub(crate) relation_name: String, + pub(crate) incident_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3580,8 +3366,8 @@ pub mod bookmark_relations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id , & this . relation_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/alerts" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3590,8 +3376,9 @@ pub mod bookmark_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3599,8 +3386,8 @@ pub mod bookmark_relations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3611,13 +3398,13 @@ pub mod bookmark_relations { } } } - pub mod create_or_update { + pub mod list_bookmarks { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Relation = serde_json::from_slice(&bytes)?; + let body: models::IncidentBookmarkList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3657,9 +3444,7 @@ pub mod bookmark_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, - pub(crate) relation_name: String, - pub(crate) relation: models::Relation, + pub(crate) incident_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3670,8 +3455,8 @@ pub mod bookmark_relations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id , & this . relation_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/bookmarks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -3680,9 +3465,9 @@ pub mod bookmark_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.relation)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3690,8 +3475,8 @@ pub mod bookmark_relations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3702,98 +3487,13 @@ pub mod bookmark_relations { } } } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, - pub(crate) relation_name: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id , & this . relation_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } -} -pub mod bookmark { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Expand an bookmark"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `bookmark_id`: Bookmark ID"] - #[doc = "* `parameters`: The parameters required to execute an expand operation on the given bookmark."] - pub fn expand( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - bookmark_id: impl Into, - parameters: impl Into, - ) -> expand::RequestBuilder { - expand::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - bookmark_id: bookmark_id.into(), - parameters: parameters.into(), - } - } - } - pub mod expand { + pub mod list_entities { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::BookmarkExpandResponse = serde_json::from_slice(&bytes)?; + let body: models::IncidentEntitiesResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3833,8 +3533,7 @@ pub mod bookmark { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) bookmark_id: String, - pub(crate) parameters: models::BookmarkExpandParameters, + pub(crate) incident_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -3845,7 +3544,7 @@ pub mod bookmark { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/expand" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/entities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -3855,9 +3554,9 @@ pub mod bookmark { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -3865,8 +3564,8 @@ pub mod bookmark { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -3878,37 +3577,59 @@ pub mod bookmark { } } } -pub mod ip_geodata { +pub mod billing_statistics { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get geodata for a single IP address"] + #[doc = "Gets all Microsoft Sentinel billing statistics."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `ip_address`: IP address (v4 or v6) to be enriched"] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Gets a billing statistic"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `billing_statistic_name`: The name of the billing statistic"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, - ip_address: impl Into, + workspace_name: impl Into, + billing_statistic_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), - ip_address: ip_address.into(), + workspace_name: workspace_name.into(), + billing_statistic_name: billing_statistic_name.into(), } } } - pub mod get { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnrichmentIpGeodata = serde_json::from_slice(&bytes)?; + let body: models::BillingStatisticList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -3947,77 +3668,63 @@ pub mod ip_geodata { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) ip_address: String, + pub(crate) workspace_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name - ))?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let ip_address = &this.ip_address; - req.url_mut().query_pairs_mut().append_pair("ipAddress", ip_address); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/billingStatistics" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod domain_whois { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get whois information for a single domain name"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `domain`: Domain name to be enriched"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - domain: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - domain: domain.into(), + }; + azure_core::Pageable::new(make_request) } } } @@ -4025,9 +3732,9 @@ pub mod domain_whois { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EnrichmentDomainWhois = serde_json::from_slice(&bytes)?; + let body: models::BillingStatistic = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4066,7 +3773,8 @@ pub mod domain_whois { pub(crate) client: super::super::Client, pub(crate) subscription_id: String, pub(crate) resource_group_name: String, - pub(crate) domain: String, + pub(crate) workspace_name: String, + pub(crate) billing_statistic_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -4077,12 +3785,7 @@ pub mod domain_whois { Box::pin({ let this = self.clone(); async move { - let url = azure_core::Url::parse(&format!( - "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/", - this.client.endpoint(), - &this.subscription_id, - &this.resource_group_name - ))?; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/billingStatistics/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . billing_statistic_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -4092,9 +3795,7 @@ pub mod domain_whois { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let domain = &this.domain; - req.url_mut().query_pairs_mut().append_pair("domain", domain); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4103,8 +3804,8 @@ pub mod domain_whois { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4116,11 +3817,11 @@ pub mod domain_whois { } } } -pub mod entities { +pub mod bookmarks { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all entities."] + #[doc = "Gets all bookmarks."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -4139,101 +3840,73 @@ pub mod entities { workspace_name: workspace_name.into(), } } - #[doc = "Gets an entity."] + #[doc = "Gets a bookmark."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] + #[doc = "* `bookmark_id`: Bookmark ID"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - entity_id: impl Into, + bookmark_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - } - } - #[doc = "Expands an entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] - #[doc = "* `parameters`: The parameters required to execute an expand operation on the given entity."] - pub fn expand( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - entity_id: impl Into, - parameters: impl Into, - ) -> expand::RequestBuilder { - expand::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - parameters: parameters.into(), + bookmark_id: bookmark_id.into(), } } - #[doc = "Get Insights and Activities for an entity."] + #[doc = "Creates or updates the bookmark."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] - #[doc = "* `kind`: The Kind parameter for queries"] - pub fn queries( + #[doc = "* `bookmark_id`: Bookmark ID"] + #[doc = "* `bookmark`: The bookmark"] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - entity_id: impl Into, - kind: impl Into, - ) -> queries::RequestBuilder { - queries::RequestBuilder { + bookmark_id: impl Into, + bookmark: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - kind: kind.into(), + bookmark_id: bookmark_id.into(), + bookmark: bookmark.into(), } } - #[doc = "Execute Insights for an entity."] + #[doc = "Delete the bookmark."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] - #[doc = "* `parameters`: The parameters required to execute insights on the given entity."] - pub fn get_insights( + #[doc = "* `bookmark_id`: Bookmark ID"] + pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - entity_id: impl Into, - parameters: impl Into, - ) -> get_insights::RequestBuilder { - get_insights::RequestBuilder { + bookmark_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - parameters: parameters.into(), + bookmark_id: bookmark_id.into(), } } } @@ -4241,9 +3914,9 @@ pub mod entities { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EntityList = serde_json::from_slice(&bytes)?; + let body: models::BookmarkList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4285,11 +3958,11 @@ pub mod entities { pub(crate) workspace_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -4306,7 +3979,7 @@ pub mod entities { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4322,7 +3995,7 @@ pub mod entities { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -4346,9 +4019,9 @@ pub mod entities { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Entity = serde_json::from_slice(&bytes)?; + let body: models::Bookmark = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4388,7 +4061,7 @@ pub mod entities { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_id: String, + pub(crate) bookmark_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -4399,7 +4072,7 @@ pub mod entities { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -4409,7 +4082,7 @@ pub mod entities { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4418,8 +4091,8 @@ pub mod entities { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4430,13 +4103,13 @@ pub mod entities { } } } - pub mod expand { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EntityExpandResponse = serde_json::from_slice(&bytes)?; + let body: models::Bookmark = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4476,8 +4149,8 @@ pub mod entities { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_id: String, - pub(crate) parameters: models::EntityExpandParameters, + pub(crate) bookmark_id: String, + pub(crate) bookmark: models::Bookmark, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -4488,8 +4161,8 @@ pub mod entities { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/expand" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -4498,9 +4171,9 @@ pub mod entities { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; + let req_body = azure_core::to_json(&this.bookmark)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -4508,8 +4181,8 @@ pub mod entities { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -4520,32 +4193,9 @@ pub mod entities { } } } - pub mod queries { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::GetQueriesResponse = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -4566,8 +4216,7 @@ pub mod entities { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_id: String, - pub(crate) kind: String, + pub(crate) bookmark_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -4578,8 +4227,8 @@ pub mod entities { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/queries" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -4588,9 +4237,7 @@ pub mod entities { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let kind = &this.kind; - req.url_mut().query_pairs_mut().append_pair("kind", kind); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -4598,137 +4245,114 @@ pub mod entities { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod get_insights { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EntityGetInsightsResponse = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) entity_id: String, - pub(crate) parameters: models::EntityGetInsightsParameters, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/getInsights" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod entities_get_timeline { +pub mod bookmark_relations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Timeline for an entity."] + #[doc = "Gets all bookmark relations."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] - #[doc = "* `parameters`: The parameters required to execute an timeline operation on the given entity."] + #[doc = "* `bookmark_id`: Bookmark ID"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - entity_id: impl Into, - parameters: impl Into, + bookmark_id: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - parameters: parameters.into(), + bookmark_id: bookmark_id.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets a bookmark relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `bookmark_id`: Bookmark ID"] + #[doc = "* `relation_name`: Relation Name"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + bookmark_id: impl Into, + relation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + bookmark_id: bookmark_id.into(), + relation_name: relation_name.into(), + } + } + #[doc = "Creates the bookmark relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `bookmark_id`: Bookmark ID"] + #[doc = "* `relation_name`: Relation Name"] + #[doc = "* `relation`: The relation model"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + bookmark_id: impl Into, + relation_name: impl Into, + relation: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + bookmark_id: bookmark_id.into(), + relation_name: relation_name.into(), + relation: relation.into(), + } + } + #[doc = "Delete the bookmark relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `bookmark_id`: Bookmark ID"] + #[doc = "* `relation_name`: Relation Name"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + bookmark_id: impl Into, + relation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + bookmark_id: bookmark_id.into(), + relation_name: relation_name.into(), } } } @@ -4736,9 +4360,9 @@ pub mod entities_get_timeline { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EntityTimelineResponse = serde_json::from_slice(&bytes)?; + let body: models::RelationList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -4778,160 +4402,38 @@ pub mod entities_get_timeline { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_id: String, - pub(crate) parameters: models::EntityTimelineParameters, + pub(crate) bookmark_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/getTimeline" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.parameters)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } -} -pub mod entities_relations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all relations of an entity."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - entity_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - filter: None, - orderby: None, - top: None, - skip_token: None, - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::RelationList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) entity_id: String, - pub(crate) filter: Option, - pub(crate) orderby: Option, - pub(crate) top: Option, - pub(crate) skip_token: Option, - } - impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Sorts the results. Optional."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "Returns only the first n results. Optional."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] - pub fn skip_token(mut self, skip_token: impl Into) -> Self { - self.skip_token = Some(skip_token.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -4948,7 +4450,7 @@ pub mod entities_relations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -4964,7 +4466,7 @@ pub mod entities_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -4996,38 +4498,7 @@ pub mod entities_relations { } } } -} -pub mod entity_relations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets an entity relation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_id`: entity ID"] - #[doc = "* `relation_name`: Relation Name"] - pub fn get_relation( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - entity_id: impl Into, - relation_name: impl Into, - ) -> get_relation::RequestBuilder { - get_relation::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - entity_id: entity_id.into(), - relation_name: relation_name.into(), - } - } - } - pub mod get_relation { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { @@ -5073,7 +4544,7 @@ pub mod entity_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_id: String, + pub(crate) bookmark_id: String, pub(crate) relation_name: String, } impl RequestBuilder { @@ -5085,7 +4556,7 @@ pub mod entity_relations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id , & this . relation_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id , & this . relation_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5095,7 +4566,7 @@ pub mod entity_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5116,125 +4587,30 @@ pub mod entity_relations { } } } -} -pub mod entity_queries { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets all entity queries."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - kind: None, + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Relation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "Gets an entity query."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_query_id`: entity query ID"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - entity_query_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - entity_query_id: entity_query_id.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Creates or updates the entity query."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_query_id`: entity query ID"] - #[doc = "* `entity_query`: The entity query we want to create or update"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - entity_query_id: impl Into, - entity_query: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - entity_query_id: entity_query_id.into(), - entity_query: entity_query.into(), - } - } - #[doc = "Delete the entity query."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_query_id`: entity query ID"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - entity_query_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - entity_query_id: entity_query_id.into(), - } - } - } - pub mod list { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EntityQueryList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() } } #[derive(Clone)] @@ -5257,100 +4633,54 @@ pub mod entity_queries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) kind: Option, + pub(crate) bookmark_id: String, + pub(crate) relation_name: String, + pub(crate) relation: models::Relation, } impl RequestBuilder { - #[doc = "The entity query kind we want to fetch"] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id , & this . relation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.relation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::EntityQuery = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -5371,7 +4701,8 @@ pub mod entity_queries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_query_id: String, + pub(crate) bookmark_id: String, + pub(crate) relation_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5382,8 +4713,8 @@ pub mod entity_queries { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id , & this . relation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -5392,7 +4723,7 @@ pub mod entity_queries { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5400,26 +4731,45 @@ pub mod entity_queries { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod bookmark { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Expand an bookmark"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `bookmark_id`: Bookmark ID"] + #[doc = "* `parameters`: The parameters required to execute an expand operation on the given bookmark."] + pub fn expand( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + bookmark_id: impl Into, + parameters: impl Into, + ) -> expand::RequestBuilder { + expand::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + bookmark_id: bookmark_id.into(), + parameters: parameters.into(), } } } - pub mod create_or_update { + pub mod expand { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EntityQuery = serde_json::from_slice(&bytes)?; + let body: models::BookmarkExpandResponse = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5459,8 +4809,8 @@ pub mod entity_queries { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_query_id: String, - pub(crate) entity_query: models::CustomEntityQuery, + pub(crate) bookmark_id: String, + pub(crate) parameters: models::BookmarkExpandParameters, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5471,8 +4821,8 @@ pub mod entity_queries { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/bookmarks/{}/expand" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . bookmark_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -5481,9 +4831,9 @@ pub mod entity_queries { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.entity_query)?; + let req_body = azure_core::to_json(&this.parameters)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -5491,8 +4841,8 @@ pub mod entity_queries { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5503,65 +4853,12 @@ pub mod entity_queries { } } } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) entity_query_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - } } -pub mod entity_query_templates { +pub mod content_packages { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all entity query templates."] + #[doc = "Gets all installed packages."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -5578,29 +4875,32 @@ pub mod entity_query_templates { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - kind: None, + filter: None, + orderby: None, + top: None, + skip_token: None, } } - #[doc = "Gets an entity query."] + #[doc = "Gets an installed packages by its id."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `entity_query_template_id`: entity query template ID"] + #[doc = "* `package_id`: package Id"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - entity_query_template_id: impl Into, + package_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - entity_query_template_id: entity_query_template_id.into(), + package_id: package_id.into(), } } } @@ -5608,9 +4908,9 @@ pub mod entity_query_templates { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EntityQueryTemplateList = serde_json::from_slice(&bytes)?; + let body: models::PackageList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5650,19 +4950,37 @@ pub mod entity_query_templates { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) kind: Option, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "The entity template query kind we want to fetch"] - pub fn kind(mut self, kind: impl Into) -> Self { - self.kind = Some(kind.into()); + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueryTemplates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentPackages" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -5679,7 +4997,7 @@ pub mod entity_query_templates { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5695,9 +5013,18 @@ pub mod entity_query_templates { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(kind) = &this.kind { - req.url_mut().query_pairs_mut().append_pair("kind", kind); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -5722,9 +5049,9 @@ pub mod entity_query_templates { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + let body: models::PackageModel = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5764,7 +5091,7 @@ pub mod entity_query_templates { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) entity_query_template_id: String, + pub(crate) package_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -5775,7 +5102,7 @@ pub mod entity_query_templates { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_template_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentPackages/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . package_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -5785,7 +5112,7 @@ pub mod entity_query_templates { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -5794,8 +5121,8 @@ pub mod entity_query_templates { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -5807,110 +5134,65 @@ pub mod entity_query_templates { } } } -pub mod file_imports { +pub mod content_package { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all file imports."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - filter: None, - orderby: None, - top: None, - skip_token: None, - } - } - #[doc = "Gets a file import."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `file_import_id`: File import ID"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - file_import_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - file_import_id: file_import_id.into(), - } - } - #[doc = "Creates the file import."] + #[doc = "Install a package to the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `file_import_id`: File import ID"] - #[doc = "* `file_import`: The file import"] - pub fn create( + #[doc = "* `package_id`: package Id"] + #[doc = "* `package_installation_properties`: Package installation properties"] + pub fn install( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - file_import_id: impl Into, - file_import: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + package_id: impl Into, + package_installation_properties: impl Into, + ) -> install::RequestBuilder { + install::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - file_import_id: file_import_id.into(), - file_import: file_import.into(), + package_id: package_id.into(), + package_installation_properties: package_installation_properties.into(), } } - #[doc = "Delete the file import."] + #[doc = "Uninstall a package from the workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `file_import_id`: File import ID"] - pub fn delete( + #[doc = "* `package_id`: package Id"] + pub fn uninstall( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - file_import_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + package_id: impl Into, + ) -> uninstall::RequestBuilder { + uninstall::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - file_import_id: file_import_id.into(), + package_id: package_id.into(), } } } - pub mod list { + pub mod install { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FileImportList = serde_json::from_slice(&bytes)?; + let body: models::PackageModel = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -5950,127 +5232,53 @@ pub mod file_imports { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) filter: Option, - pub(crate) orderby: Option, - pub(crate) top: Option, - pub(crate) skip_token: Option, + pub(crate) package_id: String, + pub(crate) package_installation_properties: models::PackageModel, } impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Sorts the results. Optional."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "Returns only the first n results. Optional."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] - pub fn skip_token(mut self, skip_token: impl Into) -> Self { - self.skip_token = Some(skip_token.into()); - self - } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip_token) = &this.skip_token { - req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentPackages/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . package_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.package_installation_properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) } } - } - pub mod get { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::FileImport = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } + } + pub mod uninstall { + use super::models; + pub struct Response(azure_core::Response); #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -6091,7 +5299,7 @@ pub mod file_imports { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) file_import_id: String, + pub(crate) package_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6102,8 +5310,8 @@ pub mod file_imports { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . file_import_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentPackages/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . package_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -6112,7 +5320,7 @@ pub mod file_imports { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6120,26 +5328,43 @@ pub mod file_imports { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod product_packages { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all packages from the catalog."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, } } } - pub mod create { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FileImport = serde_json::from_slice(&bytes)?; + let body: models::PackageList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6179,57 +5404,136 @@ pub mod file_imports { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) file_import_id: String, - pub(crate) file_import: models::FileImport, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . file_import_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.file_import)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentProductPackages" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod product_package { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a package by its identifier from the catalog."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `package_id`: package Id"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + package_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + package_id: package_id.into(), } } } - pub mod delete { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::FileImport = serde_json::from_slice(&bytes)?; + let body: models::PackageModel = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6269,10 +5573,9 @@ pub mod file_imports { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) file_import_id: String, + pub(crate) package_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6281,8 +5584,8 @@ pub mod file_imports { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . file_import_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentProductPackages/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . package_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -6291,7 +5594,7 @@ pub mod file_imports { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6300,8 +5603,8 @@ pub mod file_imports { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6313,122 +5616,41 @@ pub mod file_imports { } } } -pub mod incident_comments { +pub mod product_templates { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all incident comments."] + #[doc = "Gets all templates in the catalog."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), filter: None, orderby: None, top: None, skip_token: None, } } - #[doc = "Gets an incident comment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `incident_comment_id`: Incident comment ID"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - incident_comment_id: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - incident_comment_id: incident_comment_id.into(), - } - } - #[doc = "Creates or updates the incident comment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `incident_comment_id`: Incident comment ID"] - #[doc = "* `incident_comment`: The incident comment"] - pub fn create_or_update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - incident_comment_id: impl Into, - incident_comment: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - incident_comment_id: incident_comment_id.into(), - incident_comment: incident_comment.into(), - } - } - #[doc = "Delete the incident comment."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `incident_comment_id`: Incident comment ID"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - incident_comment_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - incident_comment_id: incident_comment_id.into(), - } - } } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IncidentCommentList = serde_json::from_slice(&bytes)?; + let body: models::TemplateList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6468,7 +5690,6 @@ pub mod incident_comments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, pub(crate) filter: Option, pub(crate) orderby: Option, pub(crate) top: Option, @@ -6495,11 +5716,11 @@ pub mod incident_comments { self.skip_token = Some(skip_token.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentProductTemplates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -6516,7 +5737,7 @@ pub mod incident_comments { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -6532,7 +5753,7 @@ pub mod incident_comments { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); if let Some(filter) = &this.filter { req.url_mut().query_pairs_mut().append_pair("$filter", filter); } @@ -6564,13 +5785,41 @@ pub mod incident_comments { } } } +} +pub mod product_template { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a template by its identifier."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `template_id`: template Id"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + template_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + template_id: template_id.into(), + } + } + } pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IncidentComment = serde_json::from_slice(&bytes)?; + let body: models::TemplateModel = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6610,8 +5859,7 @@ pub mod incident_comments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) incident_comment_id: String, + pub(crate) template_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -6622,7 +5870,7 @@ pub mod incident_comments { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_comment_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentproducttemplates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . template_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -6632,7 +5880,7 @@ pub mod incident_comments { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -6641,8 +5889,8 @@ pub mod incident_comments { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -6653,13 +5901,42 @@ pub mod incident_comments { } } } - pub mod create_or_update { +} +pub mod content_templates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all installed templates."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::IncidentComment = serde_json::from_slice(&bytes)?; + let body: models::TemplateList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6699,222 +5976,183 @@ pub mod incident_comments { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) incident_comment_id: String, - pub(crate) incident_comment: models::IncidentComment, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.incident_comment)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentTemplates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod delete { - use super::models; - pub struct Response(azure_core::Response); - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) incident_comment_id: String, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_comment_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) + }; + azure_core::Pageable::new(make_request) } } } } -pub mod incident_relations { +pub mod content_template { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all incident relations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - incident_id: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - filter: None, - orderby: None, - top: None, - skip_token: None, - } - } - #[doc = "Gets an incident relation."] + #[doc = "Gets a template byt its identifier."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `relation_name`: Relation Name"] + #[doc = "* `template_id`: template Id"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, - relation_name: impl Into, + template_id: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - relation_name: relation_name.into(), + template_id: template_id.into(), } } - #[doc = "Creates or updates the incident relation."] + #[doc = "Install a template."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `relation_name`: Relation Name"] - #[doc = "* `relation`: The relation model"] - pub fn create_or_update( + #[doc = "* `template_id`: template Id"] + #[doc = "* `template_installation_properties`: Template installation properties"] + pub fn install( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, - relation_name: impl Into, - relation: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + template_id: impl Into, + template_installation_properties: impl Into, + ) -> install::RequestBuilder { + install::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - relation_name: relation_name.into(), - relation: relation.into(), + template_id: template_id.into(), + template_installation_properties: template_installation_properties.into(), } } - #[doc = "Delete the incident relation."] + #[doc = "Delete an installed template."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `incident_id`: Incident ID"] - #[doc = "* `relation_name`: Relation Name"] + #[doc = "* `template_id`: template Id"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - incident_id: impl Into, - relation_name: impl Into, + template_id: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - incident_id: incident_id.into(), - relation_name: relation_name.into(), + template_id: template_id.into(), } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RelationList = serde_json::from_slice(&bytes)?; + let body: models::TemplateModel = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -6954,109 +6192,6254 @@ pub mod incident_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) filter: Option, - pub(crate) orderby: Option, - pub(crate) top: Option, - pub(crate) skip_token: Option, + pub(crate) template_id: String, } impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentTemplates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . template_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } - #[doc = "Sorts the results. Optional."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } - #[doc = "Returns only the first n results. Optional."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self + } + } + pub mod install { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TemplateModel = serde_json::from_slice(&bytes)?; + Ok(body) } - #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] - pub fn skip_token(mut self, skip_token: impl Into) -> Self { - self.skip_token = Some(skip_token.into()); - self + pub fn into_raw_response(self) -> azure_core::Response { + self.0 } - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) template_id: String, + pub(crate) template_installation_properties: models::TemplateModel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip_token) = &this.skip_token { - req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await - } + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentTemplates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . template_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.template_installation_properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) template_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/contentTemplates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . template_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod ip_geodata { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get geodata for a single IP address"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `ip_address`: IP address (v4 or v6) to be enriched"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + ip_address: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + ip_address: ip_address.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnrichmentIpGeodata = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) ip_address: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let ip_address = &this.ip_address; + req.url_mut().query_pairs_mut().append_pair("ipAddress", ip_address); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod domain_whois { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get whois information for a single domain name"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `domain`: Domain name to be enriched"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + domain: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + domain: domain.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EnrichmentDomainWhois = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) domain: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core::Url::parse(&format!( + "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/", + this.client.endpoint(), + &this.subscription_id, + &this.resource_group_name + ))?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let domain = &this.domain; + req.url_mut().query_pairs_mut().append_pair("domain", domain); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod entities_get_timeline { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Timeline for an entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_id`: entity ID"] + #[doc = "* `parameters`: The parameters required to execute an timeline operation on the given entity."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_id: impl Into, + parameters: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_id: entity_id.into(), + parameters: parameters.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EntityTimelineResponse = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_id: String, + pub(crate) parameters: models::EntityTimelineParameters, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/getTimeline" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.parameters)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod entities_relations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all relations of an entity."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_id`: entity ID"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_id: entity_id.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RelationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } +} +pub mod entity_relations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets an entity relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_id`: entity ID"] + #[doc = "* `relation_name`: Relation Name"] + pub fn get_relation( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_id: impl Into, + relation_name: impl Into, + ) -> get_relation::RequestBuilder { + get_relation::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_id: entity_id.into(), + relation_name: relation_name.into(), + } + } + } + pub mod get_relation { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Relation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_id: String, + pub(crate) relation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entities/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_id , & this . relation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod entity_queries { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all entity queries."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + kind: None, + } + } + #[doc = "Gets an entity query."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_query_id`: entity query ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_query_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_query_id: entity_query_id.into(), + } + } + #[doc = "Creates or updates the entity query."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_query_id`: entity query ID"] + #[doc = "* `entity_query`: The entity query we want to create or update"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_query_id: impl Into, + entity_query: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_query_id: entity_query_id.into(), + entity_query: entity_query.into(), + } + } + #[doc = "Delete the entity query."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_query_id`: entity query ID"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_query_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_query_id: entity_query_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EntityQueryList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) kind: Option, + } + impl RequestBuilder { + #[doc = "The entity query kind we want to fetch"] + pub fn kind(mut self, kind: impl Into) -> Self { + self.kind = Some(kind.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(kind) = &this.kind { + req.url_mut().query_pairs_mut().append_pair("kind", kind); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EntityQuery = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_query_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EntityQuery = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_query_id: String, + pub(crate) entity_query: models::CustomEntityQuery, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.entity_query)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_query_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueries/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod entity_query_templates { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all entity query templates."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + kind: None, + } + } + #[doc = "Gets an entity query."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `entity_query_template_id`: entity query template ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + entity_query_template_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + entity_query_template_id: entity_query_template_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EntityQueryTemplateList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) kind: Option, + } + impl RequestBuilder { + #[doc = "The entity template query kind we want to fetch"] + pub fn kind(mut self, kind: impl Into) -> Self { + self.kind = Some(kind.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueryTemplates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(kind) = &this.kind { + req.url_mut().query_pairs_mut().append_pair("kind", kind); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::EntityQueryTemplate = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) entity_query_template_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . entity_query_template_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod file_imports { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all file imports."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets a file import."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `file_import_id`: File import ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + file_import_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + file_import_id: file_import_id.into(), + } + } + #[doc = "Creates the file import."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `file_import_id`: File import ID"] + #[doc = "* `file_import`: The file import"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + file_import_id: impl Into, + file_import: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + file_import_id: file_import_id.into(), + file_import: file_import.into(), + } + } + #[doc = "Delete the file import."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `file_import_id`: File import ID"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + file_import_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + file_import_id: file_import_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FileImportList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FileImport = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) file_import_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . file_import_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FileImport = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) file_import_id: String, + pub(crate) file_import: models::FileImport, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . file_import_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.file_import)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::FileImport = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) file_import_id: String, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/fileImports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . file_import_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod hunts { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all hunts, without relations and comments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets a hunt, without relations and comments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + } + } + #[doc = "Create or update a hunt"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt`: The hunt"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt: hunt.into(), + } + } + #[doc = "Delete a hunt."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Hunt = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Hunt = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt: models::Hunt, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.hunt)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod hunt_relations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all hunt relations"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets a hunt relation"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt_relation_id`: The hunt relation id (GUID)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt_relation_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt_relation_id: hunt_relation_id.into(), + } + } + #[doc = "Creates or updates a hunt relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt_relation_id`: The hunt relation id (GUID)"] + #[doc = "* `hunt_relation`: The hunt relation"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt_relation_id: impl Into, + hunt_relation: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt_relation_id: hunt_relation_id.into(), + hunt_relation: hunt_relation.into(), + } + } + #[doc = "Delete a hunt relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt_relation_id`: The hunt relation id (GUID)"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt_relation_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt_relation_id: hunt_relation_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntRelationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntRelation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt_relation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id , & this . hunt_relation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntRelation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt_relation_id: String, + pub(crate) hunt_relation: models::HuntRelation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id , & this . hunt_relation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.hunt_relation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt_relation_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id , & this . hunt_relation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod hunt_comments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all hunt comments"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets a hunt comment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt_comment_id`: The hunt comment id (GUID)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt_comment_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt_comment_id: hunt_comment_id.into(), + } + } + #[doc = "Creates or updates a hunt relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt_comment_id`: The hunt comment id (GUID)"] + #[doc = "* `hunt_comment`: The hunt comment"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt_comment_id: impl Into, + hunt_comment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt_comment_id: hunt_comment_id.into(), + hunt_comment: hunt_comment.into(), + } + } + #[doc = "Delete a hunt comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `hunt_id`: The hunt id (GUID)"] + #[doc = "* `hunt_comment_id`: The hunt comment id (GUID)"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + hunt_id: impl Into, + hunt_comment_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + hunt_id: hunt_id.into(), + hunt_comment_id: hunt_comment_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntCommentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/comments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntComment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt_comment_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id , & this . hunt_comment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::HuntComment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt_comment_id: String, + pub(crate) hunt_comment: models::HuntComment, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id , & this . hunt_comment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.hunt_comment)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) hunt_id: String, + pub(crate) hunt_comment_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/hunts/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . hunt_id , & this . hunt_comment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod incident_comments { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all incident comments."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets an incident comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident_comment_id`: Incident comment ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident_comment_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident_comment_id: incident_comment_id.into(), + } + } + #[doc = "Creates or updates the incident comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident_comment_id`: Incident comment ID"] + #[doc = "* `incident_comment`: The incident comment"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident_comment_id: impl Into, + incident_comment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident_comment_id: incident_comment_id.into(), + incident_comment: incident_comment.into(), + } + } + #[doc = "Delete the incident comment."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident_comment_id`: Incident comment ID"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident_comment_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident_comment_id: incident_comment_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentCommentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentComment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) incident_comment_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_comment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentComment = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) incident_comment_id: String, + pub(crate) incident_comment: models::IncidentComment, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_comment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.incident_comment)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) incident_comment_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/comments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_comment_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod incident_relations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all incident relations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Gets an incident relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `relation_name`: Relation Name"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + relation_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + relation_name: relation_name.into(), + } + } + #[doc = "Creates or updates the incident relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `relation_name`: Relation Name"] + #[doc = "* `relation`: The relation model"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + relation_name: impl Into, + relation: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + relation_name: relation_name.into(), + relation: relation.into(), + } + } + #[doc = "Delete the incident relation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `relation_name`: Relation Name"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + relation_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + relation_name: relation_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RelationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Relation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) relation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . relation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Relation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) relation_name: String, + pub(crate) relation: models::Relation, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . relation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.relation)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) relation_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . relation_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod incident_tasks { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all incident tasks."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + } + } + #[doc = "Gets an incident task."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident_task_id`: Incident task ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident_task_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident_task_id: incident_task_id.into(), + } + } + #[doc = "Creates or updates the incident task."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident_task_id`: Incident task ID"] + #[doc = "* `incident_task`: The incident task"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident_task_id: impl Into, + incident_task: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident_task_id: incident_task_id.into(), + incident_task: incident_task.into(), + } + } + #[doc = "Delete the incident task."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `incident_id`: Incident ID"] + #[doc = "* `incident_task_id`: Incident task ID"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + incident_id: impl Into, + incident_task_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + incident_id: incident_id.into(), + incident_task_id: incident_task_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentTaskList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/tasks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) incident_task_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/tasks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_task_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create_or_update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::IncidentTask = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) incident_task_id: String, + pub(crate) incident_task: models::IncidentTask, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/tasks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_task_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.incident_task)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) incident_id: String, + pub(crate) incident_task_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/tasks/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . incident_task_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod metadata { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List of all metadata"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip: None, + } + } + #[doc = "Get a Metadata."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `metadata_name`: The Metadata name."] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + metadata_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + metadata_name: metadata_name.into(), + } + } + #[doc = "Create a Metadata."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `metadata_name`: The Metadata name."] + #[doc = "* `metadata`: Metadata resource."] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + metadata_name: impl Into, + metadata: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + metadata_name: metadata_name.into(), + metadata: metadata.into(), + } + } + #[doc = "Update an existing Metadata."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `metadata_name`: The Metadata name."] + #[doc = "* `metadata_patch`: Partial metadata request."] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + metadata_name: impl Into, + metadata_patch: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + metadata_name: metadata_name.into(), + metadata_patch: metadata_patch.into(), + } + } + #[doc = "Delete a Metadata."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `metadata_name`: The Metadata name."] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + metadata_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + metadata_name: metadata_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MetadataList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip: Option, + } + impl RequestBuilder { + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results if there are any left."] + pub fn skip(mut self, skip: i32) -> Self { + self.skip = Some(skip); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MetadataModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) metadata_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MetadataModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) metadata_name: String, + pub(crate) metadata: models::MetadataModel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.metadata)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod update { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::MetadataModel = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) metadata_name: String, + pub(crate) metadata_patch: models::MetadataPatch, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.metadata_patch)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) metadata_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod office_consents { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all office365 consents."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + #[doc = "Gets an office365 consent."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `consent_id`: consent ID"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + consent_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + consent_id: consent_id.into(), + } + } + #[doc = "Delete the office365 consent."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `consent_id`: consent ID"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + consent_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + consent_id: consent_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OfficeConsentList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/officeConsents" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } }; azure_core::Pageable::new(make_request) } } } - pub mod get { + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::OfficeConsent = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) consent_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/officeConsents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . consent_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) consent_id: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/officeConsents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . consent_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod sentinel_onboarding_states { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Sentinel onboarding state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `sentinel_onboarding_state_name`: The Sentinel onboarding state name. Supports - default"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + sentinel_onboarding_state_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + sentinel_onboarding_state_name: sentinel_onboarding_state_name.into(), + } + } + #[doc = "Create Sentinel onboarding state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `sentinel_onboarding_state_name`: The Sentinel onboarding state name. Supports - default"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + sentinel_onboarding_state_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + sentinel_onboarding_state_name: sentinel_onboarding_state_name.into(), + sentinel_onboarding_state_parameter: None, + } + } + #[doc = "Delete Sentinel onboarding state"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `sentinel_onboarding_state_name`: The Sentinel onboarding state name. Supports - default"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + sentinel_onboarding_state_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + sentinel_onboarding_state_name: sentinel_onboarding_state_name.into(), + } + } + #[doc = "Gets all Sentinel onboarding states"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SentinelOnboardingState = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) sentinel_onboarding_state_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . sentinel_onboarding_state_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod create { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SentinelOnboardingState = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) sentinel_onboarding_state_name: String, + pub(crate) sentinel_onboarding_state_parameter: Option, + } + impl RequestBuilder { + #[doc = "The Sentinel onboarding state parameter"] + pub fn sentinel_onboarding_state_parameter( + mut self, + sentinel_onboarding_state_parameter: impl Into, + ) -> Self { + self.sentinel_onboarding_state_parameter = Some(sentinel_onboarding_state_parameter.into()); + self + } + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . sentinel_onboarding_state_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = if let Some(sentinel_onboarding_state_parameter) = &this.sentinel_onboarding_state_parameter { + req.insert_header("content-type", "application/json"); + azure_core::to_json(sentinel_onboarding_state_parameter)? + } else { + azure_core::EMPTY_BODY + }; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) sentinel_onboarding_state_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . sentinel_onboarding_state_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SentinelOnboardingStatesList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } + } +} +pub mod get_recommendations { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of all recommendations."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Relation = serde_json::from_slice(&bytes)?; + let body: models::RecommendationList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7096,8 +12479,6 @@ pub mod incident_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) relation_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7108,7 +12489,7 @@ pub mod incident_relations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . relation_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/recommendations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7118,7 +12499,7 @@ pub mod incident_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7127,8 +12508,8 @@ pub mod incident_relations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7139,13 +12520,41 @@ pub mod incident_relations { } } } - pub mod create_or_update { +} +pub mod get { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a recommendation by its id."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `recommendation_id`: Recommendation Id."] + pub fn single_recommendation( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + recommendation_id: impl Into, + ) -> single_recommendation::RequestBuilder { + single_recommendation::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + recommendation_id: recommendation_id.into(), + } + } + } + pub mod single_recommendation { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Relation = serde_json::from_slice(&bytes)?; + let body: models::Recommendation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7185,9 +12594,7 @@ pub mod incident_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) relation_name: String, - pub(crate) relation: models::Relation, + pub(crate) recommendation_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7198,8 +12605,8 @@ pub mod incident_relations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . relation_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/recommendations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . recommendation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -7208,9 +12615,8 @@ pub mod incident_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.relation)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -7218,8 +12624,8 @@ pub mod incident_relations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7230,9 +12636,63 @@ pub mod incident_relations { } } } - pub mod delete { +} +pub mod update { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Patch a recommendation."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `recommendation_id`: Recommendation Id."] + #[doc = "* `recommendation_patch`: Recommendation Fields to Update."] + pub fn recommendation( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + recommendation_id: impl Into, + recommendation_patch: Vec, + ) -> recommendation::RequestBuilder { + recommendation::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + recommendation_id: recommendation_id.into(), + recommendation_patch, + } + } + } + pub mod recommendation { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Recommendation = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -7253,10 +12713,11 @@ pub mod incident_relations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) incident_id: String, - pub(crate) relation_name: String, + pub(crate) recommendation_id: String, + pub(crate) recommendation_patch: Vec, } impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7265,8 +12726,8 @@ pub mod incident_relations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/incidents/{}/relations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . incident_id , & this . relation_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/recommendations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . recommendation_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Patch); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -7275,21 +12736,34 @@ pub mod incident_relations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.recommendation_patch)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod metadata { +pub mod security_ml_analytics_settings { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "List of all metadata"] + #[doc = "Gets all Security ML Analytics Settings."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -7306,104 +12780,75 @@ pub mod metadata { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - filter: None, - orderby: None, - top: None, - skip: None, } } - #[doc = "Get a Metadata."] + #[doc = "Gets the Security ML Analytics Settings."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `metadata_name`: The Metadata name."] + #[doc = "* `settings_resource_name`: Security ML Analytics Settings resource name"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - metadata_name: impl Into, + settings_resource_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - metadata_name: metadata_name.into(), - } - } - #[doc = "Create a Metadata."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `metadata_name`: The Metadata name."] - #[doc = "* `metadata`: Metadata resource."] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - metadata_name: impl Into, - metadata: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - metadata_name: metadata_name.into(), - metadata: metadata.into(), + settings_resource_name: settings_resource_name.into(), } } - #[doc = "Update an existing Metadata."] + #[doc = "Creates or updates the Security ML Analytics Settings."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `metadata_name`: The Metadata name."] - #[doc = "* `metadata_patch`: Partial metadata request."] - pub fn update( + #[doc = "* `settings_resource_name`: Security ML Analytics Settings resource name"] + #[doc = "* `security_ml_analytics_setting`: The security ML Analytics setting"] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - metadata_name: impl Into, - metadata_patch: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { + settings_resource_name: impl Into, + security_ml_analytics_setting: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - metadata_name: metadata_name.into(), - metadata_patch: metadata_patch.into(), + settings_resource_name: settings_resource_name.into(), + security_ml_analytics_setting: security_ml_analytics_setting.into(), } } - #[doc = "Delete a Metadata."] + #[doc = "Delete the Security ML Analytics Settings."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `metadata_name`: The Metadata name."] + #[doc = "* `settings_resource_name`: Security ML Analytics Settings resource name"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - metadata_name: impl Into, + settings_resource_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - metadata_name: metadata_name.into(), + settings_resource_name: settings_resource_name.into(), } } } @@ -7411,9 +12856,9 @@ pub mod metadata { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MetadataList = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSettingsList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7445,45 +12890,21 @@ pub mod metadata { #[doc = r" operation and returns a `Result` with the parsed response."] #[doc = r""] #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) filter: Option, - pub(crate) orderby: Option, - pub(crate) top: Option, - pub(crate) skip: Option, - } - impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } - #[doc = "Sorts the results. Optional."] - pub fn orderby(mut self, orderby: impl Into) -> Self { - self.orderby = Some(orderby.into()); - self - } - #[doc = "Returns only the first n results. Optional."] - pub fn top(mut self, top: i32) -> Self { - self.top = Some(top); - self - } - #[doc = "Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results if there are any left."] - pub fn skip(mut self, skip: i32) -> Self { - self.skip = Some(skip); - self - } - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -7500,7 +12921,7 @@ pub mod metadata { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -7516,19 +12937,7 @@ pub mod metadata { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); - } - if let Some(top) = &this.top { - req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string()); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -7552,9 +12961,9 @@ pub mod metadata { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MetadataModel = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7594,7 +13003,7 @@ pub mod metadata { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) metadata_name: String, + pub(crate) settings_resource_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7605,7 +13014,7 @@ pub mod metadata { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_resource_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7615,7 +13024,7 @@ pub mod metadata { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7624,8 +13033,8 @@ pub mod metadata { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7636,13 +13045,13 @@ pub mod metadata { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::MetadataModel = serde_json::from_slice(&bytes)?; + let body: models::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7682,8 +13091,8 @@ pub mod metadata { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) metadata_name: String, - pub(crate) metadata: models::MetadataModel, + pub(crate) settings_resource_name: String, + pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7694,7 +13103,7 @@ pub mod metadata { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_resource_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7704,99 +13113,9 @@ pub mod metadata { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.metadata)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) - } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } - } - pub mod update { - use super::models; - pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::MetadataModel = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - pub(crate) metadata_name: String, - pub(crate) metadata_patch: models::MetadataPatch, - } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.metadata_patch)?; + let req_body = azure_core::to_json(&this.security_ml_analytics_setting)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -7804,8 +13123,8 @@ pub mod metadata { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -7839,7 +13158,7 @@ pub mod metadata { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) metadata_name: String, + pub(crate) settings_resource_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -7850,7 +13169,7 @@ pub mod metadata { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/metadata/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . metadata_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_resource_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -7860,7 +13179,7 @@ pub mod metadata { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -7870,11 +13189,11 @@ pub mod metadata { } } } -pub mod office_consents { +pub mod product_settings { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all office365 consents."] + #[doc = "List of all the settings"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -7893,58 +13212,170 @@ pub mod office_consents { workspace_name: workspace_name.into(), } } - #[doc = "Gets an office365 consent."] + #[doc = "Gets a setting."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `consent_id`: consent ID"] + #[doc = "* `settings_name`: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - consent_id: impl Into, + settings_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - consent_id: consent_id.into(), + settings_name: settings_name.into(), + } + } + #[doc = "Updates setting."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `settings_name`: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba"] + #[doc = "* `settings`: The setting"] + pub fn update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + settings_name: impl Into, + settings: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + settings_name: settings_name.into(), + settings: settings.into(), + } + } + #[doc = "Delete setting of the product."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `settings_name`: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + settings_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + settings_name: settings_name.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SettingList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } - #[doc = "Delete the office365 consent."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `consent_id`: consent ID"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - consent_id: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - consent_id: consent_id.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OfficeConsentList = serde_json::from_slice(&bytes)?; + let body: models::Settings = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -7984,72 +13415,55 @@ pub mod office_consents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) settings_name: String, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/officeConsents" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod get { + pub mod update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::OfficeConsent = serde_json::from_slice(&bytes)?; + let body: models::Settings = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8089,7 +13503,8 @@ pub mod office_consents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) consent_id: String, + pub(crate) settings_name: String, + pub(crate) settings: models::Settings, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8100,8 +13515,8 @@ pub mod office_consents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/officeConsents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . consent_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8110,8 +13525,9 @@ pub mod office_consents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.settings)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -8119,8 +13535,8 @@ pub mod office_consents { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8154,7 +13570,7 @@ pub mod office_consents { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) consent_id: String, + pub(crate) settings_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8165,7 +13581,7 @@ pub mod office_consents { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/officeConsents/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . consent_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -8175,114 +13591,251 @@ pub mod office_consents { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } - }) + }) + } + } + } +} +pub mod source_control { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of repositories metadata."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `repo_type`: The repo type."] + pub fn list_repositories( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + repo_type: impl Into, + ) -> list_repositories::RequestBuilder { + list_repositories::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + repo_type: repo_type.into(), + } + } + } + pub mod list_repositories { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::RepoList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) repo_type: models::RepoType, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/listRepositories" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.repo_type)?; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } } -pub mod sentinel_onboarding_states { +pub mod source_controls { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get Sentinel onboarding state"] + #[doc = "Gets all source controls, without source control items."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `sentinel_onboarding_state_name`: The Sentinel onboarding state name. Supports - default"] - pub fn get( + pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - sentinel_onboarding_state_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - sentinel_onboarding_state_name: sentinel_onboarding_state_name.into(), } } - #[doc = "Create Sentinel onboarding state"] + #[doc = "Gets a source control byt its identifier."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `sentinel_onboarding_state_name`: The Sentinel onboarding state name. Supports - default"] - pub fn create( + #[doc = "* `source_control_id`: Source control Id"] + pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - sentinel_onboarding_state_name: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + source_control_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - sentinel_onboarding_state_name: sentinel_onboarding_state_name.into(), - sentinel_onboarding_state_parameter: None, + source_control_id: source_control_id.into(), } } - #[doc = "Delete Sentinel onboarding state"] + #[doc = "Creates a source control."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `sentinel_onboarding_state_name`: The Sentinel onboarding state name. Supports - default"] - pub fn delete( + #[doc = "* `source_control_id`: Source control Id"] + #[doc = "* `source_control`: The SourceControl"] + pub fn create( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - sentinel_onboarding_state_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + source_control_id: impl Into, + source_control: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - sentinel_onboarding_state_name: sentinel_onboarding_state_name.into(), + source_control_id: source_control_id.into(), + source_control: source_control.into(), } } - #[doc = "Gets all Sentinel onboarding states"] + #[doc = "Delete a source control."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( + #[doc = "* `source_control_id`: Source control Id"] + pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + source_control_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + source_control_id: source_control_id.into(), } } } - pub mod get { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SentinelOnboardingState = serde_json::from_slice(&bytes)?; + let body: models::SourceControlList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8322,55 +13875,72 @@ pub mod sentinel_onboarding_states { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) sentinel_onboarding_state_name: String, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . sentinel_onboarding_state_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } - pub mod create { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SentinelOnboardingState = serde_json::from_slice(&bytes)?; + let body: models::SourceControl = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8410,18 +13980,9 @@ pub mod sentinel_onboarding_states { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) sentinel_onboarding_state_name: String, - pub(crate) sentinel_onboarding_state_parameter: Option, + pub(crate) source_control_id: String, } impl RequestBuilder { - #[doc = "The Sentinel onboarding state parameter"] - pub fn sentinel_onboarding_state_parameter( - mut self, - sentinel_onboarding_state_parameter: impl Into, - ) -> Self { - self.sentinel_onboarding_state_parameter = Some(sentinel_onboarding_state_parameter.into()); - self - } #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8430,8 +13991,8 @@ pub mod sentinel_onboarding_states { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . sentinel_onboarding_state_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . source_control_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8440,13 +14001,8 @@ pub mod sentinel_onboarding_states { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = if let Some(sentinel_onboarding_state_parameter) = &this.sentinel_onboarding_state_parameter { - req.insert_header("content-type", "application/json"); - azure_core::to_json(sentinel_onboarding_state_parameter)? - } else { - azure_core::EMPTY_BODY - }; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -8454,8 +14010,8 @@ pub mod sentinel_onboarding_states { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8466,9 +14022,32 @@ pub mod sentinel_onboarding_states { } } } - pub mod delete { + pub mod create { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::SourceControl = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -8489,7 +14068,8 @@ pub mod sentinel_onboarding_states { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) sentinel_onboarding_state_name: String, + pub(crate) source_control_id: String, + pub(crate) source_control: models::SourceControl, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8500,8 +14080,8 @@ pub mod sentinel_onboarding_states { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . sentinel_onboarding_state_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . source_control_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8510,41 +14090,31 @@ pub mod sentinel_onboarding_states { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.source_control)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod list { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::SentinelOnboardingStatesList = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -8565,6 +14135,7 @@ pub mod sentinel_onboarding_states { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) source_control_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8575,8 +14146,8 @@ pub mod sentinel_onboarding_states { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/onboardingStates" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . source_control_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -8585,7 +14156,7 @@ pub mod sentinel_onboarding_states { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8593,120 +14164,183 @@ pub mod sentinel_onboarding_states { }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod security_ml_analytics_settings { +pub mod threat_intelligence_indicator { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all Security ML Analytics Settings."] + #[doc = "Create a new threat intelligence indicator."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( + #[doc = "* `threat_intelligence_properties`: Properties of threat intelligence indicators to create and update."] + pub fn create_indicator( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { + threat_intelligence_properties: impl Into, + ) -> create_indicator::RequestBuilder { + create_indicator::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + threat_intelligence_properties: threat_intelligence_properties.into(), } } - #[doc = "Gets the Security ML Analytics Settings."] + #[doc = "View a threat intelligence indicator by name."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `settings_resource_name`: Security ML Analytics Settings resource name"] + #[doc = "* `name`: Threat intelligence indicator name field."] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - settings_resource_name: impl Into, + name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - settings_resource_name: settings_resource_name.into(), + name: name.into(), } } - #[doc = "Creates or updates the Security ML Analytics Settings."] + #[doc = "Update a threat Intelligence indicator."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `settings_resource_name`: Security ML Analytics Settings resource name"] - #[doc = "* `security_ml_analytics_setting`: The security ML Analytics setting"] - pub fn create_or_update( + #[doc = "* `name`: Threat intelligence indicator name field."] + #[doc = "* `threat_intelligence_properties`: Properties of threat intelligence indicators to create and update."] + pub fn create( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - settings_resource_name: impl Into, - security_ml_analytics_setting: impl Into, - ) -> create_or_update::RequestBuilder { - create_or_update::RequestBuilder { + name: impl Into, + threat_intelligence_properties: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - settings_resource_name: settings_resource_name.into(), - security_ml_analytics_setting: security_ml_analytics_setting.into(), + name: name.into(), + threat_intelligence_properties: threat_intelligence_properties.into(), } } - #[doc = "Delete the Security ML Analytics Settings."] + #[doc = "Delete a threat intelligence indicator."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `settings_resource_name`: Security ML Analytics Settings resource name"] + #[doc = "* `name`: Threat intelligence indicator name field."] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - settings_resource_name: impl Into, + name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - settings_resource_name: settings_resource_name.into(), + name: name.into(), + } + } + #[doc = "Query threat intelligence indicators as per filtering criteria."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `threat_intelligence_filtering_criteria`: Filtering criteria for querying threat intelligence indicators."] + pub fn query_indicators( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + threat_intelligence_filtering_criteria: impl Into, + ) -> query_indicators::RequestBuilder { + query_indicators::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + threat_intelligence_filtering_criteria: threat_intelligence_filtering_criteria.into(), + } + } + #[doc = "Append tags to a threat intelligence indicator."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `name`: Threat intelligence indicator name field."] + #[doc = "* `threat_intelligence_append_tags`: The threat intelligence append tags request body"] + pub fn append_tags( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + threat_intelligence_append_tags: impl Into, + ) -> append_tags::RequestBuilder { + append_tags::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + threat_intelligence_append_tags: threat_intelligence_append_tags.into(), + } + } + #[doc = "Replace tags added to a threat intelligence indicator."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `name`: Threat intelligence indicator name field."] + #[doc = "* `threat_intelligence_replace_tags`: Tags in the threat intelligence indicator to be replaced."] + pub fn replace_tags( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + name: impl Into, + threat_intelligence_replace_tags: impl Into, + ) -> replace_tags::RequestBuilder { + replace_tags::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + name: name.into(), + threat_intelligence_replace_tags: threat_intelligence_replace_tags.into(), } } } - pub mod list { + pub mod create_indicator { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityMlAnalyticsSettingsList = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8723,85 +14357,69 @@ pub mod security_ml_analytics_settings { } impl AsRef for Response { fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } - #[derive(Clone)] - #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] - #[doc = r""] - #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] - #[doc = r" parameters can be chained."] - #[doc = r""] - #[doc = r" The building of a request is typically finalized by invoking `.await` on"] - #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] - #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] - #[doc = r" operation and returns a `Result` with the parsed response."] - #[doc = r""] - #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] - #[doc = r" response headers or raw body data) then you can finalize the request using the"] - #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] - #[doc = r" [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, - pub(crate) subscription_id: String, - pub(crate) resource_group_name: String, - pub(crate) workspace_name: String, - } - impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { - let make_request = move |continuation: Option| { - let this = self.clone(); - async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let rsp = match continuation { - Some(value) => { - url.set_path(""); - url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - let has_api_version_already = - req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); - if !has_api_version_already { - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - } - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - this.client.send(&mut req).await? - } - }; - let rsp = match rsp.status() { - azure_core::StatusCode::Ok => Ok(Response(rsp)), - status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { - status: status_code, - error_code: None, - })), - }; - rsp?.into_body().await + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) threat_intelligence_properties: models::ThreatIntelligenceIndicatorModel, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.threat_intelligence_properties)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) } - }; - azure_core::Pageable::new(make_request) + }) + } + } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } @@ -8809,9 +14427,9 @@ pub mod security_ml_analytics_settings { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8851,7 +14469,7 @@ pub mod security_ml_analytics_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) settings_resource_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8862,7 +14480,7 @@ pub mod security_ml_analytics_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_resource_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -8872,7 +14490,7 @@ pub mod security_ml_analytics_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -8881,8 +14499,8 @@ pub mod security_ml_analytics_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -8893,13 +14511,13 @@ pub mod security_ml_analytics_settings { } } } - pub mod create_or_update { + pub mod create { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SecurityMlAnalyticsSetting = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -8939,8 +14557,8 @@ pub mod security_ml_analytics_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) settings_resource_name: String, - pub(crate) security_ml_analytics_setting: models::SecurityMlAnalyticsSetting, + pub(crate) name: String, + pub(crate) threat_intelligence_properties: models::ThreatIntelligenceIndicatorModel, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -8951,7 +14569,7 @@ pub mod security_ml_analytics_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_resource_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -8961,9 +14579,9 @@ pub mod security_ml_analytics_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.security_ml_analytics_setting)?; + let req_body = azure_core::to_json(&this.threat_intelligence_properties)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -8971,8 +14589,8 @@ pub mod security_ml_analytics_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9006,7 +14624,7 @@ pub mod security_ml_analytics_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) settings_resource_name: String, + pub(crate) name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9017,7 +14635,7 @@ pub mod security_ml_analytics_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_resource_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9027,7 +14645,7 @@ pub mod security_ml_analytics_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9036,107 +14654,175 @@ pub mod security_ml_analytics_settings { } } } -} -pub mod product_settings { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "List of all the settings"] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), + pub mod query_indicators { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::ThreatIntelligenceInformationList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 } } - #[doc = "Gets a setting."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `settings_name`: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba"] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - settings_name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - settings_name: settings_name.into(), + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() } } - #[doc = "Updates setting."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `settings_name`: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba"] - #[doc = "* `settings`: The setting"] - pub fn update( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - settings_name: impl Into, - settings: impl Into, - ) -> update::RequestBuilder { - update::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - settings_name: settings_name.into(), - settings: settings.into(), + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) threat_intelligence_filtering_criteria: models::ThreatIntelligenceFilteringCriteria, + } + impl RequestBuilder { + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.threat_intelligence_filtering_criteria)?; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } - #[doc = "Delete setting of the product."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `settings_name`: The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba"] - pub fn delete( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - settings_name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - settings_name: settings_name.into(), + } + pub mod append_tags { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) threat_intelligence_append_tags: models::ThreatIntelligenceAppendTags, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}/appendTags" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.threat_intelligence_append_tags)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } } - pub mod list { + pub mod replace_tags { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SettingList = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9176,6 +14862,8 @@ pub mod product_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) name: String, + pub(crate) threat_intelligence_replace_tags: models::ThreatIntelligenceIndicatorModel, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9186,8 +14874,8 @@ pub mod product_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}/replaceTags" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -9196,8 +14884,9 @@ pub mod product_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.threat_intelligence_replace_tags)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -9205,8 +14894,8 @@ pub mod product_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9217,13 +14906,42 @@ pub mod product_settings { } } } - pub mod get { +} +pub mod threat_intelligence_indicators { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all threat intelligence indicators."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + filter: None, + orderby: None, + top: None, + skip_token: None, + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Settings = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceInformationList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9263,55 +14981,133 @@ pub mod product_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) settings_name: String, + pub(crate) filter: Option, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Filters the results, based on a Boolean condition. Optional."] + pub fn filter(mut self, filter: impl Into) -> Self { + self.filter = Some(filter.into()); + self + } + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(filter) = &this.filter { + req.url_mut().query_pairs_mut().append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) + }; + azure_core::Pageable::new(make_request) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + } +} +pub mod threat_intelligence_indicator_metrics { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source)."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), } } } - pub mod update { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Settings = serde_json::from_slice(&bytes)?; + let body: models::ThreatIntelligenceMetricsList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9351,8 +15147,6 @@ pub mod product_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) settings_name: String, - pub(crate) settings: models::Settings, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9363,8 +15157,8 @@ pub mod product_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Put); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -9373,9 +15167,8 @@ pub mod product_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.settings)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -9383,8 +15176,8 @@ pub mod product_settings { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9395,9 +15188,60 @@ pub mod product_settings { } } } - pub mod delete { +} +pub mod triggered_analytics_rule_run { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the triggered analytics rule run."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `rule_run_id`: the triggered rule id"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + rule_run_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + rule_run_id: rule_run_id.into(), + } + } + } + pub mod get { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::TriggeredAnalyticsRuleRun = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -9418,7 +15262,7 @@ pub mod product_settings { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) settings_name: String, + pub(crate) rule_run_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9429,8 +15273,8 @@ pub mod product_settings { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/settings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . settings_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/triggeredAnalyticsRuleRuns/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . rule_run_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -9439,7 +15283,7 @@ pub mod product_settings { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9447,42 +15291,51 @@ pub mod product_settings { }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } } -pub mod source_control { +pub mod get_triggered_analytics_rule_runs { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets a list of repositories metadata."] + #[doc = "Gets the triggered analytics rule runs."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `repo_type`: The repo type."] - pub fn list_repositories( + pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - repo_type: impl Into, - ) -> list_repositories::RequestBuilder { - list_repositories::RequestBuilder { + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - repo_type: repo_type.into(), } } } - pub mod list_repositories { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RepoList = serde_json::from_slice(&bytes)?; + let body: models::TriggeredAnalyticsRuleRuns = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9522,19 +15375,18 @@ pub mod source_control { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) repo_type: models::RepoType, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/listRepositories" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/triggeredAnalyticsRuleRuns" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -9546,14 +15398,14 @@ pub mod source_control { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -9562,9 +15414,8 @@ pub mod source_control { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.repo_type)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } @@ -9584,11 +15435,98 @@ pub mod source_control { } } } -pub mod source_controls { +pub mod alert_rule { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all source controls, without source control items."] + #[doc = "triggers analytics rule run"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `rule_id`: Alert rule ID"] + #[doc = "* `analytics_rule_run_trigger_parameter`: The Analytics Rule Run Trigger parameter"] + pub fn trigger_rule_run( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + rule_id: impl Into, + analytics_rule_run_trigger_parameter: impl Into, + ) -> trigger_rule_run::RequestBuilder { + trigger_rule_run::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + rule_id: rule_id.into(), + analytics_rule_run_trigger_parameter: analytics_rule_run_trigger_parameter.into(), + } + } + } + pub mod trigger_rule_run { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) rule_id: String, + pub(crate) analytics_rule_run_trigger_parameter: models::AnalyticsRuleRunTrigger, + } + impl RequestBuilder { + #[doc = "only the first response will be fetched as long running operations are not supported yet"] + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/alertRules/{}/triggerRuleRun" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . rule_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.analytics_rule_run_trigger_parameter)?; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } +} +pub mod watchlists { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all watchlists, without watchlist items."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -9605,75 +15543,76 @@ pub mod source_controls { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + skip_token: None, } } - #[doc = "Gets a source control byt its identifier."] + #[doc = "Gets a watchlist, without its watchlist items."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `source_control_id`: Source control Id"] + #[doc = "* `watchlist_alias`: Watchlist Alias"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - source_control_id: impl Into, + watchlist_alias: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - source_control_id: source_control_id.into(), + watchlist_alias: watchlist_alias.into(), } } - #[doc = "Creates a source control."] + #[doc = "Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items, we should call this endpoint with either rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing such large file can be polled through the URL returned in Azure-AsyncOperation header."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `source_control_id`: Source control Id"] - #[doc = "* `source_control`: The SourceControl"] - pub fn create( + #[doc = "* `watchlist_alias`: Watchlist Alias"] + #[doc = "* `watchlist`: The watchlist"] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - source_control_id: impl Into, - source_control: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { + watchlist_alias: impl Into, + watchlist: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - source_control_id: source_control_id.into(), - source_control: source_control.into(), + watchlist_alias: watchlist_alias.into(), + watchlist: watchlist.into(), } } - #[doc = "Delete a source control."] + #[doc = "Delete a watchlist."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `source_control_id`: Source control Id"] + #[doc = "* `watchlist_alias`: Watchlist Alias"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - source_control_id: impl Into, + watchlist_alias: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - source_control_id: source_control_id.into(), + watchlist_alias: watchlist_alias.into(), } } } @@ -9681,9 +15620,9 @@ pub mod source_controls { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SourceControlList = serde_json::from_slice(&bytes)?; + let body: models::WatchlistList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9723,13 +15662,19 @@ pub mod source_controls { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) skip_token: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -9746,7 +15691,7 @@ pub mod source_controls { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -9762,7 +15707,10 @@ pub mod source_controls { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -9786,9 +15734,9 @@ pub mod source_controls { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SourceControl = serde_json::from_slice(&bytes)?; + let body: models::Watchlist = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9828,7 +15776,7 @@ pub mod source_controls { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) source_control_id: String, + pub(crate) watchlist_alias: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9839,7 +15787,7 @@ pub mod source_controls { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . source_control_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9849,7 +15797,7 @@ pub mod source_controls { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -9858,8 +15806,8 @@ pub mod source_controls { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9870,13 +15818,13 @@ pub mod source_controls { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::SourceControl = serde_json::from_slice(&bytes)?; + let body: models::Watchlist = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -9885,6 +15833,9 @@ pub mod source_controls { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } + pub fn headers(&self) -> Headers { + Headers(self.0.headers()) + } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -9896,6 +15847,14 @@ pub mod source_controls { self.as_raw_response() } } + pub struct Headers<'a>(&'a azure_core::headers::Headers); + impl<'a> Headers<'a> { + #[doc = "Contains the status URL on which clients are expected to poll the status of the operation."] + pub fn azure_async_operation(&self) -> azure_core::Result<&str> { + self.0 + .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -9916,8 +15875,8 @@ pub mod source_controls { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) source_control_id: String, - pub(crate) source_control: models::SourceControl, + pub(crate) watchlist_alias: String, + pub(crate) watchlist: models::Watchlist, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9928,7 +15887,7 @@ pub mod source_controls { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . source_control_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -9938,9 +15897,9 @@ pub mod source_controls { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.source_control)?; + let req_body = azure_core::to_json(&this.watchlist)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -9948,8 +15907,8 @@ pub mod source_controls { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -9983,7 +15942,7 @@ pub mod source_controls { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) source_control_id: String, + pub(crate) watchlist_alias: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -9994,7 +15953,7 @@ pub mod source_controls { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/sourcecontrols/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . source_control_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10004,47 +15963,244 @@ pub mod source_controls { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } - }) - } - } - } -} -pub mod get_recommendations { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a list of all recommendations."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), + }) + } + } + } +} +pub mod watchlist_items { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all watchlist Items."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `watchlist_alias`: Watchlist Alias"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + watchlist_alias: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + watchlist_alias: watchlist_alias.into(), + skip_token: None, + } + } + #[doc = "Gets a watchlist, without its watchlist items."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `watchlist_alias`: Watchlist Alias"] + #[doc = "* `watchlist_item_id`: Watchlist Item Id (GUID)"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + watchlist_alias: impl Into, + watchlist_item_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + watchlist_alias: watchlist_alias.into(), + watchlist_item_id: watchlist_item_id.into(), + } + } + #[doc = "Creates or updates a watchlist item."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `watchlist_alias`: Watchlist Alias"] + #[doc = "* `watchlist_item_id`: Watchlist Item Id (GUID)"] + #[doc = "* `watchlist_item`: The watchlist item"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + watchlist_alias: impl Into, + watchlist_item_id: impl Into, + watchlist_item: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + watchlist_alias: watchlist_alias.into(), + watchlist_item_id: watchlist_item_id.into(), + watchlist_item: watchlist_item.into(), + } + } + #[doc = "Delete a watchlist item."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `watchlist_alias`: Watchlist Alias"] + #[doc = "* `watchlist_item_id`: Watchlist Item Id (GUID)"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + watchlist_alias: impl Into, + watchlist_item_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + watchlist_alias: watchlist_alias.into(), + watchlist_item_id: watchlist_item_id.into(), + } + } + } + pub mod list { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WatchlistItemList = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) watchlist_alias: String, + pub(crate) skip_token: Option, + } + impl RequestBuilder { + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { + let this = self.clone(); + async move { + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await + } + }; + azure_core::Pageable::new(make_request) } } } - pub mod list { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::RecommendationList = serde_json::from_slice(&bytes)?; + let body: models::WatchlistItem = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10084,6 +16240,8 @@ pub mod get_recommendations { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) watchlist_alias: String, + pub(crate) watchlist_item_id: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10094,7 +16252,7 @@ pub mod get_recommendations { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/recommendations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias , & this . watchlist_item_id)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10104,7 +16262,7 @@ pub mod get_recommendations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10113,8 +16271,8 @@ pub mod get_recommendations { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10125,41 +16283,13 @@ pub mod get_recommendations { } } } -} -pub mod get { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Gets a recommendation by its id."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `recommendation_id`: Recommendation Id."] - pub fn single_recommendation( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - recommendation_id: impl Into, - ) -> single_recommendation::RequestBuilder { - single_recommendation::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - recommendation_id: recommendation_id.into(), - } - } - } - pub mod single_recommendation { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Recommendation = serde_json::from_slice(&bytes)?; + let body: models::WatchlistItem = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10199,7 +16329,9 @@ pub mod get { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) recommendation_id: String, + pub(crate) watchlist_alias: String, + pub(crate) watchlist_item_id: String, + pub(crate) watchlist_item: models::WatchlistItem, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10210,8 +16342,8 @@ pub mod get { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/recommendations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . recommendation_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias , & this . watchlist_item_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -10220,8 +16352,9 @@ pub mod get { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.watchlist_item)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -10229,8 +16362,8 @@ pub mod get { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10241,63 +16374,9 @@ pub mod get { } } } -} -pub mod update { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Patch a recommendation."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `recommendation_id`: Recommendation Id."] - #[doc = "* `recommendation_patch`: Recommendation Fields to Update."] - pub fn recommendation( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - recommendation_id: impl Into, - recommendation_patch: Vec, - ) -> recommendation::RequestBuilder { - recommendation::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - recommendation_id: recommendation_id.into(), - recommendation_patch, - } - } - } - pub mod recommendation { + pub mod delete { use super::models; pub struct Response(azure_core::Response); - impl Response { - pub async fn into_body(self) -> azure_core::Result { - let bytes = self.0.into_body().collect().await?; - let body: models::Recommendation = serde_json::from_slice(&bytes)?; - Ok(body) - } - pub fn into_raw_response(self) -> azure_core::Response { - self.0 - } - pub fn as_raw_response(&self) -> &azure_core::Response { - &self.0 - } - } - impl From for azure_core::Response { - fn from(rsp: Response) -> Self { - rsp.into_raw_response() - } - } - impl AsRef for Response { - fn as_ref(&self) -> &azure_core::Response { - self.as_raw_response() - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -10318,11 +16397,10 @@ pub mod update { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) recommendation_id: String, - pub(crate) recommendation_patch: Vec, + pub(crate) watchlist_alias: String, + pub(crate) watchlist_item_id: String, } impl RequestBuilder { - #[doc = "only the first response will be fetched as long running operations are not supported yet"] #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10331,8 +16409,8 @@ pub mod update { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/recommendations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . recommendation_id)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Patch); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias , & this . watchlist_item_id)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -10341,204 +16419,119 @@ pub mod update { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.recommendation_patch)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) - } - } } } -pub mod threat_intelligence_indicator { +pub mod workspace_manager_assignments { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Create a new threat intelligence indicator."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `threat_intelligence_properties`: Properties of threat intelligence indicators to create and update."] - pub fn create_indicator( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - threat_intelligence_properties: impl Into, - ) -> create_indicator::RequestBuilder { - create_indicator::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - threat_intelligence_properties: threat_intelligence_properties.into(), - } - } - #[doc = "View a threat intelligence indicator by name."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `name`: Threat intelligence indicator name field."] - pub fn get( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - ) -> get::RequestBuilder { - get::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - } - } - #[doc = "Update a threat Intelligence indicator."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `name`: Threat intelligence indicator name field."] - #[doc = "* `threat_intelligence_properties`: Properties of threat intelligence indicators to create and update."] - pub fn create( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - name: impl Into, - threat_intelligence_properties: impl Into, - ) -> create::RequestBuilder { - create::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), - name: name.into(), - threat_intelligence_properties: threat_intelligence_properties.into(), - } - } - #[doc = "Delete a threat intelligence indicator."] + #[doc = "Get all workspace manager assignments for the Sentinel workspace manager."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `name`: Threat intelligence indicator name field."] - pub fn delete( + pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - ) -> delete::RequestBuilder { - delete::RequestBuilder { + ) -> list::RequestBuilder { + list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), + orderby: None, + top: None, + skip_token: None, } } - #[doc = "Query threat intelligence indicators as per filtering criteria."] + #[doc = "Gets a workspace manager assignment"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `threat_intelligence_filtering_criteria`: Filtering criteria for querying threat intelligence indicators."] - pub fn query_indicators( + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - threat_intelligence_filtering_criteria: impl Into, - ) -> query_indicators::RequestBuilder { - query_indicators::RequestBuilder { + workspace_manager_assignment_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - threat_intelligence_filtering_criteria: threat_intelligence_filtering_criteria.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), } } - #[doc = "Append tags to a threat intelligence indicator."] + #[doc = "Creates or updates a workspace manager assignment."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `name`: Threat intelligence indicator name field."] - #[doc = "* `threat_intelligence_append_tags`: The threat intelligence append tags request body"] - pub fn append_tags( + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + #[doc = "* `workspace_manager_assignment`: The workspace manager assignment"] + pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - threat_intelligence_append_tags: impl Into, - ) -> append_tags::RequestBuilder { - append_tags::RequestBuilder { + workspace_manager_assignment_name: impl Into, + workspace_manager_assignment: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - threat_intelligence_append_tags: threat_intelligence_append_tags.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), + workspace_manager_assignment: workspace_manager_assignment.into(), } } - #[doc = "Replace tags added to a threat intelligence indicator."] + #[doc = "Deletes a workspace manager assignment"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `name`: Threat intelligence indicator name field."] - #[doc = "* `threat_intelligence_replace_tags`: Tags in the threat intelligence indicator to be replaced."] - pub fn replace_tags( + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - name: impl Into, - threat_intelligence_replace_tags: impl Into, - ) -> replace_tags::RequestBuilder { - replace_tags::RequestBuilder { + workspace_manager_assignment_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - name: name.into(), - threat_intelligence_replace_tags: threat_intelligence_replace_tags.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), } } } - pub mod create_indicator { + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerAssignmentList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10578,46 +16571,89 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) threat_intelligence_properties: models::ThreatIntelligenceIndicatorModel, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { + let make_request = move |continuation: Option| { let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); - let credential = this.client.token_credential(); - let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; - req.insert_header( - azure_core::headers::AUTHORIZATION, - format!("Bearer {}", token_response.token.secret()), - ); - req.url_mut() - .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.threat_intelligence_properties)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?)) + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let rsp = match continuation { + Some(value) => { + url.set_path(""); + url = url.join(&value)?; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + let has_api_version_already = + req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION); + if !has_api_version_already { + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + None => { + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + this.client.send(&mut req).await? + } + }; + let rsp = match rsp.status() { + azure_core::StatusCode::Ok => Ok(Response(rsp)), + status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse { + status: status_code, + error_code: None, + })), + }; + rsp?.into_body().await } - }) - } - } - impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; - #[doc = "Returns a future that sends the request and returns the parsed response body."] - #[doc = ""] - #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] - #[doc = ""] - #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { self.send().await?.into_body().await }) + }; + azure_core::Pageable::new(make_request) } } } @@ -10625,9 +16661,9 @@ pub mod threat_intelligence_indicator { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerAssignment = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10667,7 +16703,7 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) workspace_manager_assignment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10678,7 +16714,7 @@ pub mod threat_intelligence_indicator { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10688,7 +16724,7 @@ pub mod threat_intelligence_indicator { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10697,8 +16733,8 @@ pub mod threat_intelligence_indicator { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10709,13 +16745,13 @@ pub mod threat_intelligence_indicator { } } } - pub mod create { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerAssignment = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10755,8 +16791,8 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) threat_intelligence_properties: models::ThreatIntelligenceIndicatorModel, + pub(crate) workspace_manager_assignment_name: String, + pub(crate) workspace_manager_assignment: models::WorkspaceManagerAssignment, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10767,7 +16803,7 @@ pub mod threat_intelligence_indicator { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10777,9 +16813,9 @@ pub mod threat_intelligence_indicator { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.threat_intelligence_properties)?; + let req_body = azure_core::to_json(&this.workspace_manager_assignment)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -10787,8 +16823,8 @@ pub mod threat_intelligence_indicator { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -10822,7 +16858,7 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, + pub(crate) workspace_manager_assignment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10833,7 +16869,7 @@ pub mod threat_intelligence_indicator { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -10843,7 +16879,7 @@ pub mod threat_intelligence_indicator { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -10852,13 +16888,116 @@ pub mod threat_intelligence_indicator { } } } - pub mod query_indicators { +} +pub mod workspace_manager_assignment_jobs { + use super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all jobs for the specified workspace manager assignment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + pub fn list( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_assignment_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), + orderby: None, + top: None, + skip_token: None, + } + } + #[doc = "Create a job for the specified workspace manager assignment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + pub fn create( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_assignment_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), + } + } + #[doc = "Gets a job"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + #[doc = "* `job_name`: The job name"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_assignment_name: impl Into, + job_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), + job_name: job_name.into(), + } + } + #[doc = "Deletes the specified job from the specified workspace manager assignment"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_assignment_name`: The name of the workspace manager assignment"] + #[doc = "* `job_name`: The job name"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_assignment_name: impl Into, + job_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_assignment_name: workspace_manager_assignment_name.into(), + job_name: job_name.into(), + } + } + } + pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceInformationList = serde_json::from_slice(&bytes)?; + let body: models::JobList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -10898,19 +17037,37 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) threat_intelligence_filtering_criteria: models::ThreatIntelligenceFilteringCriteria, + pub(crate) workspace_manager_assignment_name: String, + pub(crate) orderby: Option, + pub(crate) top: Option, + pub(crate) skip_token: Option, } impl RequestBuilder { - pub fn into_stream(self) -> azure_core::Pageable { + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } + #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] + pub fn skip_token(mut self, skip_token: impl Into) -> Self { + self.skip_token = Some(skip_token.into()); + self + } + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}/jobs" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); url = url.join(&value)?; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -10922,14 +17079,14 @@ pub mod threat_intelligence_indicator { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } None => { - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -10938,9 +17095,17 @@ pub mod threat_intelligence_indicator { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.threat_intelligence_filtering_criteria)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } + if let Some(skip_token) = &this.skip_token { + req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); + } + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? } @@ -10959,9 +17124,32 @@ pub mod threat_intelligence_indicator { } } } - pub mod append_tags { + pub mod create { use super::models; pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::Job = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -10982,8 +17170,7 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) threat_intelligence_append_tags: models::ThreatIntelligenceAppendTags, + pub(crate) workspace_manager_assignment_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -10994,7 +17181,7 @@ pub mod threat_intelligence_indicator { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}/appendTags" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}/jobs" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Post); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -11004,23 +17191,35 @@ pub mod threat_intelligence_indicator { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.threat_intelligence_append_tags)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } }) } } + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) + } + } } - pub mod replace_tags { + pub mod get { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceInformation = serde_json::from_slice(&bytes)?; + let body: models::Job = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11060,8 +17259,8 @@ pub mod threat_intelligence_indicator { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) name: String, - pub(crate) threat_intelligence_replace_tags: models::ThreatIntelligenceIndicatorModel, + pub(crate) workspace_manager_assignment_name: String, + pub(crate) job_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11072,8 +17271,8 @@ pub mod threat_intelligence_indicator { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{}/replaceTags" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Post); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}/jobs/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name , & this . job_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -11082,9 +17281,8 @@ pub mod threat_intelligence_indicator { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.threat_intelligence_replace_tags)?; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -11092,8 +17290,8 @@ pub mod threat_intelligence_indicator { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11104,12 +17302,66 @@ pub mod threat_intelligence_indicator { } } } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) workspace_manager_assignment_name: String, + pub(crate) job_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{}/jobs/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_assignment_name , & this . job_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } -pub mod threat_intelligence_indicators { +pub mod workspace_manager_configurations { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Get all threat intelligence indicators."] + #[doc = "Gets all workspace manager configurations for a Sentinel workspace."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -11126,20 +17378,88 @@ pub mod threat_intelligence_indicators { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - filter: None, orderby: None, top: None, skip_token: None, } } + #[doc = "Gets a workspace manager configuration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_configuration_name`: The name of the workspace manager configuration"] + pub fn get( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_configuration_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_configuration_name: workspace_manager_configuration_name.into(), + } + } + #[doc = "Creates or updates a workspace manager configuration."] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_configuration_name`: The name of the workspace manager configuration"] + #[doc = "* `workspace_manager_configuration`: The workspace manager configuration"] + pub fn create_or_update( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_configuration_name: impl Into, + workspace_manager_configuration: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_configuration_name: workspace_manager_configuration_name.into(), + workspace_manager_configuration: workspace_manager_configuration.into(), + } + } + #[doc = "Deletes a workspace manager configuration"] + #[doc = ""] + #[doc = "Arguments:"] + #[doc = "* `subscription_id`: The ID of the target subscription."] + #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] + #[doc = "* `workspace_name`: The name of the workspace."] + #[doc = "* `workspace_manager_configuration_name`: The name of the workspace manager configuration"] + pub fn delete( + &self, + subscription_id: impl Into, + resource_group_name: impl Into, + workspace_name: impl Into, + workspace_manager_configuration_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subscription_id: subscription_id.into(), + resource_group_name: resource_group_name.into(), + workspace_name: workspace_name.into(), + workspace_manager_configuration_name: workspace_manager_configuration_name.into(), + } + } } pub mod list { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceInformationList = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerConfigurationList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11179,17 +17499,11 @@ pub mod threat_intelligence_indicators { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) filter: Option, pub(crate) orderby: Option, pub(crate) top: Option, pub(crate) skip_token: Option, } impl RequestBuilder { - #[doc = "Filters the results, based on a Boolean condition. Optional."] - pub fn filter(mut self, filter: impl Into) -> Self { - self.filter = Some(filter.into()); - self - } #[doc = "Sorts the results. Optional."] pub fn orderby(mut self, orderby: impl Into) -> Self { self.orderby = Some(orderby.into()); @@ -11205,11 +17519,11 @@ pub mod threat_intelligence_indicators { self.skip_token = Some(skip_token.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -11226,7 +17540,7 @@ pub mod threat_intelligence_indicators { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11242,10 +17556,7 @@ pub mod threat_intelligence_indicators { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - if let Some(filter) = &this.filter { - req.url_mut().query_pairs_mut().append_pair("$filter", filter); - } + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); if let Some(orderby) = &this.orderby { req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); } @@ -11269,43 +17580,106 @@ pub mod threat_intelligence_indicators { }; rsp?.into_body().await } - }; - azure_core::Pageable::new(make_request) + }; + azure_core::Pageable::new(make_request) + } + } + } + pub mod get { + use super::models; + pub struct Response(azure_core::Response); + impl Response { + pub async fn into_body(self) -> azure_core::Result { + let bytes = self.0.into_body().collect().await?; + let body: models::WorkspaceManagerConfiguration = serde_json::from_slice(&bytes)?; + Ok(body) + } + pub fn into_raw_response(self) -> azure_core::Response { + self.0 + } + pub fn as_raw_response(&self) -> &azure_core::Response { + &self.0 + } + } + impl From for azure_core::Response { + fn from(rsp: Response) -> Self { + rsp.into_raw_response() + } + } + impl AsRef for Response { + fn as_ref(&self) -> &azure_core::Response { + self.as_raw_response() + } + } + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) workspace_manager_configuration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_configuration_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) } } - } -} -pub mod threat_intelligence_indicator_metrics { - use super::models; - pub struct Client(pub(crate) super::Client); - impl Client { - #[doc = "Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source)."] - #[doc = ""] - #[doc = "Arguments:"] - #[doc = "* `subscription_id`: The ID of the target subscription."] - #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] - #[doc = "* `workspace_name`: The name of the workspace."] - pub fn list( - &self, - subscription_id: impl Into, - resource_group_name: impl Into, - workspace_name: impl Into, - ) -> list::RequestBuilder { - list::RequestBuilder { - client: self.0.clone(), - subscription_id: subscription_id.into(), - resource_group_name: resource_group_name.into(), - workspace_name: workspace_name.into(), + impl std::future::IntoFuture for RequestBuilder { + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + #[doc = "Returns a future that sends the request and returns the parsed response body."] + #[doc = ""] + #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] + #[doc = ""] + #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."] + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { self.send().await?.into_body().await }) } } } - pub mod list { + pub mod create_or_update { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::ThreatIntelligenceMetricsList = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerConfiguration = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11345,6 +17719,8 @@ pub mod threat_intelligence_indicator_metrics { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) workspace_manager_configuration_name: String, + pub(crate) workspace_manager_configuration: models::WorkspaceManagerConfiguration, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11355,8 +17731,8 @@ pub mod threat_intelligence_indicator_metrics { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; - let mut req = azure_core::Request::new(url, azure_core::Method::Get); + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_configuration_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; req.insert_header( @@ -11365,8 +17741,9 @@ pub mod threat_intelligence_indicator_metrics { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); - let req_body = azure_core::EMPTY_BODY; + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::to_json(&this.workspace_manager_configuration)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -11374,8 +17751,8 @@ pub mod threat_intelligence_indicator_metrics { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11386,12 +17763,65 @@ pub mod threat_intelligence_indicator_metrics { } } } + pub mod delete { + use super::models; + pub struct Response(azure_core::Response); + #[derive(Clone)] + #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] + #[doc = r""] + #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"] + #[doc = r" parameters can be chained."] + #[doc = r""] + #[doc = r" The building of a request is typically finalized by invoking `.await` on"] + #[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"] + #[doc = r" method, which converts `RequestBuilder` into a future that executes the request"] + #[doc = r" operation and returns a `Result` with the parsed response."] + #[doc = r""] + #[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"] + #[doc = r" response headers or raw body data) then you can finalize the request using the"] + #[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"] + #[doc = r" [`Response`] value."] + pub struct RequestBuilder { + pub(crate) client: super::super::Client, + pub(crate) subscription_id: String, + pub(crate) resource_group_name: String, + pub(crate) workspace_name: String, + pub(crate) workspace_manager_configuration_name: String, + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_configuration_name)) ? ; + let mut req = azure_core::Request::new(url, azure_core::Method::Delete); + let credential = this.client.token_credential(); + let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; + req.insert_header( + azure_core::headers::AUTHORIZATION, + format!("Bearer {}", token_response.token.secret()), + ); + req.url_mut() + .query_pairs_mut() + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + let req_body = azure_core::EMPTY_BODY; + req.set_body(req_body); + Ok(Response(this.client.send(&mut req).await?)) + } + }) + } + } + } } -pub mod watchlists { +pub mod workspace_manager_groups { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all watchlists, without watchlist items."] + #[doc = "Gets all workspace manager groups in the Sentinel workspace manager"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] @@ -11408,76 +17838,78 @@ pub mod watchlists { subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), + orderby: None, + top: None, skip_token: None, } } - #[doc = "Gets a watchlist, without its watchlist items."] + #[doc = "Gets a workspace manager group"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] + #[doc = "* `workspace_manager_group_name`: The name of the workspace manager group"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, + workspace_manager_group_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), + workspace_manager_group_name: workspace_manager_group_name.into(), } } - #[doc = "Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). To create a Watchlist and its Items, we should call this endpoint with either rawContent or a valid SAR URI and contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). The SAS URI enables the creation of large watchlist, where the content size can go up to 500 MB. The status of processing such large file can be polled through the URL returned in Azure-AsyncOperation header."] + #[doc = "Creates or updates a workspace manager group."] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] - #[doc = "* `watchlist`: The watchlist"] + #[doc = "* `workspace_manager_group_name`: The name of the workspace manager group"] + #[doc = "* `workspace_manager_group`: The workspace manager group object"] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, - watchlist: impl Into, + workspace_manager_group_name: impl Into, + workspace_manager_group: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), - watchlist: watchlist.into(), + workspace_manager_group_name: workspace_manager_group_name.into(), + workspace_manager_group: workspace_manager_group.into(), } } - #[doc = "Delete a watchlist."] + #[doc = "Deletes a workspace manager group"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] + #[doc = "* `workspace_manager_group_name`: The name of the workspace manager group"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, + workspace_manager_group_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), + workspace_manager_group_name: workspace_manager_group_name.into(), } } } @@ -11485,9 +17917,9 @@ pub mod watchlists { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::WatchlistList = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerGroupList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11527,19 +17959,31 @@ pub mod watchlists { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, + pub(crate) orderby: Option, + pub(crate) top: Option, pub(crate) skip_token: Option, } impl RequestBuilder { + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] pub fn skip_token(mut self, skip_token: impl Into) -> Self { self.skip_token = Some(skip_token.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerGroups" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -11556,7 +18000,7 @@ pub mod watchlists { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -11572,7 +18016,13 @@ pub mod watchlists { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip_token) = &this.skip_token { req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); } @@ -11599,9 +18049,9 @@ pub mod watchlists { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Watchlist = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerGroup = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11641,7 +18091,7 @@ pub mod watchlists { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, + pub(crate) workspace_manager_group_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11652,7 +18102,7 @@ pub mod watchlists { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_group_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -11662,7 +18112,7 @@ pub mod watchlists { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11671,8 +18121,8 @@ pub mod watchlists { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11687,9 +18137,9 @@ pub mod watchlists { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::Watchlist = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerGroup = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11698,9 +18148,6 @@ pub mod watchlists { pub fn as_raw_response(&self) -> &azure_core::Response { &self.0 } - pub fn headers(&self) -> Headers { - Headers(self.0.headers()) - } } impl From for azure_core::Response { fn from(rsp: Response) -> Self { @@ -11712,14 +18159,6 @@ pub mod watchlists { self.as_raw_response() } } - pub struct Headers<'a>(&'a azure_core::headers::Headers); - impl<'a> Headers<'a> { - #[doc = "Contains the status URL on which clients are expected to poll the status of the operation."] - pub fn azure_async_operation(&self) -> azure_core::Result<&str> { - self.0 - .get_str(&azure_core::headers::HeaderName::from_static("azure-asyncoperation")) - } - } #[derive(Clone)] #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."] #[doc = r""] @@ -11740,8 +18179,8 @@ pub mod watchlists { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, - pub(crate) watchlist: models::Watchlist, + pub(crate) workspace_manager_group_name: String, + pub(crate) workspace_manager_group: models::WorkspaceManagerGroup, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11752,7 +18191,7 @@ pub mod watchlists { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_group_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -11762,9 +18201,9 @@ pub mod watchlists { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.watchlist)?; + let req_body = azure_core::to_json(&this.workspace_manager_group)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -11772,8 +18211,8 @@ pub mod watchlists { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -11807,7 +18246,7 @@ pub mod watchlists { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, + pub(crate) workspace_manager_group_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -11818,7 +18257,7 @@ pub mod watchlists { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_group_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -11828,7 +18267,7 @@ pub mod watchlists { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -11838,109 +18277,99 @@ pub mod watchlists { } } } -pub mod watchlist_items { +pub mod workspace_manager_members { use super::models; pub struct Client(pub(crate) super::Client); impl Client { - #[doc = "Gets all watchlist Items."] + #[doc = "Gets all workspace manager members that exist for the given Sentinel workspace manager"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] pub fn list( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, ) -> list::RequestBuilder { list::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), + orderby: None, + top: None, skip_token: None, } } - #[doc = "Gets a watchlist, without its watchlist items."] + #[doc = "Gets a workspace manager member"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] - #[doc = "* `watchlist_item_id`: Watchlist Item Id (GUID)"] + #[doc = "* `workspace_manager_member_name`: The name of the workspace manager member"] pub fn get( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, - watchlist_item_id: impl Into, + workspace_manager_member_name: impl Into, ) -> get::RequestBuilder { get::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), - watchlist_item_id: watchlist_item_id.into(), + workspace_manager_member_name: workspace_manager_member_name.into(), } } - #[doc = "Creates or updates a watchlist item."] + #[doc = "Creates or updates a workspace manager member"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] - #[doc = "* `watchlist_item_id`: Watchlist Item Id (GUID)"] - #[doc = "* `watchlist_item`: The watchlist item"] + #[doc = "* `workspace_manager_member_name`: The name of the workspace manager member"] + #[doc = "* `workspace_manager_member`: The workspace manager member object"] pub fn create_or_update( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, - watchlist_item_id: impl Into, - watchlist_item: impl Into, + workspace_manager_member_name: impl Into, + workspace_manager_member: impl Into, ) -> create_or_update::RequestBuilder { create_or_update::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), - watchlist_item_id: watchlist_item_id.into(), - watchlist_item: watchlist_item.into(), + workspace_manager_member_name: workspace_manager_member_name.into(), + workspace_manager_member: workspace_manager_member.into(), } } - #[doc = "Delete a watchlist item."] + #[doc = "Deletes a workspace manager member"] #[doc = ""] #[doc = "Arguments:"] #[doc = "* `subscription_id`: The ID of the target subscription."] #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."] #[doc = "* `workspace_name`: The name of the workspace."] - #[doc = "* `watchlist_alias`: Watchlist Alias"] - #[doc = "* `watchlist_item_id`: Watchlist Item Id (GUID)"] + #[doc = "* `workspace_manager_member_name`: The name of the workspace manager member"] pub fn delete( &self, subscription_id: impl Into, resource_group_name: impl Into, workspace_name: impl Into, - watchlist_alias: impl Into, - watchlist_item_id: impl Into, + workspace_manager_member_name: impl Into, ) -> delete::RequestBuilder { delete::RequestBuilder { client: self.0.clone(), subscription_id: subscription_id.into(), resource_group_name: resource_group_name.into(), workspace_name: workspace_name.into(), - watchlist_alias: watchlist_alias.into(), - watchlist_item_id: watchlist_item_id.into(), + workspace_manager_member_name: workspace_manager_member_name.into(), } } } @@ -11948,9 +18377,9 @@ pub mod watchlist_items { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::WatchlistItemList = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerMembersList = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -11990,20 +18419,31 @@ pub mod watchlist_items { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, + pub(crate) orderby: Option, + pub(crate) top: Option, pub(crate) skip_token: Option, } impl RequestBuilder { + #[doc = "Sorts the results. Optional."] + pub fn orderby(mut self, orderby: impl Into) -> Self { + self.orderby = Some(orderby.into()); + self + } + #[doc = "Returns only the first n results. Optional."] + pub fn top(mut self, top: i32) -> Self { + self.top = Some(top); + self + } #[doc = "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Optional."] pub fn skip_token(mut self, skip_token: impl Into) -> Self { self.skip_token = Some(skip_token.into()); self } - pub fn into_stream(self) -> azure_core::Pageable { + pub fn into_stream(self) -> azure_core::Pageable { let make_request = move |continuation: Option| { let this = self.clone(); async move { - let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias)) ? ; + let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name)) ? ; let rsp = match continuation { Some(value) => { url.set_path(""); @@ -12020,7 +18460,7 @@ pub mod watchlist_items { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12036,7 +18476,13 @@ pub mod watchlist_items { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); + if let Some(orderby) = &this.orderby { + req.url_mut().query_pairs_mut().append_pair("$orderby", orderby); + } + if let Some(top) = &this.top { + req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string()); + } if let Some(skip_token) = &this.skip_token { req.url_mut().query_pairs_mut().append_pair("$skipToken", skip_token); } @@ -12063,9 +18509,9 @@ pub mod watchlist_items { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::WatchlistItem = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerMember = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12105,8 +18551,7 @@ pub mod watchlist_items { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, - pub(crate) watchlist_item_id: String, + pub(crate) workspace_manager_member_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12117,7 +18562,7 @@ pub mod watchlist_items { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias , & this . watchlist_item_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_member_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Get); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -12127,7 +18572,7 @@ pub mod watchlist_items { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12136,8 +18581,8 @@ pub mod watchlist_items { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -12152,9 +18597,9 @@ pub mod watchlist_items { use super::models; pub struct Response(azure_core::Response); impl Response { - pub async fn into_body(self) -> azure_core::Result { + pub async fn into_body(self) -> azure_core::Result { let bytes = self.0.into_body().collect().await?; - let body: models::WatchlistItem = serde_json::from_slice(&bytes)?; + let body: models::WorkspaceManagerMember = serde_json::from_slice(&bytes)?; Ok(body) } pub fn into_raw_response(self) -> azure_core::Response { @@ -12194,9 +18639,8 @@ pub mod watchlist_items { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, - pub(crate) watchlist_item_id: String, - pub(crate) watchlist_item: models::WatchlistItem, + pub(crate) workspace_manager_member_name: String, + pub(crate) workspace_manager_member: models::WorkspaceManagerMember, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12207,7 +18651,7 @@ pub mod watchlist_items { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias , & this . watchlist_item_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_member_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Put); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -12217,9 +18661,9 @@ pub mod watchlist_items { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); - let req_body = azure_core::to_json(&this.watchlist_item)?; + let req_body = azure_core::to_json(&this.workspace_manager_member)?; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) } @@ -12227,8 +18671,8 @@ pub mod watchlist_items { } } impl std::future::IntoFuture for RequestBuilder { - type Output = azure_core::Result; - type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; + type Output = azure_core::Result; + type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result>; #[doc = "Returns a future that sends the request and returns the parsed response body."] #[doc = ""] #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."] @@ -12262,8 +18706,7 @@ pub mod watchlist_items { pub(crate) subscription_id: String, pub(crate) resource_group_name: String, pub(crate) workspace_name: String, - pub(crate) watchlist_alias: String, - pub(crate) watchlist_item_id: String, + pub(crate) workspace_manager_member_name: String, } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] @@ -12274,7 +18717,7 @@ pub mod watchlist_items { Box::pin({ let this = self.clone(); async move { - let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/watchlists/{}/watchlistItems/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . watchlist_alias , & this . watchlist_item_id)) ? ; + let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . workspace_name , & this . workspace_manager_member_name)) ? ; let mut req = azure_core::Request::new(url, azure_core::Method::Delete); let credential = this.client.token_credential(); let token_response = credential.get_token(&this.client.scopes().join(" ")).await?; @@ -12284,7 +18727,7 @@ pub mod watchlist_items { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12503,7 +18946,7 @@ pub mod data_connectors { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -12519,7 +18962,7 @@ pub mod data_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? @@ -12606,7 +19049,7 @@ pub mod data_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12695,7 +19138,7 @@ pub mod data_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.data_connector)?; req.set_body(req_body); @@ -12761,7 +19204,7 @@ pub mod data_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?)) @@ -12815,7 +19258,7 @@ pub mod data_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.connect_body)?; req.set_body(req_body); @@ -12869,7 +19312,7 @@ pub mod data_connectors { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.insert_header(azure_core::headers::CONTENT_LENGTH, "0"); req.set_body(req_body); @@ -12974,7 +19417,7 @@ pub mod data_connectors_check_requirements { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); req.insert_header("content-type", "application/json"); let req_body = azure_core::to_json(&this.data_connectors_check_requirements)?; req.set_body(req_body); @@ -13075,7 +19518,7 @@ pub mod operations { if !has_api_version_already { req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); } let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); @@ -13091,7 +19534,7 @@ pub mod operations { ); req.url_mut() .query_pairs_mut() - .append_pair(azure_core::query_param::API_VERSION, "2022-11-01-preview"); + .append_pair(azure_core::query_param::API_VERSION, "2023-05-01-preview"); let req_body = azure_core::EMPTY_BODY; req.set_body(req_body); this.client.send(&mut req).await? diff --git a/services/mgmt/securityinsights/src/package_preview_2022_11/models.rs b/services/mgmt/securityinsights/src/package_preview_2023_05/models.rs similarity index 86% rename from services/mgmt/securityinsights/src/package_preview_2022_11/models.rs rename to services/mgmt/securityinsights/src/package_preview_2023_05/models.rs index 08f41e748c..8665572602 100644 --- a/services/mgmt/securityinsights/src/package_preview_2022_11/models.rs +++ b/services/mgmt/securityinsights/src/package_preview_2023_05/models.rs @@ -3,12 +3,12 @@ use serde::de::{value, Deserializer, IntoDeserializer}; use serde::{Deserialize, Serialize, Serializer}; use std::str::FromStr; -#[doc = "Represents AAD (Azure Active Directory) requirements check request."] +#[doc = "Represents AADIP (Azure Active Directory Identity Protection) requirements check request."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AadCheckRequirements { #[serde(flatten)] pub data_connectors_check_requirements: DataConnectorsCheckRequirements, - #[doc = "AAD (Azure Active Directory) requirements check properties."] + #[doc = "AADIP (Azure Active Directory Identity Protection) requirements check properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -20,7 +20,7 @@ impl AadCheckRequirements { } } } -#[doc = "AAD (Azure Active Directory) requirements check properties."] +#[doc = "AADIP (Azure Active Directory Identity Protection) requirements check properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AadCheckRequirementsProperties { #[serde(flatten)] @@ -31,12 +31,12 @@ impl AadCheckRequirementsProperties { Self { data_connector_tenant_id } } } -#[doc = "Represents AAD (Azure Active Directory) data connector."] +#[doc = "Represents AADIP (Azure Active Directory Identity Protection) data connector."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AadDataConnector { #[serde(flatten)] pub data_connector: DataConnector, - #[doc = "AAD (Azure Active Directory) data connector properties."] + #[doc = "AADIP (Azure Active Directory Identity Protection) data connector properties."] #[serde(default, skip_serializing_if = "Option::is_none")] pub properties: Option, } @@ -48,7 +48,7 @@ impl AadDataConnector { } } } -#[doc = "AAD (Azure Active Directory) data connector properties."] +#[doc = "AADIP (Azure Active Directory Identity Protection) data connector properties."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AadDataConnectorProperties { #[serde(flatten)] @@ -304,6 +304,7 @@ impl Serialize for ActionState { pub enum ActionType { ModifyProperties, RunPlaybook, + AddIncidentTask, #[serde(skip_deserializing)] UnknownValue(String), } @@ -331,6 +332,7 @@ impl Serialize for ActionType { match self { Self::ModifyProperties => serializer.serialize_unit_variant("ActionType", 0u32, "ModifyProperties"), Self::RunPlaybook => serializer.serialize_unit_variant("ActionType", 1u32, "RunPlaybook"), + Self::AddIncidentTask => serializer.serialize_unit_variant("ActionType", 2u32, "AddIncidentTask"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -577,6 +579,19 @@ impl ActivityTimelineItem { } } } +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AddIncidentTaskActionProperties { + #[doc = "The title of the task."] + pub title: String, + #[doc = "The description of the task."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl AddIncidentTaskActionProperties { + pub fn new(title: String) -> Self { + Self { title, description: None } + } +} #[doc = "Settings for how to dynamically override alert static details"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AlertDetailsOverride { @@ -972,6 +987,28 @@ impl AlertsDataTypeOfDataConnector { Self { alerts } } } +#[doc = "Analytics Rule Run Trigger request"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnalyticsRuleRunTrigger { + #[doc = "The Analytics Rule Run Trigger properties"] + pub properties: AnalyticsRuleRunTriggerProperties, +} +impl AnalyticsRuleRunTrigger { + pub fn new(properties: AnalyticsRuleRunTriggerProperties) -> Self { + Self { properties } + } +} +#[doc = "The Analytics Rule Run Trigger properties"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AnalyticsRuleRunTriggerProperties { + #[serde(rename = "executionTimeUtc", with = "azure_core::date::rfc3339")] + pub execution_time_utc: time::OffsetDateTime, +} +impl AnalyticsRuleRunTriggerProperties { + pub fn new(execution_time_utc: time::OffsetDateTime) -> Self { + Self { execution_time_utc } + } +} #[doc = "Settings with single toggle."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Anomalies { @@ -1322,6 +1359,22 @@ impl AutomationRuleAction { Self { order, action_type } } } +#[doc = "Describes an automation rule action to add a task to an incident"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutomationRuleAddIncidentTaskAction { + #[serde(flatten)] + pub automation_rule_action: AutomationRuleAction, + #[serde(rename = "actionConfiguration", default, skip_serializing_if = "Option::is_none")] + pub action_configuration: Option, +} +impl AutomationRuleAddIncidentTaskAction { + pub fn new(automation_rule_action: AutomationRuleAction) -> Self { + Self { + automation_rule_action, + action_configuration: None, + } + } +} #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct AutomationRuleBooleanCondition { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -2322,6 +2375,91 @@ impl AzureDevOpsResourceInfo { Self::default() } } +#[doc = "The resource model definition for an Azure Resource Manager resource with an etag."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct AzureEntityResource { + #[serde(flatten)] + pub resource: Resource, + #[doc = "Resource Etag."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +impl AzureEntityResource { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Billing statistic"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillingStatistic { + #[serde(flatten)] + pub azure_entity_resource: AzureEntityResource, + #[doc = "The kind of the billing statistic"] + pub kind: BillingStatisticKindEnum, +} +impl BillingStatistic { + pub fn new(kind: BillingStatisticKindEnum) -> Self { + Self { + azure_entity_resource: AzureEntityResource::default(), + kind, + } + } +} +#[doc = "The kind of the billing statistic"] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(remote = "BillingStatisticKindEnum")] +pub enum BillingStatisticKindEnum { + SapSolutionUsage, + #[serde(skip_deserializing)] + UnknownValue(String), +} +impl FromStr for BillingStatisticKindEnum { + type Err = value::Error; + fn from_str(s: &str) -> std::result::Result { + Self::deserialize(s.into_deserializer()) + } +} +impl<'de> Deserialize<'de> for BillingStatisticKindEnum { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s)); + Ok(deserialized) + } +} +impl Serialize for BillingStatisticKindEnum { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + match self { + Self::SapSolutionUsage => serializer.serialize_unit_variant("BillingStatisticKindEnum", 0u32, "SapSolutionUsage"), + Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), + } + } +} +#[doc = "List of all Microsoft Sentinel billing statistics."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillingStatisticList { + #[doc = "URL to fetch the next set of billing statistics."] + #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, + #[doc = "Array of billing statistics."] + pub value: Vec, +} +impl azure_core::Continuable for BillingStatisticList { + type Continuation = String; + fn continuation(&self) -> Option { + self.next_link.clone() + } +} +impl BillingStatisticList { + pub fn new(value: Vec) -> Self { + Self { next_link: None, value } + } +} #[doc = "Represents a bookmark in Azure Security Insights."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct Bookmark { @@ -3288,6 +3426,28 @@ impl CustomsPermission { Self::default() } } +#[doc = "The configuration of the destination of the data."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct DcrConfiguration { + #[doc = "Represents the data collection ingestion endpoint in log analytics."] + #[serde(rename = "dataCollectionEndpoint")] + pub data_collection_endpoint: String, + #[doc = "The data collection rule immutable id, the rule defines the transformation and data destination."] + #[serde(rename = "dataCollectionRuleImmutableId")] + pub data_collection_rule_immutable_id: String, + #[doc = "The stream we are sending the data to."] + #[serde(rename = "streamName")] + pub stream_name: String, +} +impl DcrConfiguration { + pub fn new(data_collection_endpoint: String, data_collection_rule_immutable_id: String, stream_name: String) -> Self { + Self { + data_collection_endpoint, + data_collection_rule_immutable_id, + stream_name, + } + } +} #[doc = "Data connector"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DataConnector { @@ -3497,6 +3657,7 @@ pub enum DataConnectorKind { #[serde(rename = "OfficeIRM")] OfficeIrm, Office365Project, + MicrosoftPurviewInformationProtection, #[serde(rename = "OfficePowerBI")] OfficePowerBi, AmazonWebServicesCloudTrail, @@ -3512,6 +3673,8 @@ pub enum DataConnectorKind { ApiPolling, #[serde(rename = "IOT")] Iot, + #[serde(rename = "GCP")] + Gcp, #[serde(skip_deserializing)] UnknownValue(String), } @@ -3546,25 +3709,29 @@ impl Serialize for DataConnectorKind { Self::OfficeAtp => serializer.serialize_unit_variant("DataConnectorKind", 6u32, "OfficeATP"), Self::OfficeIrm => serializer.serialize_unit_variant("DataConnectorKind", 7u32, "OfficeIRM"), Self::Office365Project => serializer.serialize_unit_variant("DataConnectorKind", 8u32, "Office365Project"), - Self::OfficePowerBi => serializer.serialize_unit_variant("DataConnectorKind", 9u32, "OfficePowerBI"), + Self::MicrosoftPurviewInformationProtection => { + serializer.serialize_unit_variant("DataConnectorKind", 9u32, "MicrosoftPurviewInformationProtection") + } + Self::OfficePowerBi => serializer.serialize_unit_variant("DataConnectorKind", 10u32, "OfficePowerBI"), Self::AmazonWebServicesCloudTrail => { - serializer.serialize_unit_variant("DataConnectorKind", 10u32, "AmazonWebServicesCloudTrail") + serializer.serialize_unit_variant("DataConnectorKind", 11u32, "AmazonWebServicesCloudTrail") } - Self::AmazonWebServicesS3 => serializer.serialize_unit_variant("DataConnectorKind", 11u32, "AmazonWebServicesS3"), + Self::AmazonWebServicesS3 => serializer.serialize_unit_variant("DataConnectorKind", 12u32, "AmazonWebServicesS3"), Self::AzureAdvancedThreatProtection => { - serializer.serialize_unit_variant("DataConnectorKind", 12u32, "AzureAdvancedThreatProtection") + serializer.serialize_unit_variant("DataConnectorKind", 13u32, "AzureAdvancedThreatProtection") } Self::MicrosoftDefenderAdvancedThreatProtection => { - serializer.serialize_unit_variant("DataConnectorKind", 13u32, "MicrosoftDefenderAdvancedThreatProtection") + serializer.serialize_unit_variant("DataConnectorKind", 14u32, "MicrosoftDefenderAdvancedThreatProtection") } - Self::Dynamics365 => serializer.serialize_unit_variant("DataConnectorKind", 14u32, "Dynamics365"), - Self::MicrosoftThreatProtection => serializer.serialize_unit_variant("DataConnectorKind", 15u32, "MicrosoftThreatProtection"), + Self::Dynamics365 => serializer.serialize_unit_variant("DataConnectorKind", 15u32, "Dynamics365"), + Self::MicrosoftThreatProtection => serializer.serialize_unit_variant("DataConnectorKind", 16u32, "MicrosoftThreatProtection"), Self::MicrosoftThreatIntelligence => { - serializer.serialize_unit_variant("DataConnectorKind", 16u32, "MicrosoftThreatIntelligence") + serializer.serialize_unit_variant("DataConnectorKind", 17u32, "MicrosoftThreatIntelligence") } - Self::GenericUi => serializer.serialize_unit_variant("DataConnectorKind", 17u32, "GenericUI"), - Self::ApiPolling => serializer.serialize_unit_variant("DataConnectorKind", 18u32, "APIPolling"), - Self::Iot => serializer.serialize_unit_variant("DataConnectorKind", 19u32, "IOT"), + Self::GenericUi => serializer.serialize_unit_variant("DataConnectorKind", 18u32, "GenericUI"), + Self::ApiPolling => serializer.serialize_unit_variant("DataConnectorKind", 19u32, "APIPolling"), + Self::Iot => serializer.serialize_unit_variant("DataConnectorKind", 20u32, "IOT"), + Self::Gcp => serializer.serialize_unit_variant("DataConnectorKind", 21u32, "GCP"), Self::UnknownValue(s) => serializer.serialize_str(s.as_str()), } } @@ -4561,6 +4728,28 @@ impl EntityList { Self { next_link: None, value } } } +#[doc = "Describes the request body for triggering a playbook on an entity."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EntityManualTriggerRequestBody { + #[doc = "Incident ARM id."] + #[serde(rename = "incidentArmId", default, skip_serializing_if = "Option::is_none")] + pub incident_arm_id: Option, + #[doc = "The tenant id of the playbook resource."] + #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[doc = "The resource id of the playbook resource."] + #[serde(rename = "logicAppsResourceId")] + pub logic_apps_resource_id: String, +} +impl EntityManualTriggerRequestBody { + pub fn new(logic_apps_resource_id: String) -> Self { + Self { + incident_arm_id: None, + tenant_id: None, + logic_apps_resource_id, + } + } +} #[doc = "Single entity mapping for the alert rule"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] pub struct EntityMapping { @@ -4995,6 +5184,72 @@ impl EntityTimelineResponse { Self::default() } } +#[doc = "The resource management error additional info."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorAdditionalInfo { + #[doc = "The additional info type."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The additional info."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub info: Option, +} +impl ErrorAdditionalInfo { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "The error detail."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorDetail { + #[doc = "The error code."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, + #[doc = "The error message."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[doc = "The error target."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target: Option, + #[doc = "The error details."] + #[serde( + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub details: Vec, + #[doc = "The error additional info."] + #[serde( + rename = "additionalInfo", + default, + deserialize_with = "azure_core::util::deserialize_null_as_default", + skip_serializing_if = "Vec::is_empty" + )] + pub additional_info: Vec, +} +impl ErrorDetail { + pub fn new() -> Self { + Self::default() + } +} +#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + #[doc = "The error detail."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} +impl azure_core::Continuable for ErrorResponse { + type Continuation = String; + fn continuation(&self) -> Option { + None + } +} +impl ErrorResponse { + pub fn new() -> Self { + Self::default() + } +} #[doc = "The event grouping aggregation kinds"] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(remote = "EventGroupingAggregationKind")] @@ -5858,6 +6113,87 @@ impl FusionTemplateSubTypeSeverityFilter { } } } +#[doc = "Google Cloud Platform auth section properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpAuthProperties { + #[doc = "The service account that is used to access the GCP project."] + #[serde(rename = "serviceAccountEmail")] + pub service_account_email: String, + #[doc = "The GCP project number."] + #[serde(rename = "projectNumber")] + pub project_number: String, + #[doc = "The workload identity provider id that is used to gain access to the GCP project."] + #[serde(rename = "workloadIdentityProviderId")] + pub workload_identity_provider_id: String, +} +impl GcpAuthProperties { + pub fn new(service_account_email: String, project_number: String, workload_identity_provider_id: String) -> Self { + Self { + service_account_email, + project_number, + workload_identity_provider_id, + } + } +} +#[doc = "Represents Google Cloud Platform data connector."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpDataConnector { + #[serde(flatten)] + pub data_connector: DataConnector, + #[doc = "Google Cloud Platform data connector properties."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub properties: Option, +} +impl GcpDataConnector { + pub fn new(data_connector: DataConnector) -> Self { + Self { + data_connector, + properties: None, + } + } +} +#[doc = "Google Cloud Platform data connector properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpDataConnectorProperties { + #[doc = "The name of the connector definition that represents the UI config."] + #[serde(rename = "connectorDefinitionName")] + pub connector_definition_name: String, + #[doc = "Google Cloud Platform auth section properties."] + pub auth: GcpAuthProperties, + #[doc = "Google Cloud Platform request section properties."] + pub request: GcpRequestProperties, + #[doc = "The configuration of the destination of the data."] + #[serde(rename = "dcrConfig", default, skip_serializing_if = "Option::is_none")] + pub dcr_config: Option, +} +impl GcpDataConnectorProperties { + pub fn new(connector_definition_name: String, auth: GcpAuthProperties, request: GcpRequestProperties) -> Self { + Self { + connector_definition_name, + auth, + request, + dcr_config: None, + } + } +} +#[doc = "Google Cloud Platform request section properties."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GcpRequestProperties { + #[doc = "The GCP project id."] + #[serde(rename = "projectId")] + pub project_id: String, + #[doc = "The GCP pub/sub subscription names."] + #[serde(rename = "subscriptionNames")] + pub subscription_names: Vec, +} +impl GcpRequestProperties { + pub fn new(project_id: String, subscription_names: Vec) -> Self { + Self { + project_id, + subscription_names, + } + } +} #[doc = "GetInsights Query Errors."] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GetInsightsErrorKind { @@ -6084,497 +6420,269 @@ pub mod grouping_configuration { } } } -#[doc = "Represents a Hunting bookmark entity."] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HuntingBookmark { - #[serde(flatten)] - pub entity: Entity, - #[doc = "Describes bookmark properties"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub properties: Option, -} -impl HuntingBookmark { - pub fn new(entity: Entity) -> Self { - Self { entity, properties: None } - } -} -#[doc = "Describes bookmark properties"] -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct HuntingBookmarkProperties { +#[doc = "Represents a Hunt in Azure Security Insights."] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)] +pub struct Hunt { #[serde(flatten)] - pub entity_common_properties: EntityCommonProperties, - #[doc = "The time the bookmark was created"] - #[serde(default, with = "azure_core::date::rfc3339::option")] - pub created: Option, - #[doc = "User information that made some action"] - #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")] - pub created_by: Option, - #[doc = "The display name of the bookmark"] - #[serde(rename = "displayName")] - pub display_name: String, - #[doc = "The time of the event"] - #[serde(rename = "eventTime", default, with = "azure_core::date::rfc3339::option")] - pub event_time: Option, - #[doc = "List of labels relevant to this bookmark"] - #[serde( - default, - deserialize_with = "azure_core::util::deserialize_null_as_default", - skip_serializing_if = "Vec::is_empty" - )] - pub labels: Vec